未验证 提交 6113f9ce 编写于 作者: Z zengyawen 提交者: Gitee

add nativeapis

Signed-off-by: Nzengyawen <zengyawen1@huawei.com>
上级 59f7ea5e
# native_avcodec_videodecoder.h
## Overview
Declares the native APIs used for video decoding.
**Since:**
9
**Related Modules:**
[VideoDecoder](_video_decoder.md)
## Summary
### Functions
| Name | Description |
| -------- | -------- |
| [OH_VideoDecoder_CreateByMime](_video_decoder.md#oh_videodecoder_createbymime) (const char \*mime) | Creates a video decoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This API is recommended in most cases. |
| [OH_VideoDecoder_CreateByName](_video_decoder.md#oh_videodecoder_createbyname) (const char \*name) | Creates a video decoder instance based on a video decoder name. To use this API, you must know the exact name of the video decoder. |
| [OH_VideoDecoder_Destroy](_video_decoder.md#oh_videodecoder_destroy) (OH_AVCodec \*codec) | Clears the internal resources of a video decoder and destroys the video decoder instance. |
| [OH_VideoDecoder_SetCallback](_video_decoder.md#oh_videodecoder_setcallback) (OH_AVCodec \*codec, [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md) callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by a video decoder. This API must be called prior to **Prepare**. |
| [OH_VideoDecoder_SetSurface](_video_decoder.md#oh_videodecoder_setsurface) (OH_AVCodec \*codec, [OHNativeWindow](_native_window.md) \*window) | Sets an output surface for a video decoder. This API must be called prior to **Prepare**. |
| [OH_VideoDecoder_Configure](_video_decoder.md#oh_videodecoder_configure) (OH_AVCodec \*codec, OH_AVFormat \*format) | Configures a video decoder. Typically, you need to configure the attributes, which can be extracted from the container, of the video track that can be decoded. This API must be called prior to **Prepare**. |
| [OH_VideoDecoder_Prepare](_video_decoder.md#oh_videodecoder_prepare) (OH_AVCodec \*codec) | Prepares internal resources for a video decoder. This API must be called after **Configure**. |
| [OH_VideoDecoder_Start](_video_decoder.md#oh_videodecoder_start) (OH_AVCodec \*codec) | Starts a video decoder. This API can be called only after the decoder is prepared successfully. After being started, the decoder starts to report the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) event. |
| [OH_VideoDecoder_Stop](_video_decoder.md#oh_videodecoder_stop) (OH_AVCodec \*codec) | Stops a video decoder. After the decoder is stopped, you can call **Start** to start it again. If you have passed codec-specific data in the previous **Start** for the decoder, you must pass it again. |
| [OH_VideoDecoder_Flush](_video_decoder.md#oh_videodecoder_flush) (OH_AVCodec \*codec) | Clears the input and output data in the internal buffer of a video decoder. This API invalidates the indexes of all buffers previously reported through the asynchronous callback. Therefore, before calling this API, ensure that the buffers corresponding to the indexes are no longer required. |
| [OH_VideoDecoder_Reset](_video_decoder.md#oh_videodecoder_reset) (OH_AVCodec \*codec) | Resets a video decoder. To continue decoding, you must call **Configure** and **Start** to configure and start the decoder again. |
| [OH_VideoDecoder_GetOutputDescription](_video_decoder.md#oh_videodecoder_getoutputdescription) (OH_AVCodec \*codec) | Obtains the attributes of the output data of a video decoder. The **OH_AVFormat** instance in the return value will become invalid when this API is called again or when the **OH_AVCodec** instance is destroyed. |
| [OH_VideoDecoder_SetParameter](_video_decoder.md#oh_videodecoder_setparameter) (OH_AVCodec \*codec, OH_AVFormat \*format) | Sets dynamic parameters for a video decoder. This API can be called only after the decoder is started. Incorrect parameter settings may cause decoding failure. |
| [OH_VideoDecoder_PushInputData](_video_decoder.md#oh_videodecoder_pushinputdata) (OH_AVCodec \*codec, uint32_t index, [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md) attr) | Pushes the input buffer filled with data to a video decoder. The [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback reports available input buffers and their indexes. After being pushed to the decoder, a buffer is not accessible until the buffer with the same index is reported again through the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback. In addition, some decoders require the input of codec-specific data, such as PPS/SPS data in H.264 format, to initialize the decoding process. |
| [OH_VideoDecoder_RenderOutputData](_video_decoder.md#oh_videodecoder_renderoutputdata) (OH_AVCodec \*codec, uint32_t index) | Frees an output buffer of a video decoder and instructs the decoder to render the decoded data in the buffer on the output surface. If no output surface is configured, calling this API only frees the output buffer. |
| [OH_VideoDecoder_FreeOutputData](_video_decoder.md#oh_videodecoder_freeoutputdata) (OH_AVCodec \*codec, uint32_t index) | Frees an output buffer of a video decoder. |
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册