API Overview
Using the DIL is fairly easy, especially if compared to the more basic DPI, since it operates at a relatively high abstraction level. Apart from obvious creation and destruction of a DIL instance (respectively DIL_Create()
and DIL_Destroy()
), the main API calls are effectively two:
Feed input -
DIL_AddNALData()
Decode -
DIL_DecodeandRender()
(for decoding on screen, alternativelyDIL_Decode()
for decoding off screen followed byDIL_Render()
)Feed input -
DIL_AddNALData()
Decode -
DIL_DecodeandRender()
(for decoding on screen, alternativelyDIL_Decode()
for decoding off screen followed byDIL_Render()
)
The DIL also offers an API for the client to retrieve the size of the output picture, which can be useful to pre-allocate buffers or textures of the right size before decoding:
Get size information -
DIL_GetDecodeInformation()
Note: input buffers must have NAL byte stream format with either Annex B or Length Prefix format.
Drop/Skip frames
LCEVC content may be encoded with a temporal feature that requires each and every frame to be actioned on in order to keep the DPI internal temporal reference data correct. As a result when the client skips frames, for ex. because of a seek in the timeline, or drops frames because they are “late”, it shall let the DIL know by calling the following function:
DIL_DecodeSkip()
The DIL does know whether the temporal feature is on and therefore can fall back to a no operation case if that is the case. It is not advised that the client tries to implement this behaviour on its side.
Synchronous and Asynchronous modes
The DIL can be used in both synchronous or asynchronous mode. This is applicable to the decode and render functions:
DIL_Decode()
DIL_DecodeAndRender()
DIL_DecodeSkip()
DIL_Render()
If the client has previously set the callback function by means of the DIL_SetDecodedAsyncCallback()
or DIL_SetRenderAsyncCallback()
API calls, the above decode functions will work asynchronously, therefore returning immediately and triggering the client’s callback function when the decode (or render) has completed. If the callback has not been set the functions will work synchronously.
Base pass-through mode
The DIL also supports a pass-through mode, in which the base is simply copied on to the output without applying the LCEVC enhancement. This mode is triggered when no LCEVC data is found for the frame and can be set as forced behaviour, for every frame, from the JSON configuration.
Last updated
Was this helpful?