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

Manages encoder's sessions. More...

#include <session.hpp>

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

Public Member Functions

 encode_session (const implemetation_selector &sel)
 Constructs encoder session. More...
 
 encode_session (const implemetation_selector &sel, frame_source_reader *rdr)
 Constructs encoder session. More...
 
 ~encode_session ()
 Dtor.
 
auto alloc_input ()
 Allocate and return shared pointer to the surface. More...
 
void sync (mfxSyncPoint sp, int to)
 Temporal method to sync the surface's data. More...
 
status encode_frame (std::shared_ptr< frame_surface > in_surface, std::shared_ptr< bitstream_as_dst > bs, encoder_process_list list={})
 Encodes frame. More...
 
status encode_frame (std::shared_ptr< bitstream_as_dst > bs, encoder_process_list list={})
 Encodes frame by using provided source reader to get data to encode. More...
 
std::shared_ptr< future_bitstream_tprocess (std::shared_ptr< future_surface_t > in_future, encoder_process_list list={})
 Encode frame. Function returns the future object with the bitstream which will hold processed data. User needs to sync up the future object before accessing. This function expected to work in the chain and uses provided future object to get the data to process. More...
 
std::shared_ptr< encode_statgetStat ()
 Retrieve encoder statistic. More...
 
- Public Member Functions inherited from oneapi::vpl::session< encoder_video_param, encoder_init_list, encoder_reset_list >
virtual ~session ()
 Dtor. Additionaly it closes loader.
 
std::shared_ptr< encoder_video_paramCaps ()
 Returns implementation capabilities. More...
 
std::shared_ptr< encoder_video_paramVerify (encoder_video_param *param)
 Verifyes that implementation supports such capabilities. On output, corrected capabilities are returned. More...
 
status Init (encoder_video_param *par, encoder_init_list list={})
 Initializes the session by using provided parameters. More...
 
status Reset (encoder_video_param *par, encoder_reset_list list)
 Resets the session by using provided parameters. More...
 
std::shared_ptr< encoder_video_paramworking_params ()
 Retrieves current session parameters. More...
 
component get_component_domain () const
 Returns session's domain. More...
 
mfxIMPL get_implementation ()
 Returns implementation. More...
 
mfxVersion get_version ()
 Returns version. More...
 

Protected Attributes

frame_source_readerrdr_
 Raw freames reader.
 
- Protected Attributes inherited from oneapi::vpl::session< encoder_video_param, encoder_init_list, encoder_reset_list >
mfxSession session_
 Session handle.
 
detail::sdk_c_api c_api_callable_
 Functions table.
 
state state_
 Processing state of the session.
 
component component_
 Session's type identifier. Domain in other words.
 
mfxIMPL selected_impl_
 Selected actual implementation.
 
mfxVersion version_
 Version of implementation.
 
void * accelerator_handle
 Accelerator handle.
 

Additional Inherited Members

- Protected Types inherited from oneapi::vpl::session< encoder_video_param, encoder_init_list, encoder_reset_list >
enum  state
 Session's data processing state.
 
- Protected Member Functions inherited from oneapi::vpl::session< encoder_video_param, encoder_init_list, encoder_reset_list >
 session (const implemetation_selector &sel, detail::sdk_c_api callable)
 Protected ctor. Creates session by using supplyed implementation selector. More...
 
void init_accelerator_handle ()
 
void free_accelerator_handle ()
 

Detailed Description

Manages encoder's sessions.

Constructor & Destructor Documentation

◆ encode_session() [1/2]

oneapi::vpl::encode_session::encode_session ( const implemetation_selector sel)
inlineexplicit

Constructs encoder session.

Parameters
[in]selImplementation selector

◆ encode_session() [2/2]

oneapi::vpl::encode_session::encode_session ( const implemetation_selector sel,
frame_source_reader rdr 
)
inline

Constructs encoder session.

Parameters
[in]selImplementation selector
[in]rdrPointer to the raw frame reader

Member Function Documentation

◆ alloc_input()

auto oneapi::vpl::encode_session::alloc_input ( )
inline

Allocate and return shared pointer to the surface.

Returns
Shared pointer to the allocated surface

◆ encode_frame() [1/2]

status oneapi::vpl::encode_session::encode_frame ( std::shared_ptr< frame_surface in_surface,
std::shared_ptr< bitstream_as_dst bs,
encoder_process_list  list = {} 
)
inline

Encodes frame.

Parameters
[in]in_surfaceObject with the data to encode.
[out]bsFuture object with bitstream portion.
[in]listList of extension buffers to use
Returns
Ok or warning

◆ encode_frame() [2/2]

status oneapi::vpl::encode_session::encode_frame ( std::shared_ptr< bitstream_as_dst bs,
encoder_process_list  list = {} 
)
inline

Encodes frame by using provided source reader to get data to encode.

Parameters
[out]bsFuture object with bitstream portion.
[in]listList of extension buffers to use
Returns
Ok or warning

◆ getStat()

std::shared_ptr<encode_stat> oneapi::vpl::encode_session::getStat ( )
inline

Retrieve encoder statistic.

Returns
Encoder statistic

◆ process()

std::shared_ptr<future_bitstream_t> oneapi::vpl::encode_session::process ( std::shared_ptr< future_surface_t in_future,
encoder_process_list  list = {} 
)
inline

Encode frame. Function returns the future object with the bitstream which will hold processed data. User needs to sync up the future object before accessing. This function expected to work in the chain and uses provided future object to get the data to process.

Parameters
[in]in_futureFuture object with the surface from the previous operation.
[in]listList of extension buffers to use
Returns
Future object with the bitstream.

◆ sync()

void oneapi::vpl::encode_session::sync ( mfxSyncPoint  sp,
int  to 
)
inline

Temporal method to sync the surface's data.

Parameters
[in]spSynchronization point handle.
[in]toTime to wait.

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