Call Back function for NAL Units
B-2
Figure 5-2 Overview of copying
User application defined call back function can be registered with the encoder. A run time arameter,
pfNalUnitCallBack is provided as part of dynamic parameter, which can be either set to NULL or to
address of the call back function. Setting this parameter to NULL indicates that the application does
not require the output at NAL unit level. When this parameter is set to a value other than NULL, the
application has to have a valid memory location where the call back function exists. This is because
the encoder calls the function at same address once each NAL unit is encoded.
B.1 Call back Function Interface
Call back function to be implemented by the application.
Description
Encoder calls this function with NAL unit that informs about buffer that
indicates pointer and size that the encoder writes.
Prototype
void (*pfNalUnitCallBack)(
unsigned int *pNalu,
unsigned int *pPacketSizeInBytes
)
Arguments
pNalu: Pointer to the buffer that has to be sent
pPacketSizeInBytes: Pointer to the information about the size (in bytes) that has to be
The following sequence must be followed for call back function:
1) Define application specific function to be used as call back.
/* This function copies the encoded NAL unit bit-stream to
packet buffer */