Skip to content

Commit 179021f

Browse files
authored
Merge pull request #3534 from VadimLevin:dev/vlevin/remove-using-namespace-public-cudacodec-header
fix: remove using namespace cuda from public header
2 parents 4899bee + 68c708d commit 179021f

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

modules/cudacodec/include/opencv2/cudacodec.hpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@
5959

6060
namespace cv { namespace cudacodec {
6161

62-
using namespace cuda; // Stream
63-
6462
//! @addtogroup cudacodec
6563
//! @{
6664

@@ -264,7 +262,7 @@ class CV_EXPORTS_W VideoWriter
264262
@param stream Stream for frame pre-processing.
265263
*/
266264
CV_EXPORTS_W Ptr<cudacodec::VideoWriter> createVideoWriter(const String& fileName, const Size frameSize, const Codec codec = Codec::H264, const double fps = 25.0,
267-
const ColorFormat colorFormat = ColorFormat::BGR, Ptr<EncoderCallback> encoderCallback = 0, const Stream& stream = Stream::Null());
265+
const ColorFormat colorFormat = ColorFormat::BGR, Ptr<EncoderCallback> encoderCallback = 0, const cuda::Stream& stream = cuda::Stream::Null());
268266

269267
/** @brief Creates video writer.
270268
@@ -278,7 +276,7 @@ CV_EXPORTS_W Ptr<cudacodec::VideoWriter> createVideoWriter(const String& fileNam
278276
@param stream Stream for frame pre-processing.
279277
*/
280278
CV_EXPORTS_W Ptr<cudacodec::VideoWriter> createVideoWriter(const String& fileName, const Size frameSize, const Codec codec, const double fps, const ColorFormat colorFormat,
281-
const EncoderParams& params, Ptr<EncoderCallback> encoderCallback = 0, const Stream& stream = Stream::Null());
279+
const EncoderParams& params, Ptr<EncoderCallback> encoderCallback = 0, const cuda::Stream& stream = cuda::Stream::Null());
282280

283281
////////////////////////////////// Video Decoding //////////////////////////////////////////
284282

@@ -313,7 +311,7 @@ enum DeinterlaceMode
313311
- This function demonstrates how to map the luma histogram back so that it is equivalent to the result obtained from cuda::calcHist()
314312
if the returned frame was colorFormat::GRAY.
315313
*/
316-
CV_EXPORTS_W void MapHist(const GpuMat& hist, CV_OUT Mat& histFull);
314+
CV_EXPORTS_W void MapHist(const cuda::GpuMat& hist, CV_OUT Mat& histFull);
317315

318316
/** @brief Struct providing information about video file format. :
319317
*/
@@ -387,7 +385,7 @@ class CV_EXPORTS_W VideoReader
387385
If no frames have been grabbed (there are no more frames in video file), the methods return false.
388386
The method throws an Exception if error occurs.
389387
*/
390-
CV_WRAP virtual bool nextFrame(CV_OUT GpuMat& frame, Stream &stream = Stream::Null()) = 0;
388+
CV_WRAP virtual bool nextFrame(CV_OUT cuda::GpuMat& frame, cuda::Stream &stream = cuda::Stream::Null()) = 0;
391389

392390
/** @brief Grabs, decodes and returns the next video frame and frame luma histogram.
393391
@@ -401,7 +399,7 @@ class CV_EXPORTS_W VideoReader
401399
402400
@note Histogram data is collected by NVDEC during the decoding process resulting in zero performance penalty. NVDEC computes the histogram data for only the luma component of decoded output, not on post-processed frame(i.e. when scaling, cropping, etc. applied). If the source is encoded using a limited range of luma values (FormatInfo::videoFullRangeFlag == false) then the histogram bin values will correspond to to this limited range of values and will need to be mapped to contain the same output as cuda::calcHist(). The MapHist() utility function can be used to perform this mapping on the host if required.
403401
*/
404-
CV_WRAP_AS(nextFrameWithHist) virtual bool nextFrame(CV_OUT GpuMat& frame, CV_OUT GpuMat& histogram, Stream& stream = Stream::Null()) = 0;
402+
CV_WRAP_AS(nextFrameWithHist) virtual bool nextFrame(CV_OUT cuda::GpuMat& frame, CV_OUT cuda::GpuMat& histogram, cuda::Stream& stream = cuda::Stream::Null()) = 0;
405403

406404
/** @brief Returns information about video file format.
407405
*/
@@ -418,7 +416,7 @@ class CV_EXPORTS_W VideoReader
418416
The primary use of the function is for reading both the encoded and decoded video data when rawMode is enabled. With rawMode enabled
419417
retrieve() can be called following grab() to retrieve all the data associated with the current video source since the last call to grab() or the creation of the VideoReader.
420418
*/
421-
CV_WRAP virtual bool grab(Stream& stream = Stream::Null()) = 0;
419+
CV_WRAP virtual bool grab(cuda::Stream& stream = cuda::Stream::Null()) = 0;
422420

423421
/** @brief Returns previously grabbed video data.
424422
@@ -457,7 +455,7 @@ class CV_EXPORTS_W VideoReader
457455
The method returns data associated with the current video source since the last call to grab(). If no data is present
458456
the method returns false and the function returns an empty image.
459457
*/
460-
CV_WRAP inline bool retrieve(CV_OUT GpuMat& frame) const {
458+
CV_WRAP inline bool retrieve(CV_OUT cuda::GpuMat& frame) const {
461459
return retrieve(OutputArray(frame));
462460
}
463461

modules/cudacodec/src/video_decoder.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class VideoDecoder
9696
return cuvidDecodePicture(decoder_, picParams) == CUDA_SUCCESS;
9797
}
9898

99-
GpuMat mapFrame(int picIdx, CUVIDPROCPARAMS& videoProcParams)
99+
cuda::GpuMat mapFrame(int picIdx, CUVIDPROCPARAMS& videoProcParams)
100100
{
101101
CUdeviceptr ptr;
102102
unsigned int pitch;

0 commit comments

Comments
 (0)