OpenCV  5.0.0-pre
Open Source Computer Vision
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
cv::gapi::wip::onevpl::IDataProvider Struct Referenceabstract

Public interface allows to customize extraction of video stream data used by onevpl::GSource instead of reading stream from file (by default). More...

#include <opencv2/gapi/streaming/onevpl/data_provider_interface.hpp>

Collaboration diagram for cv::gapi::wip::onevpl::IDataProvider:

Public Types

using mfx_codec_id_type = uint32_t
 
using Ptr = std::shared_ptr< IDataProvider >
 

Public Member Functions

virtual ~IDataProvider ()=default
 
virtual bool empty () const =0
 
virtual bool fetch_bitstream_data (std::shared_ptr< mfx_bitstream > &in_out_bitsream)=0
 
virtual mfx_codec_id_type get_mfx_codec_id () const =0
 

Detailed Description

Public interface allows to customize extraction of video stream data used by onevpl::GSource instead of reading stream from file (by default).

Interface implementation constructor MUST provide consistency and creates fully operable object. If error happened implementation MUST throw DataProviderException kind exceptions

Note
Interface implementation MUST manage stream and other constructed resources by itself to avoid any kind of leak. For simple interface implementation example please see StreamDataProvider in tests/streaming/gapi_streaming_tests.cpp

Member Typedef Documentation

◆ mfx_codec_id_type

◆ Ptr

Constructor & Destructor Documentation

◆ ~IDataProvider()

virtual cv::gapi::wip::onevpl::IDataProvider::~IDataProvider ( )
virtualdefault

Member Function Documentation

◆ empty()

virtual bool cv::gapi::wip::onevpl::IDataProvider::empty ( ) const
pure virtual

The function is used by onevpl::GSource to check more binary data availability.

It MUST return TRUE in case of EOF and NO_THROW exceptions.

Returns
boolean value which detects end of stream

◆ fetch_bitstream_data()

virtual bool cv::gapi::wip::onevpl::IDataProvider::fetch_bitstream_data ( std::shared_ptr< mfx_bitstream > &  in_out_bitsream)
pure virtual

The function is used by onevpl::GSource to extract binary data stream from IDataProvider implementation.

It MUST throw DataProviderException kind exceptions in fail cases. It MUST return MFX_ERR_MORE_DATA in EOF which considered as not-fail case.

Parameters
in_out_bitsreamthe input-output reference on MFX bitstream buffer which MUST be empty at the first request to allow implementation to allocate it by itself and to return back. Subsequent invocation of fetch_bitstream_data MUST use the previously used in_out_bitsream to avoid skipping rest of frames which haven't been consumed
Returns
true for fetched data, false on EOF and throws exception on error

◆ get_mfx_codec_id()

virtual mfx_codec_id_type cv::gapi::wip::onevpl::IDataProvider::get_mfx_codec_id ( ) const
pure virtual

The function is used by onevpl::GSource to extract codec id from data


The documentation for this struct was generated from the following file: