harmony 鸿蒙native_avcodec_videodecoder.h

  • 2025-06-12
  • 浏览 (5)

native_avcodec_videodecoder.h

Overview

The native_avcodec_videodecoder.h file declares the native APIs used for video decoding.

Library: libnative_media_vdec.so

Since: 9

Related module: VideoDecoder

Summary

Functions

Name Description
OH_AVCodec * OH_VideoDecoder_CreateByMime (const char *mime) Creates a video decoder instance based on a Multipurpose Internet Mail Extension (MIME) type.
OH_AVCodec * OH_VideoDecoder_CreateByName (const char *name) Creates a video decoder instance based on a decoder name.
OH_AVErrCode OH_VideoDecoder_Destroy (OH_AVCodec *codec) Clears the internal resources of a video decoder and destroys the decoder instance.
OH_AVErrCode OH_VideoDecoder_SetCallback (OH_AVCodec *codec, OH_AVCodecAsyncCallback callback, void *userData) Sets an asynchronous callback so that your application can respond to events generated by a video decoder.
OH_AVErrCode OH_VideoDecoder_RegisterCallback (OH_AVCodec *codec, OH_AVCodecCallback callback, void *userData) Registers an asynchronous callback so that your application can respond to events generated by a video decoder.
OH_AVErrCode OH_VideoDecoder_SetSurface (OH_AVCodec *codec, OHNativeWindow *window) Sets an output surface for a video decoder.
OH_AVErrCode OH_VideoDecoder_Configure (OH_AVCodec *codec, OH_AVFormat *format) Configures a video decoder. Typically, you need to configure the video track description information that can be extracted from OH_AVSource.
OH_AVErrCode OH_VideoDecoder_Prepare (OH_AVCodec *codec) Prepares internal resources for a video decoder.
OH_AVErrCode OH_VideoDecoder_Start (OH_AVCodec *codec) Starts a video decoder. This function can be called only after the decoder is prepared successfully.
OH_AVErrCode OH_VideoDecoder_Stop (OH_AVCodec *codec) Stops a video decoder.
OH_AVErrCode OH_VideoDecoder_Flush (OH_AVCodec *codec) Clears the input and output data in the internal buffer of a video decoder.
OH_AVErrCode OH_VideoDecoder_Reset (OH_AVCodec *codec) Resets a video decoder. To continue decoding, you must call Configure to configure the decoder again.
OH_AVFormat * OH_VideoDecoder_GetOutputDescription (OH_AVCodec *codec) Obtains the description information about the output data of a video decoder.
OH_AVErrCode OH_VideoDecoder_SetParameter (OH_AVCodec *codec, OH_AVFormat *format) Sets dynamic parameters for a video decoder.
OH_AVErrCode OH_VideoDecoder_PushInputData (OH_AVCodec *codec, uint32_t index, OH_AVCodecBufferAttr attr) Pushes the input buffer filled with data to a video decoder.
OH_AVErrCode 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.
OH_AVErrCode OH_VideoDecoder_FreeOutputData (OH_AVCodec *codec, uint32_t index) Frees an output buffer of a video decoder.
OH_AVErrCode OH_VideoDecoder_PushInputBuffer (OH_AVCodec *codec, uint32_t index) Pushes the input buffer filled with data to a video decoder.
OH_AVErrCode OH_VideoDecoder_RenderOutputBuffer (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.
OH_AVErrCode OH_VideoDecoder_RenderOutputBufferAtTime (OH_AVCodec *codec, uint32_t index, int64_t renderTimestampNs) Frees an output buffer with a rendering timestamp of a video decoder and instructs the decoder to render the decoded data in the buffer on the output surface.
OH_AVErrCode OH_VideoDecoder_FreeOutputBuffer (OH_AVCodec *codec, uint32_t index) Frees an output buffer of a video decoder.
OH_AVErrCode OH_VideoDecoder_IsValid (OH_AVCodec *codec, bool *isValid) Checks whether a video decoder instance is valid.
OH_AVErrCode OH_VideoDecoder_SetDecryptionConfig (OH_AVCodec *codec, MediaKeySession *mediaKeySession, bool secureVideoPath) Sets the decryption configuration.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙AVCodec Kit

harmony 鸿蒙AVCapability

harmony 鸿蒙AVDemuxer

harmony 鸿蒙AVMuxer

harmony 鸿蒙AVSource

harmony 鸿蒙AudioCodec

harmony 鸿蒙AudioDecoder

harmony 鸿蒙AudioEncoder

harmony 鸿蒙CodecBase

harmony 鸿蒙Core

0  赞