Vision Apps User Guide
GStreamer Wrapper APIs

Introduction

This section contains APIs to use GStreamer CODEC Pipelines within demos.

Functions

int32_t appGstInit (app_codec_wrapper_params_t *prm)
 Launches the GstPipeline described by user defined parameters. Initializes the gst_wrapper and calls gst_parse_launch() on the command string. More...
 
int32_t appGstSrcInit (void *data_ptr[CODEC_MAX_BUFFER_DEPTH][CODEC_MAX_NUM_CHANNELS][CODEC_MAX_NUM_PLANES])
 Initializes the AppSrc elements to be able to push buffers to the GstPipeline. Wraps the given allocated memory as GstBuffers to push. The input parameters (in_*) must be properly initialised. More...
 
int32_t appGstSinkInit (void *(*data_ptr)[CODEC_MAX_NUM_CHANNELS][CODEC_MAX_NUM_PLANES])
 Initializes the AppSink elements to be able to pull buffers from the GstPipeline. Registers the data_pointers that will map to the bufferpool of pulled GstBuffers. The output parameters (out_*) must be properly initialised. More...
 
int32_t appGstStart ()
 Starts the GstPipeline that was launched previously. More...
 
int32_t appGstEnqAppSrc (uint8_t idx)
 Push a buffer from the bufferpool to the AppSrc element. More...
 
int32_t appGstDeqAppSrc (uint8_t idx)
 Wait for a previously pushed buffer to be consumed by the GstPipeline. More...
 
int32_t appGstEnqEosAppSrc ()
 Push EOS (End Of Stream) to the AppSrc element. Signals the elements to stop processing buffers after this. More...
 
int32_t appGstDeqAppSink (uint8_t idx)
 Pull a buffer from the AppSink element into the bufferpool. More...
 
int32_t appGstEnqAppSink (uint8_t idx)
 Release a previously pulled GstBuffer back to GStreamer and cleanup. More...
 
int32_t appGstStop ()
 Stops the GstPipeline that was in playing state. If there is no AppSink element, waits to recieve EOS before cleaning up. More...
 
void appGstDeInit ()
 Unmaps all buffers that were mapped and destroys all GStreamer objects. More...
 
void appGstPrintStats ()
 Prints the current count of the numbers of buffers pushed/pulled to/from the GstPipeline. Not multi-thread safe. More...
 

Function Documentation

◆ appGstInit()

int32_t appGstInit ( app_codec_wrapper_params_t prm)

Launches the GstPipeline described by user defined parameters. Initializes the gst_wrapper and calls gst_parse_launch() on the command string.

Parameters
[in]prmInit parameters

◆ appGstSrcInit()

int32_t appGstSrcInit ( void *  data_ptr[CODEC_MAX_BUFFER_DEPTH][CODEC_MAX_NUM_CHANNELS][CODEC_MAX_NUM_PLANES])

Initializes the AppSrc elements to be able to push buffers to the GstPipeline. Wraps the given allocated memory as GstBuffers to push. The input parameters (in_*) must be properly initialised.

Parameters
[in]data_ptrmemory that the GstBuffers will map to

◆ appGstSinkInit()

int32_t appGstSinkInit ( void *(*)  data_ptr[CODEC_MAX_NUM_CHANNELS][CODEC_MAX_NUM_PLANES])

Initializes the AppSink elements to be able to pull buffers from the GstPipeline. Registers the data_pointers that will map to the bufferpool of pulled GstBuffers. The output parameters (out_*) must be properly initialised.

Parameters
[in]data_ptrpointers to hold the pulled buffers

◆ appGstStart()

int32_t appGstStart ( )

Starts the GstPipeline that was launched previously.

◆ appGstEnqAppSrc()

int32_t appGstEnqAppSrc ( uint8_t  idx)

Push a buffer from the bufferpool to the AppSrc element.

Parameters
[in]idxthe buffer id, from the bufferpool, to be pushed to the GstPipeline

◆ appGstDeqAppSrc()

int32_t appGstDeqAppSrc ( uint8_t  idx)

Wait for a previously pushed buffer to be consumed by the GstPipeline.

Parameters
[in]idxthe buffer id, from the bufferpool, to wait on

◆ appGstEnqEosAppSrc()

int32_t appGstEnqEosAppSrc ( )

Push EOS (End Of Stream) to the AppSrc element. Signals the elements to stop processing buffers after this.

◆ appGstDeqAppSink()

int32_t appGstDeqAppSink ( uint8_t  idx)

Pull a buffer from the AppSink element into the bufferpool.

Parameters
[in]idxthe slot into which the pulled data is stored
in the pulled_data_ptr array, while maintaining a reference to the pulled GstBuffer

◆ appGstEnqAppSink()

int32_t appGstEnqAppSink ( uint8_t  idx)

Release a previously pulled GstBuffer back to GStreamer and cleanup.

Parameters
[in]idxthe slot from which the buffer is released back to Gstreamer. The data pointer for this slot is no longer valid

◆ appGstStop()

int32_t appGstStop ( )

Stops the GstPipeline that was in playing state. If there is no AppSink element, waits to recieve EOS before cleaning up.

◆ appGstDeInit()

void appGstDeInit ( )

Unmaps all buffers that were mapped and destroys all GStreamer objects.

◆ appGstPrintStats()

void appGstPrintStats ( )

Prints the current count of the numbers of buffers pushed/pulled to/from the GstPipeline. Not multi-thread safe.