1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-19 02:16:34 +08:00

Merge pull request #3198 from cudawarped:cudacodec_add_frame_colour_format_request

cudacodec::VideoReader add colour format selection functionality

* Add capacity to select different colour formats for each decoded frame produced by cudacodec::VideoReader.
Updated accompanying test.

* Address warning
This commit is contained in:
cudawarped
2022-03-24 09:32:11 +00:00
committed by GitHub
parent ed38f75f07
commit 1490611d63
4 changed files with 61 additions and 16 deletions

View File

@@ -320,6 +320,18 @@ enum class VideoReaderProps {
PROP_NUMBER_OF_RAW_PACKAGES_SINCE_LAST_GRAB = 3, //!< Number of raw packages recieved since the last call to grab().
PROP_RAW_MODE = 4, //!< Status of raw mode.
PROP_LRF_HAS_KEY_FRAME = 5, //!< FFmpeg source only - Indicates whether the Last Raw Frame (LRF), output from VideoReader::retrieve() when VideoReader is initialized in raw mode, contains encoded data for a key frame.
PROP_COLOR_FORMAT = 6, //!< Set the ColorFormat of the decoded frame. This can be changed before every call to nextFrame() and retrieve().
#ifndef CV_DOXYGEN
PROP_NOT_SUPPORTED
#endif
};
/** @brief ColorFormat for the frame returned by the decoder.
*/
enum class ColorFormat {
BGRA = 1,
BGR = 2,
GRAY = 3,
#ifndef CV_DOXYGEN
PROP_NOT_SUPPORTED
#endif
@@ -382,6 +394,8 @@ public:
*/
CV_WRAP virtual bool set(const VideoReaderProps propertyId, const double propertyVal) = 0;
CV_WRAP virtual void set(const ColorFormat _colorFormat) = 0;
/** @brief Returns the specified VideoReader property
@param propertyId Property identifier from cv::cudacodec::VideoReaderProps (eg. cv::cudacodec::VideoReaderProps::PROP_DECODED_FRAME_IDX,