diff --git a/modules/gpucodec/include/opencv2/gpucodec.hpp b/modules/gpucodec/include/opencv2/gpucodec.hpp index f2e298fd70..0439487c5c 100644 --- a/modules/gpucodec/include/opencv2/gpucodec.hpp +++ b/modules/gpucodec/include/opencv2/gpucodec.hpp @@ -50,7 +50,7 @@ #include "opencv2/core/gpu.hpp" -namespace cv { namespace gpucodec { +namespace cv { namespace cudacodec { ////////////////////////////////// Video Encoding ////////////////////////////////// @@ -201,6 +201,6 @@ public: CV_EXPORTS Ptr createVideoReader(const String& filename); CV_EXPORTS Ptr createVideoReader(const Ptr& source); -}} // namespace cv { namespace gpucodec { +}} // namespace cv { namespace cudacodec { #endif /* __OPENCV_GPUCODEC_HPP__ */ diff --git a/modules/gpucodec/perf/perf_video.cpp b/modules/gpucodec/perf/perf_video.cpp index 6e60ed7dcc..39d85d8813 100644 --- a/modules/gpucodec/perf/perf_video.cpp +++ b/modules/gpucodec/perf/perf_video.cpp @@ -75,7 +75,7 @@ PERF_TEST_P(FileName, VideoReader, Values("gpu/video/768x576.avi", "gpu/video/19 if (PERF_RUN_GPU()) { - cv::Ptr d_reader = cv::gpucodec::createVideoReader(inputFile); + cv::Ptr d_reader = cv::cudacodec::createVideoReader(inputFile); cv::cuda::GpuMat frame; @@ -119,7 +119,7 @@ PERF_TEST_P(FileName, VideoWriter, Values("gpu/video/768x576.avi", "gpu/video/19 if (PERF_RUN_GPU()) { - cv::Ptr d_writer; + cv::Ptr d_writer; cv::cuda::GpuMat d_frame; @@ -131,7 +131,7 @@ PERF_TEST_P(FileName, VideoWriter, Values("gpu/video/768x576.avi", "gpu/video/19 d_frame.upload(frame); if (d_writer.empty()) - d_writer = cv::gpucodec::createVideoWriter(outputFile, frame.size(), FPS); + d_writer = cv::cudacodec::createVideoWriter(outputFile, frame.size(), FPS); startTimer(); next(); d_writer->write(d_frame); diff --git a/modules/gpucodec/src/cuvid_video_source.cpp b/modules/gpucodec/src/cuvid_video_source.cpp index 477951e931..fd6eac72de 100644 --- a/modules/gpucodec/src/cuvid_video_source.cpp +++ b/modules/gpucodec/src/cuvid_video_source.cpp @@ -46,10 +46,10 @@ #ifdef HAVE_NVCUVID using namespace cv; -using namespace cv::gpucodec; -using namespace cv::gpucodec::detail; +using namespace cv::cudacodec; +using namespace cv::cudacodec::detail; -cv::gpucodec::detail::CuvidVideoSource::CuvidVideoSource(const String& fname) +cv::cudacodec::detail::CuvidVideoSource::CuvidVideoSource(const String& fname) { CUVIDSOURCEPARAMS params; std::memset(¶ms, 0, sizeof(CUVIDSOURCEPARAMS)); @@ -74,37 +74,37 @@ cv::gpucodec::detail::CuvidVideoSource::CuvidVideoSource(const String& fname) format_.height = vidfmt.coded_height; } -cv::gpucodec::detail::CuvidVideoSource::~CuvidVideoSource() +cv::cudacodec::detail::CuvidVideoSource::~CuvidVideoSource() { cuvidDestroyVideoSource(videoSource_); } -FormatInfo cv::gpucodec::detail::CuvidVideoSource::format() const +FormatInfo cv::cudacodec::detail::CuvidVideoSource::format() const { return format_; } -void cv::gpucodec::detail::CuvidVideoSource::start() +void cv::cudacodec::detail::CuvidVideoSource::start() { cuSafeCall( cuvidSetVideoSourceState(videoSource_, cudaVideoState_Started) ); } -void cv::gpucodec::detail::CuvidVideoSource::stop() +void cv::cudacodec::detail::CuvidVideoSource::stop() { cuSafeCall( cuvidSetVideoSourceState(videoSource_, cudaVideoState_Stopped) ); } -bool cv::gpucodec::detail::CuvidVideoSource::isStarted() const +bool cv::cudacodec::detail::CuvidVideoSource::isStarted() const { return (cuvidGetVideoSourceState(videoSource_) == cudaVideoState_Started); } -bool cv::gpucodec::detail::CuvidVideoSource::hasError() const +bool cv::cudacodec::detail::CuvidVideoSource::hasError() const { return (cuvidGetVideoSourceState(videoSource_) == cudaVideoState_Error); } -int CUDAAPI cv::gpucodec::detail::CuvidVideoSource::HandleVideoData(void* userData, CUVIDSOURCEDATAPACKET* packet) +int CUDAAPI cv::cudacodec::detail::CuvidVideoSource::HandleVideoData(void* userData, CUVIDSOURCEDATAPACKET* packet) { CuvidVideoSource* thiz = static_cast(userData); diff --git a/modules/gpucodec/src/cuvid_video_source.hpp b/modules/gpucodec/src/cuvid_video_source.hpp index c2f0e2f571..65f5526bf5 100644 --- a/modules/gpucodec/src/cuvid_video_source.hpp +++ b/modules/gpucodec/src/cuvid_video_source.hpp @@ -50,7 +50,7 @@ #include "opencv2/gpucodec.hpp" #include "video_source.hpp" -namespace cv { namespace gpucodec { namespace detail +namespace cv { namespace cudacodec { namespace detail { class CuvidVideoSource : public VideoSource diff --git a/modules/gpucodec/src/ffmpeg_video_source.cpp b/modules/gpucodec/src/ffmpeg_video_source.cpp index 86d1b59313..c98d2c1846 100644 --- a/modules/gpucodec/src/ffmpeg_video_source.cpp +++ b/modules/gpucodec/src/ffmpeg_video_source.cpp @@ -46,8 +46,8 @@ #ifdef HAVE_NVCUVID using namespace cv; -using namespace cv::gpucodec; -using namespace cv::gpucodec::detail; +using namespace cv::cudacodec; +using namespace cv::cudacodec::detail; namespace { @@ -95,7 +95,7 @@ namespace } } -cv::gpucodec::detail::FFmpegVideoSource::FFmpegVideoSource(const String& fname) : +cv::cudacodec::detail::FFmpegVideoSource::FFmpegVideoSource(const String& fname) : stream_(0) { CV_Assert( init_MediaStream_FFMPEG() ); @@ -115,18 +115,18 @@ cv::gpucodec::detail::FFmpegVideoSource::FFmpegVideoSource(const String& fname) format_.height = height; } -cv::gpucodec::detail::FFmpegVideoSource::~FFmpegVideoSource() +cv::cudacodec::detail::FFmpegVideoSource::~FFmpegVideoSource() { if (stream_) release_InputMediaStream_FFMPEG_p(stream_); } -FormatInfo cv::gpucodec::detail::FFmpegVideoSource::format() const +FormatInfo cv::cudacodec::detail::FFmpegVideoSource::format() const { return format_; } -bool cv::gpucodec::detail::FFmpegVideoSource::getNextPacket(unsigned char** data, int* size, bool* bEndOfFile) +bool cv::cudacodec::detail::FFmpegVideoSource::getNextPacket(unsigned char** data, int* size, bool* bEndOfFile) { int endOfFile; diff --git a/modules/gpucodec/src/ffmpeg_video_source.hpp b/modules/gpucodec/src/ffmpeg_video_source.hpp index 6ea59ddac1..46333bc413 100644 --- a/modules/gpucodec/src/ffmpeg_video_source.hpp +++ b/modules/gpucodec/src/ffmpeg_video_source.hpp @@ -48,7 +48,7 @@ struct InputMediaStream_FFMPEG; -namespace cv { namespace gpucodec { namespace detail { +namespace cv { namespace cudacodec { namespace detail { class FFmpegVideoSource : public RawVideoSource { diff --git a/modules/gpucodec/src/frame_queue.cpp b/modules/gpucodec/src/frame_queue.cpp index f9141d84f5..d3c42c902c 100644 --- a/modules/gpucodec/src/frame_queue.cpp +++ b/modules/gpucodec/src/frame_queue.cpp @@ -45,7 +45,7 @@ #ifdef HAVE_NVCUVID -cv::gpucodec::detail::FrameQueue::FrameQueue() : +cv::cudacodec::detail::FrameQueue::FrameQueue() : endOfDecode_(0), framesInQueue_(0), readPosition_(0) @@ -54,7 +54,7 @@ cv::gpucodec::detail::FrameQueue::FrameQueue() : std::memset((void*) isFrameInUse_, 0, sizeof(isFrameInUse_)); } -bool cv::gpucodec::detail::FrameQueue::waitUntilFrameAvailable(int pictureIndex) +bool cv::cudacodec::detail::FrameQueue::waitUntilFrameAvailable(int pictureIndex) { while (isInUse(pictureIndex)) { @@ -68,7 +68,7 @@ bool cv::gpucodec::detail::FrameQueue::waitUntilFrameAvailable(int pictureIndex) return true; } -void cv::gpucodec::detail::FrameQueue::enqueue(const CUVIDPARSERDISPINFO* picParams) +void cv::cudacodec::detail::FrameQueue::enqueue(const CUVIDPARSERDISPINFO* picParams) { // Mark the frame as 'in-use' so we don't re-use it for decoding until it is no longer needed // for display @@ -99,7 +99,7 @@ void cv::gpucodec::detail::FrameQueue::enqueue(const CUVIDPARSERDISPINFO* picPar } while (!isEndOfDecode()); } -bool cv::gpucodec::detail::FrameQueue::dequeue(CUVIDPARSERDISPINFO& displayInfo) +bool cv::cudacodec::detail::FrameQueue::dequeue(CUVIDPARSERDISPINFO& displayInfo) { AutoLock autoLock(mtx_); diff --git a/modules/gpucodec/src/frame_queue.hpp b/modules/gpucodec/src/frame_queue.hpp index c3b427b74f..92c88323e4 100644 --- a/modules/gpucodec/src/frame_queue.hpp +++ b/modules/gpucodec/src/frame_queue.hpp @@ -49,7 +49,7 @@ #include -namespace cv { namespace gpucodec { namespace detail +namespace cv { namespace cudacodec { namespace detail { class FrameQueue diff --git a/modules/gpucodec/src/thread.cpp b/modules/gpucodec/src/thread.cpp index b936d8e21a..24e8abd0dd 100644 --- a/modules/gpucodec/src/thread.cpp +++ b/modules/gpucodec/src/thread.cpp @@ -45,7 +45,7 @@ #ifdef HAVE_NVCUVID -using namespace cv::gpucodec::detail; +using namespace cv::cudacodec::detail; #ifdef WIN32 @@ -67,7 +67,7 @@ namespace } } -class cv::gpucodec::detail::Thread::Impl +class cv::cudacodec::detail::Thread::Impl { public: Impl(Thread::Func func, void* userData) @@ -120,7 +120,7 @@ namespace } } -class cv::gpucodec::detail::Thread::Impl +class cv::cudacodec::detail::Thread::Impl { public: Impl(Thread::Func func, void* userData) @@ -148,17 +148,17 @@ private: #endif -cv::gpucodec::detail::Thread::Thread(Func func, void* userData) : +cv::cudacodec::detail::Thread::Thread(Func func, void* userData) : impl_(new Impl(func, userData)) { } -void cv::gpucodec::detail::Thread::wait() +void cv::cudacodec::detail::Thread::wait() { impl_->wait(); } -void cv::gpucodec::detail::Thread::sleep(int ms) +void cv::cudacodec::detail::Thread::sleep(int ms) { #ifdef WIN32 ::Sleep(ms); @@ -167,7 +167,7 @@ void cv::gpucodec::detail::Thread::sleep(int ms) #endif } -template <> void cv::Ptr::delete_obj() +template <> void cv::Ptr::delete_obj() { if (obj) delete obj; } diff --git a/modules/gpucodec/src/thread.hpp b/modules/gpucodec/src/thread.hpp index ccda5b5c7c..67e25dc0cd 100644 --- a/modules/gpucodec/src/thread.hpp +++ b/modules/gpucodec/src/thread.hpp @@ -46,7 +46,7 @@ #include "opencv2/core.hpp" -namespace cv { namespace gpucodec { namespace detail { +namespace cv { namespace cudacodec { namespace detail { class Thread { @@ -68,7 +68,7 @@ private: }}} namespace cv { - template <> void Ptr::delete_obj(); + template <> void Ptr::delete_obj(); } #endif // __THREAD_WRAPPERS_HPP__ diff --git a/modules/gpucodec/src/video_decoder.cpp b/modules/gpucodec/src/video_decoder.cpp index d734ef363a..35919c3f56 100644 --- a/modules/gpucodec/src/video_decoder.cpp +++ b/modules/gpucodec/src/video_decoder.cpp @@ -45,7 +45,7 @@ #ifdef HAVE_NVCUVID -void cv::gpucodec::detail::VideoDecoder::create(const FormatInfo& videoFormat) +void cv::cudacodec::detail::VideoDecoder::create(const FormatInfo& videoFormat) { release(); @@ -104,7 +104,7 @@ void cv::gpucodec::detail::VideoDecoder::create(const FormatInfo& videoFormat) cuSafeCall( cuvidCreateDecoder(&decoder_, &createInfo_) ); } -void cv::gpucodec::detail::VideoDecoder::release() +void cv::cudacodec::detail::VideoDecoder::release() { if (decoder_) { diff --git a/modules/gpucodec/src/video_decoder.hpp b/modules/gpucodec/src/video_decoder.hpp index 468f6f1e10..90fa50016e 100644 --- a/modules/gpucodec/src/video_decoder.hpp +++ b/modules/gpucodec/src/video_decoder.hpp @@ -49,7 +49,7 @@ #include "opencv2/core/private.gpu.hpp" #include "opencv2/gpucodec.hpp" -namespace cv { namespace gpucodec { namespace detail +namespace cv { namespace cudacodec { namespace detail { class VideoDecoder diff --git a/modules/gpucodec/src/video_parser.cpp b/modules/gpucodec/src/video_parser.cpp index 66aab62ad1..737f585118 100644 --- a/modules/gpucodec/src/video_parser.cpp +++ b/modules/gpucodec/src/video_parser.cpp @@ -45,7 +45,7 @@ #ifdef HAVE_NVCUVID -cv::gpucodec::detail::VideoParser::VideoParser(VideoDecoder* videoDecoder, FrameQueue* frameQueue) : +cv::cudacodec::detail::VideoParser::VideoParser(VideoDecoder* videoDecoder, FrameQueue* frameQueue) : videoDecoder_(videoDecoder), frameQueue_(frameQueue), unparsedPackets_(0), hasError_(false) { CUVIDPARSERPARAMS params; @@ -62,7 +62,7 @@ cv::gpucodec::detail::VideoParser::VideoParser(VideoDecoder* videoDecoder, Frame cuSafeCall( cuvidCreateVideoParser(&parser_, ¶ms) ); } -bool cv::gpucodec::detail::VideoParser::parseVideoData(const unsigned char* data, size_t size, bool endOfStream) +bool cv::cudacodec::detail::VideoParser::parseVideoData(const unsigned char* data, size_t size, bool endOfStream) { CUVIDSOURCEDATAPACKET packet; std::memset(&packet, 0, sizeof(CUVIDSOURCEDATAPACKET)); @@ -96,7 +96,7 @@ bool cv::gpucodec::detail::VideoParser::parseVideoData(const unsigned char* data return !frameQueue_->isEndOfDecode(); } -int CUDAAPI cv::gpucodec::detail::VideoParser::HandleVideoSequence(void* userData, CUVIDEOFORMAT* format) +int CUDAAPI cv::cudacodec::detail::VideoParser::HandleVideoSequence(void* userData, CUVIDEOFORMAT* format) { VideoParser* thiz = static_cast(userData); @@ -128,7 +128,7 @@ int CUDAAPI cv::gpucodec::detail::VideoParser::HandleVideoSequence(void* userDat return true; } -int CUDAAPI cv::gpucodec::detail::VideoParser::HandlePictureDecode(void* userData, CUVIDPICPARAMS* picParams) +int CUDAAPI cv::cudacodec::detail::VideoParser::HandlePictureDecode(void* userData, CUVIDPICPARAMS* picParams) { VideoParser* thiz = static_cast(userData); @@ -148,7 +148,7 @@ int CUDAAPI cv::gpucodec::detail::VideoParser::HandlePictureDecode(void* userDat return true; } -int CUDAAPI cv::gpucodec::detail::VideoParser::HandlePictureDisplay(void* userData, CUVIDPARSERDISPINFO* picParams) +int CUDAAPI cv::cudacodec::detail::VideoParser::HandlePictureDisplay(void* userData, CUVIDPARSERDISPINFO* picParams) { VideoParser* thiz = static_cast(userData); diff --git a/modules/gpucodec/src/video_parser.hpp b/modules/gpucodec/src/video_parser.hpp index b4dddb3895..96526ea868 100644 --- a/modules/gpucodec/src/video_parser.hpp +++ b/modules/gpucodec/src/video_parser.hpp @@ -51,7 +51,7 @@ #include "frame_queue.hpp" #include "video_decoder.hpp" -namespace cv { namespace gpucodec { namespace detail +namespace cv { namespace cudacodec { namespace detail { class VideoParser diff --git a/modules/gpucodec/src/video_reader.cpp b/modules/gpucodec/src/video_reader.cpp index f67833b094..642fdd2375 100644 --- a/modules/gpucodec/src/video_reader.cpp +++ b/modules/gpucodec/src/video_reader.cpp @@ -44,12 +44,12 @@ using namespace cv; using namespace cv::cuda; -using namespace cv::gpucodec; +using namespace cv::cudacodec; #ifndef HAVE_NVCUVID -Ptr cv::gpucodec::createVideoReader(const String&) { throw_no_cuda(); return Ptr(); } -Ptr cv::gpucodec::createVideoReader(const Ptr&) { throw_no_cuda(); return Ptr(); } +Ptr cv::cudacodec::createVideoReader(const String&) { throw_no_cuda(); return Ptr(); } +Ptr cv::cudacodec::createVideoReader(const Ptr&) { throw_no_cuda(); return Ptr(); } #else // HAVE_NVCUVID @@ -208,7 +208,7 @@ namespace } } -Ptr cv::gpucodec::createVideoReader(const String& filename) +Ptr cv::cudacodec::createVideoReader(const String& filename) { CV_Assert( !filename.empty() ); @@ -227,7 +227,7 @@ Ptr cv::gpucodec::createVideoReader(const String& filename) return new VideoReaderImpl(videoSource); } -Ptr cv::gpucodec::createVideoReader(const Ptr& source) +Ptr cv::cudacodec::createVideoReader(const Ptr& source) { Ptr videoSource(new detail::RawVideoSourceWrapper(source)); return new VideoReaderImpl(videoSource); diff --git a/modules/gpucodec/src/video_source.cpp b/modules/gpucodec/src/video_source.cpp index ce6a1bd8c0..be2d79573c 100644 --- a/modules/gpucodec/src/video_source.cpp +++ b/modules/gpucodec/src/video_source.cpp @@ -46,50 +46,50 @@ #ifdef HAVE_NVCUVID using namespace cv; -using namespace cv::gpucodec; -using namespace cv::gpucodec::detail; +using namespace cv::cudacodec; +using namespace cv::cudacodec::detail; -bool cv::gpucodec::detail::VideoSource::parseVideoData(const unsigned char* data, size_t size, bool endOfStream) +bool cv::cudacodec::detail::VideoSource::parseVideoData(const unsigned char* data, size_t size, bool endOfStream) { return videoParser_->parseVideoData(data, size, endOfStream); } -cv::gpucodec::detail::RawVideoSourceWrapper::RawVideoSourceWrapper(const Ptr& source) : +cv::cudacodec::detail::RawVideoSourceWrapper::RawVideoSourceWrapper(const Ptr& source) : source_(source) { CV_Assert( !source_.empty() ); } -cv::gpucodec::FormatInfo cv::gpucodec::detail::RawVideoSourceWrapper::format() const +cv::cudacodec::FormatInfo cv::cudacodec::detail::RawVideoSourceWrapper::format() const { return source_->format(); } -void cv::gpucodec::detail::RawVideoSourceWrapper::start() +void cv::cudacodec::detail::RawVideoSourceWrapper::start() { stop_ = false; hasError_ = false; thread_ = new Thread(readLoop, this); } -void cv::gpucodec::detail::RawVideoSourceWrapper::stop() +void cv::cudacodec::detail::RawVideoSourceWrapper::stop() { stop_ = true; thread_->wait(); thread_.release(); } -bool cv::gpucodec::detail::RawVideoSourceWrapper::isStarted() const +bool cv::cudacodec::detail::RawVideoSourceWrapper::isStarted() const { return !stop_; } -bool cv::gpucodec::detail::RawVideoSourceWrapper::hasError() const +bool cv::cudacodec::detail::RawVideoSourceWrapper::hasError() const { return hasError_; } -void cv::gpucodec::detail::RawVideoSourceWrapper::readLoop(void* userData) +void cv::cudacodec::detail::RawVideoSourceWrapper::readLoop(void* userData) { RawVideoSourceWrapper* thiz = static_cast(userData); diff --git a/modules/gpucodec/src/video_source.hpp b/modules/gpucodec/src/video_source.hpp index b4d930ee09..802424e422 100644 --- a/modules/gpucodec/src/video_source.hpp +++ b/modules/gpucodec/src/video_source.hpp @@ -48,7 +48,7 @@ #include "opencv2/gpucodec.hpp" #include "thread.hpp" -namespace cv { namespace gpucodec { namespace detail +namespace cv { namespace cudacodec { namespace detail { class VideoParser; diff --git a/modules/gpucodec/src/video_writer.cpp b/modules/gpucodec/src/video_writer.cpp index a6fe9524cb..c2092c8379 100644 --- a/modules/gpucodec/src/video_writer.cpp +++ b/modules/gpucodec/src/video_writer.cpp @@ -45,20 +45,20 @@ using namespace cv; using namespace cv::cuda; -using namespace cv::gpucodec; +using namespace cv::cudacodec; #if !defined(HAVE_NVCUVID) || !defined(WIN32) -cv::gpucodec::EncoderParams::EncoderParams() { throw_no_cuda(); } -cv::gpucodec::EncoderParams::EncoderParams(const String&) { throw_no_cuda(); } -void cv::gpucodec::EncoderParams::load(const String&) { throw_no_cuda(); } -void cv::gpucodec::EncoderParams::save(const String&) const { throw_no_cuda(); } +cv::cudacodec::EncoderParams::EncoderParams() { throw_no_cuda(); } +cv::cudacodec::EncoderParams::EncoderParams(const String&) { throw_no_cuda(); } +void cv::cudacodec::EncoderParams::load(const String&) { throw_no_cuda(); } +void cv::cudacodec::EncoderParams::save(const String&) const { throw_no_cuda(); } -Ptr cv::gpucodec::createVideoWriter(const String&, Size, double, SurfaceFormat) { throw_no_cuda(); return Ptr(); } -Ptr cv::gpucodec::createVideoWriter(const String&, Size, double, const EncoderParams&, SurfaceFormat) { throw_no_cuda(); return Ptr(); } +Ptr cv::cudacodec::createVideoWriter(const String&, Size, double, SurfaceFormat) { throw_no_cuda(); return Ptr(); } +Ptr cv::cudacodec::createVideoWriter(const String&, Size, double, const EncoderParams&, SurfaceFormat) { throw_no_cuda(); return Ptr(); } -Ptr cv::gpucodec::createVideoWriter(const Ptr&, Size, double, SurfaceFormat) { throw_no_cuda(); return Ptr(); } -Ptr cv::gpucodec::createVideoWriter(const Ptr&, Size, double, const EncoderParams&, SurfaceFormat) { throw_no_cuda(); return Ptr(); } +Ptr cv::cudacodec::createVideoWriter(const Ptr&, Size, double, SurfaceFormat) { throw_no_cuda(); return Ptr(); } +Ptr cv::cudacodec::createVideoWriter(const Ptr&, Size, double, const EncoderParams&, SurfaceFormat) { throw_no_cuda(); return Ptr(); } #else // !defined HAVE_CUDA || !defined WIN32 @@ -811,7 +811,7 @@ namespace /////////////////////////////////////////////////////////////////////////// // EncoderParams -cv::gpucodec::EncoderParams::EncoderParams() +cv::cudacodec::EncoderParams::EncoderParams() { P_Interval = 3; IDR_Period = 15; @@ -834,12 +834,12 @@ cv::gpucodec::EncoderParams::EncoderParams() DisableSPSPPS = 0; } -cv::gpucodec::EncoderParams::EncoderParams(const String& configFile) +cv::cudacodec::EncoderParams::EncoderParams(const String& configFile) { load(configFile); } -void cv::gpucodec::EncoderParams::load(const String& configFile) +void cv::cudacodec::EncoderParams::load(const String& configFile) { FileStorage fs(configFile, FileStorage::READ); CV_Assert( fs.isOpened() ); @@ -865,7 +865,7 @@ void cv::gpucodec::EncoderParams::load(const String& configFile) read(fs["DisableSPSPPS" ], DisableSPSPPS, 0); } -void cv::gpucodec::EncoderParams::save(const String& configFile) const +void cv::cudacodec::EncoderParams::save(const String& configFile) const { FileStorage fs(configFile, FileStorage::WRITE); CV_Assert( fs.isOpened() ); @@ -894,24 +894,24 @@ void cv::gpucodec::EncoderParams::save(const String& configFile) const /////////////////////////////////////////////////////////////////////////// // createVideoWriter -Ptr cv::gpucodec::createVideoWriter(const String& fileName, Size frameSize, double fps, SurfaceFormat format) +Ptr cv::cudacodec::createVideoWriter(const String& fileName, Size frameSize, double fps, SurfaceFormat format) { Ptr encoderCallback(new EncoderCallBackFFMPEG(fileName, frameSize, fps)); return createVideoWriter(encoderCallback, frameSize, fps, format); } -Ptr cv::gpucodec::createVideoWriter(const String& fileName, Size frameSize, double fps, const EncoderParams& params, SurfaceFormat format) +Ptr cv::cudacodec::createVideoWriter(const String& fileName, Size frameSize, double fps, const EncoderParams& params, SurfaceFormat format) { Ptr encoderCallback(new EncoderCallBackFFMPEG(fileName, frameSize, fps)); return createVideoWriter(encoderCallback, frameSize, fps, params, format); } -Ptr cv::gpucodec::createVideoWriter(const Ptr& encoderCallback, Size frameSize, double fps, SurfaceFormat format) +Ptr cv::cudacodec::createVideoWriter(const Ptr& encoderCallback, Size frameSize, double fps, SurfaceFormat format) { return new VideoWriterImpl(encoderCallback, frameSize, fps, format); } -Ptr cv::gpucodec::createVideoWriter(const Ptr& encoderCallback, Size frameSize, double fps, const EncoderParams& params, SurfaceFormat format) +Ptr cv::cudacodec::createVideoWriter(const Ptr& encoderCallback, Size frameSize, double fps, const EncoderParams& params, SurfaceFormat format) { return new VideoWriterImpl(encoderCallback, frameSize, fps, params, format); } diff --git a/modules/gpucodec/test/test_video.cpp b/modules/gpucodec/test/test_video.cpp index 1313be766f..04efd6602a 100644 --- a/modules/gpucodec/test/test_video.cpp +++ b/modules/gpucodec/test/test_video.cpp @@ -57,7 +57,7 @@ GPU_TEST_P(Video, Reader) const std::string inputFile = std::string(cvtest::TS::ptr()->get_data_path()) + "video/" + GET_PARAM(1); - cv::Ptr reader = cv::gpucodec::createVideoReader(inputFile); + cv::Ptr reader = cv::cudacodec::createVideoReader(inputFile); cv::cuda::GpuMat frame; @@ -85,7 +85,7 @@ GPU_TEST_P(Video, Writer) cv::VideoCapture reader(inputFile); ASSERT_TRUE(reader.isOpened()); - cv::Ptr d_writer; + cv::Ptr d_writer; cv::Mat frame; cv::cuda::GpuMat d_frame; @@ -98,7 +98,7 @@ GPU_TEST_P(Video, Writer) d_frame.upload(frame); if (d_writer.empty()) - d_writer = cv::gpucodec::createVideoWriter(outputFile, frame.size(), FPS); + d_writer = cv::cudacodec::createVideoWriter(outputFile, frame.size(), FPS); d_writer->write(d_frame); } diff --git a/modules/superres/src/frame_source.cpp b/modules/superres/src/frame_source.cpp index 3b366aff96..f20f6182e2 100644 --- a/modules/superres/src/frame_source.cpp +++ b/modules/superres/src/frame_source.cpp @@ -222,7 +222,7 @@ namespace private: String fileName_; - Ptr reader_; + Ptr reader_; GpuMat frame_; }; @@ -251,7 +251,7 @@ namespace void VideoFrameSource_GPU::reset() { - reader_ = gpucodec::createVideoReader(fileName_); + reader_ = cudacodec::createVideoReader(fileName_); } } diff --git a/samples/gpu/video_reader.cpp b/samples/gpu/video_reader.cpp index 13f8cb8081..8d088f919a 100644 --- a/samples/gpu/video_reader.cpp +++ b/samples/gpu/video_reader.cpp @@ -30,7 +30,7 @@ int main(int argc, const char* argv[]) cv::VideoCapture reader(fname); cv::cuda::GpuMat d_frame; - cv::Ptr d_reader = cv::gpucodec::createVideoReader(fname); + cv::Ptr d_reader = cv::cudacodec::createVideoReader(fname); cv::TickMeter tm; std::vector cpu_times; diff --git a/samples/gpu/video_writer.cpp b/samples/gpu/video_writer.cpp index c1bcc5d368..470e7e5518 100644 --- a/samples/gpu/video_writer.cpp +++ b/samples/gpu/video_writer.cpp @@ -33,7 +33,7 @@ int main(int argc, const char* argv[]) cv::gpu::printShortCudaDeviceInfo(cv::gpu::getDevice()); cv::VideoWriter writer; - cv::Ptr d_writer; + cv::Ptr d_writer; cv::Mat frame; cv::gpu::GpuMat d_frame; @@ -68,7 +68,7 @@ int main(int argc, const char* argv[]) { std::cout << "Open GPU Writer" << std::endl; - d_writer = cv::gpucodec::createVideoWriter("output_gpu.avi", frame.size(), FPS); + d_writer = cv::cudacodec::createVideoWriter("output_gpu.avi", frame.size(), FPS); } d_frame.upload(frame);