RDK-V AvSync HAL 1.0.0
 
All Data Structures Files Functions Variables Typedefs Modules Pages
Loading...
Searching...
No Matches
Collaboration diagram for AvSync SOC Header:

Files

file  avsync-soc.h
 RDK HAL AVSync Public API.
 

Data Structures

struct  AVSyncVideoFrame_
 This structure is to encapsulate information related to a video frame's metadata. More...
 

Typedefs

typedef struct AVSyncVideoFrame_ AVSyncVideoFrame
 
typedef void(* AVSyncFrameFree) (AVSyncVideoFrame *frame)
 Frame delete callback prototype.
 

Functions

void * avsync_soc_init (int refreshRate, int syncType, int *sessionId, int *session)
 Initializes AV Sync session.
 
void avsync_soc_term (void *sync, int session)
 Terminates AV Sync session.
 
int avsync_soc_set_mode (void *sync, int type)
 Sets Mode for AV Sync session.
 
void avsync_soc_free_frame_callback (void *sync, AVSyncFrameFree *freeCB)
 Registers the callback to free the allocated video frames and metadata.
 
bool avsync_soc_push_frame (void *sync, AVSyncVideoFrame *f)
 Push a video frame to the AVSync module.
 
AVSyncVideoFrameavsync_soc_pop_frame (void *sync)
 Pop a video frame from the AVSync module.
 
void avsync_soc_set_rate (void *sync, float rate)
 Sets playback rate for AV Sync session.
 
void avsync_soc_pause (void *sync, bool pause)
 Pauses or resume AV Sync session.
 
void avsync_soc_set_interval (void *sync, uint32_t interval)
 Sets vsync interval for AV Sync session.
 
void avsync_soc_eos (void *sync)
 Signals EOS for AV Sync session.
 

Detailed Description

Application API Specification
AVSync module provides functionalities for audio/video synchronization during playback, ensuring proper alignment and timing between the streams. Provides API defines the structures and functions for the RDK HAL AVSync.

Typedef Documentation

◆ AVSyncFrameFree

typedef void(* AVSyncFrameFree) (AVSyncVideoFrame *frame)

Frame delete callback prototype.

◆ AVSyncVideoFrame

Function Documentation

◆ avsync_soc_eos()

void avsync_soc_eos ( void * sync)

Signals EOS for AV Sync session.

This function is used to signal the end of stream(EOS) to the AVSync module.

Parameters
[in]sync- A pointer to the AVSync structure that was created by the avsync_soc_init() function
Returns
void
Precondition
avsync_soc_init() must be called before calling this API

◆ avsync_soc_free_frame_callback()

void avsync_soc_free_frame_callback ( void * sync,
AVSyncFrameFree * freeCB )

Registers the callback to free the allocated video frames and metadata.

This function is used to set the frame free callback function for an AVSync object.

Parameters
[in]sync- A pointer to the AVSync structure that was created by the avsync_soc_init() function
[in]freeCB- A pointer to the AVSyncFrameFree structure
Returns
void
Precondition
avsync_soc_init() must be called before calling this API
See also
avsync_soc_init()

◆ avsync_soc_init()

void * avsync_soc_init ( int refreshRate,
int syncType,
int * sessionId,
int * session )

Initializes AV Sync session.

This function initializes AV Sync session and returns a pointer to an AVSync object used for audio-video synchronization.

Parameters
[in]refreshRate- The display refresh rate in hertz Valid range: 1Hz to 1000Hz
[in]syncType- The type of syncronization to use Valid range: 0 to maximum number of syncType
[out]sessionId- A pointer to an integer that will be set to the ID of the avsync session.
[out]session- A pointer to an integer that will be set to the file descriptor of the avsync session
Returns
void*
Return values
handlefor avsync module or null for failure

◆ avsync_soc_pause()

void avsync_soc_pause ( void * sync,
bool pause )

Pauses or resume AV Sync session.

This function is used to pause or resume playback of an AVSync object.

Parameters
[in]sync- A pointer to the AVSync structure that was created by the avsync_soc_init() function
[in]pause- a boolean value that indicates whether to pause (true) or resume (false) playback
Returns
void
Precondition
avsync_soc_init() must be called before calling this API
avsync_soc_set_rate() must be called before calling this API
See also
avsync_soc_set_rate()

◆ avsync_soc_pop_frame()

AVSyncVideoFrame * avsync_soc_pop_frame ( void * sync)

Pop a video frame from the AVSync module.

This function is used to pop/retrieve a video frame from the AVSync module's frame queue.

Parameters
[in]sync- A pointer to the AVSync structure that was created by the avsync_soc_init() function
Returns
- AVSyncVideoFrame*
Return values
Apointer to the AVSyncVideoFrame structure that contains the frame metadata. Valid value: any non-zero value
See also
AVSyncVideoFrame_, avsync_soc_set_interval(), avsync_soc_push_frame()
Precondition
avsync_soc_init() must be called before calling this API
avsync_soc_push_frame() must be called before calling this API

◆ avsync_soc_push_frame()

bool avsync_soc_push_frame ( void * sync,
AVSyncVideoFrame * f )

Push a video frame to the AVSync module.

This function is used to push a video frame to the AVSync module for synchronization.

Parameters
[in]sync- A pointer to the AVSync structure that was created by the avsync_soc_init() function
[in]f- A pointer to the AVSyncVideoFrame structure that contains the frame metadata. Valid value: any non-zero value
Returns
bool - The status of the operation
Return values
trueif successful, false otherwise
See also
AVSyncVideoFrame_
Precondition
avsync_soc_init() must be called before calling this API

◆ avsync_soc_set_interval()

void avsync_soc_set_interval ( void * sync,
uint32_t interval )

Sets vsync interval for AV Sync session.

This function is used to set the interval between vertical synchronization (vsync interval) events for the AVSync module.

Parameters
[in]sync- A pointer to the AVSync structure that was created by the avsync_soc_init() function
[in]interval- the desired interval between vsync events. Valid range: 1-1000 milliseconds
Returns
void
Precondition
avsync_soc_init() must be called before calling this API

◆ avsync_soc_set_mode()

int avsync_soc_set_mode ( void * sync,
int type )

Sets Mode for AV Sync session.

This function is used to set the synchronization mode for an AVSync object. Possible modes are Video Master, Audio Master and Program Clock Reference Master.

Parameters
[in]sync- A pointer to the AVSync structure that was created by the avsync_soc_init() function
[in]type- The new mode to set. Possible values are: 0, 1, 2
Returns
int - The status of the operation
Return values
0if successful, -1 otherwise
Precondition
avsync_soc_init() must be called before calling this API

◆ avsync_soc_set_rate()

void avsync_soc_set_rate ( void * sync,
float rate )

Sets playback rate for AV Sync session.

This function is used to set the playback rate/speed of an AVSync object

Parameters
[in]sync- A pointer to the AVSync structure that was created by the avsync_soc_init() function
[in]rate- is the playback rate. Valid range: 0.0 to 256.0
Returns
void
Precondition
avsync_soc_init() must be called before calling this API

◆ avsync_soc_term()

void avsync_soc_term ( void * sync,
int session )

Terminates AV Sync session.

This function is used to terminate and clean up resources associated with an AVSync object.

Parameters
[in]sync- A pointer to the AVSync structure that was created by the avsync_soc_init() function
[in]session- The file descriptor of the avsync session
Returns
void
Precondition
avsync_soc_init() must be called before calling this API