Skip to content

SSM Example

Name

ssm_receiver - SSM reader example.

Description

KNEO Pi provides an application called ssm_receiver designed for SSM reader demostrations. This application demonstrates How to get video data(YUV420P) form VMF_VSRC.

Before using the ssm_receiver, ensure that venc1 has been executed.

The Synchronous Shared Memory (SSM) is an internal memory buffer shared between VMF modules. It also allows other process to read the video buffer if IPC shared is enabled. SSM reader will get the first filled buffer from SSM and return it to the ring buffer in SSM. Multiple readers accessing the same buffer are allowed. A buffer is freed only when all the readers accessing it have returned the buffer to SSM.

SSM API Reference as below:

Function Name Description
SSM_Reader_Init Create a reader or open an existed shared memory with the same name and return a SSM handler for reader. Set pshared if IPC is allowed. pshared is no effect if the shared buffer had been created and not freed.
SSM_Reader_ReturnReceiveBuff Return the specified reader buffer to SSM and wait until a written buffer for the reader is available. Block function.
SSM_Reader_ReturnBuff Return the specified reader buffer to SSM.
SSM_Reader_Wakeup Unblock the reader if it is waiting for a buffer by calling SSM_Reader_ReturnReceiveBuff. For reader only.
SSM_Release Release the referenced SSM. The resource will be destroyed until all readers or writer have released.

Synopsis

ssm_receiver [-p] [-o] [-n]

Options

-p   Specify the reader pin name defined by SSM_Reader_Init

-o   Output file name

-n   Get number of video frames

Example

Use the following command to start the SSM reader process:

$ ssm_receiver -p vsrc_ssm_0_640_480 -o ssm_reader.yuv