OpenCV  4.5.4
Open Source Computer Vision
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>

Public Types

using Ptr = std::shared_ptr< IDataProvider >
 

Public Member Functions

virtual ~IDataProvider ()
 
virtual bool empty () const =0
 
virtual size_t fetch_data (size_t out_data_bytes_size, void *out_data)=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

◆ Ptr

Constructor & Destructor Documentation

◆ ~IDataProvider()

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

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_data()

virtual size_t cv::gapi::wip::onevpl::IDataProvider::fetch_data ( size_t  out_data_bytes_size,
void *  out_data 
)
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 0 in EOF which considered as not-fail case.

Parameters
out_data_bytes_sizethe available capacity of out_data buffer.
out_datathe output consumer buffer with capacity out_data_bytes_size.
Returns
fetched bytes count.

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