Trait CUDA_VideoReaderTraitConst

Source
pub trait CUDA_VideoReaderTraitConst {
    // Required method
    fn as_raw_CUDA_VideoReader(&self) -> *const c_void;

    // Provided methods
    fn format(&self) -> Result<CUDA_FormatInfo> { ... }
    fn retrieve(
        &self,
        frame: &mut impl ToOutputArray,
        idx: size_t,
    ) -> Result<bool> { ... }
    fn retrieve_def(&self, frame: &mut impl ToOutputArray) -> Result<bool> { ... }
    fn retrieve_1(&self, frame: &mut impl MatTrait, idx: size_t) -> Result<bool> { ... }
    fn retrieve_2(&self, frame: &mut impl GpuMatTrait) -> Result<bool> { ... }
    fn get(
        &self,
        property_id: CUDA_VideoReaderProps,
        property_val: &mut f64,
    ) -> Result<bool> { ... }
    fn get_video_reader_props(
        &self,
        property_id: CUDA_VideoReaderProps,
        property_val_out: &mut f64,
        property_val_in: f64,
    ) -> Result<bool> { ... }
    fn get_video_reader_props_def(
        &self,
        property_id: CUDA_VideoReaderProps,
        property_val_out: &mut f64,
    ) -> Result<bool> { ... }
    fn get_1(&self, property_id: i32, property_val: &mut f64) -> Result<bool> { ... }
}
Expand description

Required Methods§

Provided Methods§

Source

fn format(&self) -> Result<CUDA_FormatInfo>

Returns information about video file format.

Source

fn retrieve(&self, frame: &mut impl ToOutputArray, idx: size_t) -> Result<bool>

Returns previously grabbed video data.

§Parameters
  • frame:[out] The returned data which depends on the provided idx.
  • idx: Determines the returned data inside image. The returned data can be the:
  • Decoded frame, idx = get(PROP_DECODED_FRAME_IDX).
  • Extra data if available, idx = get(PROP_EXTRA_DATA_INDEX).
  • Raw encoded data package. To retrieve package i, idx = get(PROP_RAW_PACKAGES_BASE_INDEX) + i with i < get(PROP_NUMBER_OF_RAW_PACKAGES_SINCE_LAST_GRAB)
§Returns

false if no frames have been grabbed

The method returns data associated with the current video source since the last call to grab() or the creation of the VideoReader. If no data is present the method returns false and the function returns an empty image.

§C++ default parameters
  • idx: static_cast<size_t>(VideoReaderProps::PROP_DECODED_FRAME_IDX)
Source

fn retrieve_def(&self, frame: &mut impl ToOutputArray) -> Result<bool>

Returns previously grabbed video data.

§Parameters
  • frame:[out] The returned data which depends on the provided idx.
  • idx: Determines the returned data inside image. The returned data can be the:
  • Decoded frame, idx = get(PROP_DECODED_FRAME_IDX).
  • Extra data if available, idx = get(PROP_EXTRA_DATA_INDEX).
  • Raw encoded data package. To retrieve package i, idx = get(PROP_RAW_PACKAGES_BASE_INDEX) + i with i < get(PROP_NUMBER_OF_RAW_PACKAGES_SINCE_LAST_GRAB)
§Returns

false if no frames have been grabbed

The method returns data associated with the current video source since the last call to grab() or the creation of the VideoReader. If no data is present the method returns false and the function returns an empty image.

§Note

This alternative version of CUDA_VideoReaderTraitConst::retrieve function uses the following default values for its arguments:

  • idx: static_cast<size_t>(VideoReaderProps::PROP_DECODED_FRAME_IDX)
Source

fn retrieve_1(&self, frame: &mut impl MatTrait, idx: size_t) -> Result<bool>

Returns previously grabbed encoded video data.

§Parameters
  • frame:[out] The encoded video data.
  • idx: Determines the returned data inside image. The returned data can be the:
  • Extra data if available, idx = get(PROP_EXTRA_DATA_INDEX).
  • Raw encoded data package. To retrieve package i, idx = get(PROP_RAW_PACKAGES_BASE_INDEX) + i with i < get(PROP_NUMBER_OF_RAW_PACKAGES_SINCE_LAST_GRAB)
§Returns

false if no frames have been grabbed

The method returns data associated with the current video source since the last call to grab() or the creation of the VideoReader. If no data is present the method returns false and the function returns an empty image.

Source

fn retrieve_2(&self, frame: &mut impl GpuMatTrait) -> Result<bool>

Returns the next video frame.

§Parameters
  • frame:[out] The video frame. If grab() has not been called then this will be empty().
§Returns

false if no frames have been grabbed

The method returns data associated with the current video source since the last call to grab(). If no data is present the method returns false and the function returns an empty image.

Source

fn get( &self, property_id: CUDA_VideoReaderProps, property_val: &mut f64, ) -> Result<bool>

Returns the specified VideoReader property

§Parameters
  • propertyId: Property identifier from cv::cudacodec::VideoReaderProps (eg. cv::cudacodec::VideoReaderProps::PROP_DECODED_FRAME_IDX, cv::cudacodec::VideoReaderProps::PROP_EXTRA_DATA_INDEX, …).
  • propertyVal:
  • In: Optional value required for querying specific propertyId’s, e.g. the index of the raw package to be checked for a key frame (cv::cudacodec::VideoReaderProps::PROP_LRF_HAS_KEY_FRAME).
  • Out: Value of the property.
§Returns

true unless the property is not supported.

Source

fn get_video_reader_props( &self, property_id: CUDA_VideoReaderProps, property_val_out: &mut f64, property_val_in: f64, ) -> Result<bool>

§C++ default parameters
  • property_val_in: 0
Source

fn get_video_reader_props_def( &self, property_id: CUDA_VideoReaderProps, property_val_out: &mut f64, ) -> Result<bool>

§Note

This alternative version of CUDA_VideoReaderTraitConst::get_video_reader_props function uses the following default values for its arguments:

  • property_val_in: 0
Source

fn get_1(&self, property_id: i32, property_val: &mut f64) -> Result<bool>

Retrieves the specified property used by the VideoSource.

§Parameters
  • propertyId: Property identifier from cv::VideoCaptureProperties (eg. cv::CAP_PROP_POS_MSEC, cv::CAP_PROP_POS_FRAMES, …) or one from [videoio_flags_others].
  • propertyVal: Value for the specified property.
§Returns

true unless the property is unset set or not supported.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§