!1072 增加解码指定送显时间接口

Merge pull request !1072 from 李建超/master
This commit is contained in:
openharmony_ci 2024-07-27 08:38:22 +00:00 committed by Gitee
commit 11ff9a2d4f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 36 additions and 0 deletions

View File

@ -366,6 +366,38 @@ OH_AVErrCode OH_VideoDecoder_PushInputBuffer(OH_AVCodec *codec, uint32_t index);
*/
OH_AVErrCode OH_VideoDecoder_RenderOutputBuffer(OH_AVCodec *codec, uint32_t index);
/**
* @brief Return the processed output buffer with render timestamp to the decoder, and notify the decoder to finish
* rendering the decoded data contained in the buffer on the output surface. If the output surface is not configured
* before, calling this interface only returns the output buffer corresponding to the specified index to the decoder.
* The timestamp may have special meaning depending on the destination surface.
* Invoker can use the timestamp to render the buffer at a specific time (at the VSYNC at or after the buffer
* timestamp). For this to work, the timestamp needs to be reasonably close to the current SystemNanoTime. A few notes:
* 1. The buffer will not be returned to the codec until the timestamp has passed and the buffer is no longer used by
* the surface.
* 2. Buffers are processed sequentially, so you may block subsequent buffers to be displayed on the surface.
* This is important if you want to react to user action, e.g. stop the video or seek.
* 3. If multiple buffers are sent to the surface to be rendered at the same VSYNC, the last one will be shown, and the
* other ones will be dropped.
* 4. If the timestamp is not "reasonably close" to the current system time, the Surface will
* ignore the timestamp, and display the buffer at the earliest feasible time. In this mode it will not drop frames.
* @syscap SystemCapability.Multimedia.Media.VideoDecoder
* @param codec Pointer to an OH_AVCodec instance
* @param index The index value corresponding to the output buffer, should be given by {@link
* OH_AVCodecOnNewOutputBuffer}
* @param renderTimestampNs The timestamp is associated with the output buffer when it is sent to the surface. The unit
* is nanosecond
* @return Returns AV_ERR_OK if the execution is successful,
* otherwise returns a specific error code, refer to {@link OH_AVErrCode}.
* {@link AV_ERR_NO_MEMORY}, the codec has already released.
* {@link AV_ERR_INVALID_VAL}, the parameter is invalid.
* {@link AV_ERR_UNKNOWN}, unknown error.
* {@link AV_ERR_SERVICE_DIED}, avcodec service is died.
* {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state.
* @since 12
*/
OH_AVErrCode OH_VideoDecoder_RenderOutputBufferAtTime(OH_AVCodec *codec, uint32_t index, int64_t renderTimestampNs);
/**
* @brief Return the processed output Buffer to the decoder.
* @syscap SystemCapability.Multimedia.Media.VideoDecoder

View File

@ -86,6 +86,10 @@
{
"first_introduced": "11",
"name": "OH_VideoDecoder_SetDecryptionConfig"
},
{
"first_introduced": "12",
"name": "OH_VideoDecoder_RenderOutputBufferAtTime"
}
]