Vision Apps User Guide

Introduction

This section contains APIs to use CODEC Pipelines within demos.

Data Structures

struct  app_codec_wrapper_params_t
 Init parameters. More...
 

Functions

int32_t appCodecInit (app_codec_wrapper_params_t *prm)
 Launches the CODECPipeline described by user defined parameters. Initializes the codec_wrapper and calls gst_parse_launch() on the command string. More...
 
int32_t appCodecSrcInit (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 CODECPipeline. Wraps the given allocated memory as CODECBuffers to push. The input parameters (in_*) must be properly initialised. More...
 
int32_t appCodecSinkInit (void *data_ptr[CODEC_MAX_BUFFER_DEPTH][CODEC_MAX_NUM_CHANNELS][CODEC_MAX_NUM_PLANES])
 Initializes the AppSink elements to be able to pull buffers from the CODECPipeline. Registers the data_pointers that will map to the bufferpool of pulled CODECBuffers. The output parameters (out_*) must be properly initialised. More...
 
int32_t appCodecStart ()
 Starts the CODECPipeline that was launched previously. More...
 
int32_t appCodecEnqAppSrc (uint8_t idx)
 Push a buffer from the bufferpool to the AppSrc element. More...
 
int32_t appCodecDeqAppSrc (uint8_t idx)
 Wait for a previously pushed buffer to be consumed by the CODECPipeline. More...
 
int32_t appCodecEnqEosAppSrc ()
 Push EOS (End Of Stream) to the AppSrc element. Signals the elements to stop processing buffers after this. More...
 
int32_t appCodecDeqAppSink (uint8_t idx)
 Pull a buffer from the AppSink element into the bufferpool. More...
 
int32_t appCodecEnqAppSink (uint8_t idx)
 Release a previously pulled CODECBuffer back to GStreamer and cleanup. More...
 
int32_t appCodecStop ()
 Stops the CODECPipeline that was in playing state. If there is no AppSink element, waits to recieve EOS before cleaning up. More...
 
void appCodecDeInit ()
 Unmaps all buffers that were mapped and destroys all GStreamer or OpenMAX objects. More...
 
void appCodecPrintStats ()
 Prints the current count of the numbers of buffers pushed/pulled to/from the CODECPipeline. Not multi-thread safe. More...
 

Macros

#define CODEC_MAX_LEN_CMD_STR   4096u
 
#define CODEC_MAX_LEN_ELEM_NAME   32u
 
#define CODEC_MAX_NUM_PLANES   4u
 
#define CODEC_MAX_BUFFER_DEPTH   16u
 
#define CODEC_MAX_NUM_CHANNELS   8u
 

Macro Definition Documentation

◆ CODEC_MAX_LEN_CMD_STR

#define CODEC_MAX_LEN_CMD_STR   4096u

◆ CODEC_MAX_LEN_ELEM_NAME

#define CODEC_MAX_LEN_ELEM_NAME   32u

◆ CODEC_MAX_NUM_PLANES

#define CODEC_MAX_NUM_PLANES   4u

◆ CODEC_MAX_BUFFER_DEPTH

#define CODEC_MAX_BUFFER_DEPTH   16u

◆ CODEC_MAX_NUM_CHANNELS

#define CODEC_MAX_NUM_CHANNELS   8u

Function Documentation

◆ appCodecInit()

int32_t appCodecInit ( app_codec_wrapper_params_t prm)

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

Parameters
[in]prmInit parameters

◆ appCodecSrcInit()

int32_t appCodecSrcInit ( 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 CODECPipeline. Wraps the given allocated memory as CODECBuffers to push. The input parameters (in_*) must be properly initialised.

Parameters
[in]data_ptrmemory that the CODECBuffers will map to

◆ appCodecSinkInit()

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

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

Parameters
[in]data_ptrmemory that the CODECBuffers will map to

◆ appCodecStart()

int32_t appCodecStart ( )

Starts the CODECPipeline that was launched previously.

◆ appCodecEnqAppSrc()

int32_t appCodecEnqAppSrc ( 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 CODECPipeline

◆ appCodecDeqAppSrc()

int32_t appCodecDeqAppSrc ( uint8_t  idx)

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

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

◆ appCodecEnqEosAppSrc()

int32_t appCodecEnqEosAppSrc ( )

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

◆ appCodecDeqAppSink()

int32_t appCodecDeqAppSink ( 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 CODECBuffer

◆ appCodecEnqAppSink()

int32_t appCodecEnqAppSink ( uint8_t  idx)

Release a previously pulled CODECBuffer back to GStreamer and cleanup.

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

◆ appCodecStop()

int32_t appCodecStop ( )

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

◆ appCodecDeInit()

void appCodecDeInit ( )

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

◆ appCodecPrintStats()

void appCodecPrintStats ( )

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