oneVPL++
C++ API Prototype for oneVPL
oneapi::vpl::frame_surface Class Reference

Manages lifecycle of the surface with the frame data. This class works on top of the mfxFrameSurface1 object, which provides interface to access the data and has an internal reference counting mechanism. More...

#include <frame_surface.hpp>

Inheritance diagram for oneapi::vpl::frame_surface:
[legend]
Collaboration diagram for oneapi::vpl::frame_surface:
[legend]

Public Member Functions

 frame_surface ()
 Default dtor.
 
 frame_surface (mfxFrameSurface1 *surface, bool lazy_sync=false)
 Creates object on top of mfxFrameSurface1 object. Increments mfxFrameSurface1 reference counter value. More...
 
 frame_surface (const frame_surface &other)
 Copy ctor. Increments mfxFrameSurface1 reference counter value. More...
 
 frame_surface (frame_surface &&other)
 Move ctor. mfxFrameSurface1 reference counter value isn't incremented. More...
 
frame_surfaceoperator= (const frame_surface &other)
 Copy operator. Increments mfxFrameSurface1 reference counter value. More...
 
virtual ~frame_surface ()
 Dtor. Decrements mfxFrameSurface1 reference counter value.
 
void inject (mfxFrameSurface1 *surface, unsigned int n_times, bool lazy_sync=false)
 Inject mfxFrameSurface1 object to take care of it. This is temporal method until VPL RT will support all functions for the internal memory allocation. More...
 
void wait ()
 Indefinetely wait for operation completion.
 
template<class Rep , class Period >
async_op_status wait_for (const std::chrono::duration< Rep, Period > &timeout_duration) const
 Waits for the operation completion. Waits for the result to become available. Blocks until specified timeout_duration has elapsed or the result becomes available, whichever comes first. Returns value identifying the state of the result. More...
 
frame_info get_frame_info ()
 Provide frame information. More...
 
auto map (memory_access flags)
 Maps data to the system memory. More...
 
void unmap ()
 Unmaps data to the system memory.
 
auto get_native_handle ()
 Provides native surface handle of the surface. More...
 
auto get_device_handle ()
 Provides native device handle of the surface. More...
 
uint32_t get_ref_counter ()
 Provides current reference counter value. More...
 
mfxFrameSurface1get_raw_ptr ()
 Provides pointer to the raw data. More...
 
void associate_context (mfxSession session, mfxSyncPoint sp)
 Temporal method to assotiate externally allocated surface with sync point generated by the processing function. More...
 

Protected Attributes

mfxFrameSurface1surface_
 Pointer to the mfxFrameSurface1 object.
 
bool lazy_sync_
 Flag indicating that lazy sync technique must be used.
 

Friends

std::ostream & operator<< (std::ostream &out, const frame_surface &f)
 Friend operator to print out state of the class in human readable form. More...
 

Detailed Description

Manages lifecycle of the surface with the frame data. This class works on top of the mfxFrameSurface1 object, which provides interface to access the data and has an internal reference counting mechanism.

Constructor & Destructor Documentation

◆ frame_surface() [1/3]

oneapi::vpl::frame_surface::frame_surface ( mfxFrameSurface1 surface,
bool  lazy_sync = false 
)
inlineexplicit

Creates object on top of mfxFrameSurface1 object. Increments mfxFrameSurface1 reference counter value.

Parameters
[in]surfacePointer to the mfxFrameSurface1 object
[in]lazy_syncTemporal flag indicating that lazy sync technique must be used.

◆ frame_surface() [2/3]

oneapi::vpl::frame_surface::frame_surface ( const frame_surface other)
inline

Copy ctor. Increments mfxFrameSurface1 reference counter value.

Parameters
[in]otheranother object to use as data source

◆ frame_surface() [3/3]

oneapi::vpl::frame_surface::frame_surface ( frame_surface &&  other)
inline

Move ctor. mfxFrameSurface1 reference counter value isn't incremented.

Parameters
[in]otheranother object to use as data source

Member Function Documentation

◆ associate_context()

void oneapi::vpl::frame_surface::associate_context ( mfxSession  session,
mfxSyncPoint  sp 
)
inline

Temporal method to assotiate externally allocated surface with sync point generated by the processing function.

Parameters
[in]sessionSession handle.
[in]spsync point.

◆ get_device_handle()

auto oneapi::vpl::frame_surface::get_device_handle ( )
inline

Provides native device handle of the surface.

Returns
Pair of native device handle and its type

◆ get_frame_info()

frame_info oneapi::vpl::frame_surface::get_frame_info ( )
inline

Provide frame information.

Returns
Return instance of frame_info class

◆ get_native_handle()

auto oneapi::vpl::frame_surface::get_native_handle ( )
inline

Provides native surface handle of the surface.

Returns
Pair of native surface handle and its type

◆ get_raw_ptr()

mfxFrameSurface1* oneapi::vpl::frame_surface::get_raw_ptr ( )
inline

Provides pointer to the raw data.

Returns
Pointer to the raw data.

◆ get_ref_counter()

uint32_t oneapi::vpl::frame_surface::get_ref_counter ( )
inline

Provides current reference counter value.

Returns
reference counter value.

◆ inject()

void oneapi::vpl::frame_surface::inject ( mfxFrameSurface1 surface,
unsigned int  n_times,
bool  lazy_sync = false 
)
inline

Inject mfxFrameSurface1 object to take care of it. This is temporal method until VPL RT will support all functions for the internal memory allocation.

Parameters
[in]surfacemfxFrameSurface1 surface to use.
[in]n_timesReference counter increment.
[in]lazy_syncDo lazy sync or not.

◆ map()

auto oneapi::vpl::frame_surface::map ( memory_access  flags)
inline

Maps data to the system memory.

Parameters
flagsData access flag: read or write.
Returns
Pair of pointers to the surface info structure and surface data strucuture in the system memory
Here is the call graph for this function:

◆ operator=()

frame_surface& oneapi::vpl::frame_surface::operator= ( const frame_surface other)
inline

Copy operator. Increments mfxFrameSurface1 reference counter value.

Parameters
[in]otheranother object to use as data source
Returns
Reference to this object

◆ wait_for()

template<class Rep , class Period >
async_op_status oneapi::vpl::frame_surface::wait_for ( const std::chrono::duration< Rep, Period > &  timeout_duration) const
inline

Waits for the operation completion. Waits for the result to become available. Blocks until specified timeout_duration has elapsed or the result becomes available, whichever comes first. Returns value identifying the state of the result.

Parameters
timeout_durationMaximum duration to block for.
Returns
Wait ststus.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const frame_surface f 
)
friend

Friend operator to print out state of the class in human readable form.

Parameters
[in,out]outReference to the stream to write.
[in]fReferebce to the frame_surface instance to dump the state.
Returns
Reference to the stream.

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