Rate This Document
Findability
Accuracy
Completeness
Readability

SetCallbacks

Function Usage

Sets the callback for notifying decoder events.

Restrictions

N/A

Prototype

DecoderRetCode SetCallbacks(std::function<void(DecodeEventIndex, uint32_t, void *)> eventCallBack)

Parameter Description

Field Name

Input/Output

Field Type

Description

eventCallBack

Input

std::function<void(DecodeEventIndex, uint32_t, void *)>

Callback for notifying decoder events.

When an event in the decoder needs to be notified to the upper layer, the callback set in this API is invoked. Index indicates the event type, and uint32_t and void * are used to store corresponding data. Definition:

// Decoding events
enum DecodeEventIndex : uint32_t {
    INDEX_PIC_INFO_CHANGE,
    INDEX_EVENT_NONE
};

INDEX_PIC_INFO_CHANGE indicates that the size of decoded images changes. In this case, mount struct PicInfoParams * to the void * parameter. For details, see SetDecodeParams.

Return Value Description

Data type: DecoderRetCode

The value can be any of the following:

  • VIDEO_DECODER_SUCCESS: The callback is successfully set.
  • VIDEO_DECODER_SET_FUNC_FAIL: Failed to set the callback.