Skip to content

SRB Example

Name

srb_receiver - SRB reader example.

Description

KNEO Pi provides an application called srb_receiver designed for SRB reader demostrations. This application demonstrates How to get encode data(h264, h265 & jpeg) form VMF_VENC.

Before using the srb_receiver, ensure that venc1 has been excuted.

Similar to SSM, Sync Ring Buffer (SRB) is implemented as a ring buffer mechanism with the incorporation of inter-process shared memory, notification and concurrent data processing features. SRB supports "multiple readers” mechanism which is specially designed for encoded frame data to be shared with applications executed in the same or other process.

SRB API Reference as below:

Function Name Description
SRB_InitReader Open a named SRB and get a SRB handler which is used to call all reader specific APIs.
SRB_ReturnReceiveReaderBuff Return the specified buffer to SRB and get a filled buffer in SRB. The function is blocked until a buffer is available in the SRB. Calling SRB_WakeupReader will unblock this function. For reader only.
SRB_ReturnReaderBuff Return the specified buffer to SRB. For reader only.
SRB_WakeupReader Unblock the reader if it is waiting for a buffer by calling SRB_ReturnReaderBuff. This function must be called before terminating the threads calling SRB_ReturnReaderBuff. For reader only.
SRB_Release Release the referenced SRB. The resource will be destroyed until all readers or writer have released.

Synopsis

srb_receiver [-w] [-p]

Options

-w Save encode data, 0: Disable, 1: Enable.

-p Output file path.

Example

Use the following command to start the SSM reader process:

srb_receiver -w 1 -p /tmp