harmony 鸿蒙native_avcodec_videoencoder.h

2025-06-12 浏览 (1)

native_avcodec_videoencoder.h

Overview

The native_avcodec_videoencoder.h file declares the native APIs used for video encoding.

Library: libnative_media_venc.so

Since: 9

Related module: VideoEncoder

Summary

Types

NameDescription
typedef void(* OH_VideoEncoder_OnNeedInputParameter) (OH_AVCodec *codec, uint32_t index, OH_AVFormat *parameter, void *userData)Defines the pointer to the function that is called when new input parameters are required during the running of an OH_AVCodec instance. The function carries a buffer to fill in the new input parameters. The parameters take effect immediately with the frame.
typedef enum OH_VideoEncodeBitrateMode OH_VideoEncodeBitrateModeDefines an enum for bit rate modes of a video encoder. (This type is deprecated from API version 14.)

Enums

NameDescription
OH_VideoEncodeBitrateMode { CBR = 0, VBR = 1, CQ = 2 }Enumerates the bit rate modes of a video encoder. (This enum is deprecated from API version 14.)

Functions

NameDescription
OH_AVCodec * OH_VideoEncoder_CreateByMime (const char *mime)Creates a video encoder instance based on a Multipurpose Internet Mail Extension (MIME) type.
OH_AVCodec * OH_VideoEncoder_CreateByName (const char *name)Creates a video encoder instance based on an encoder name.
OH_AVErrCode OH_VideoEncoder_Destroy (OH_AVCodec *codec)Clears the internal resources of a video encoder and destroys the encoder instance.
OH_AVErrCode OH_VideoEncoder_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 encoder.
OH_AVErrCode OH_VideoEncoder_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 encoder.
OH_AVErrCode OH_VideoEncoder_RegisterParameterCallback (OH_AVCodec *codec, OH_VideoEncoder_OnNeedInputParameter onInputParameter, void *userData)Registers an asynchronous input parameter callback so that your application can respond to events generated by a video encoder.
OH_AVErrCode OH_VideoEncoder_Configure (OH_AVCodec *codec, OH_AVFormat *format)Configures a video encoder. Typically, you need to configure the description information about the video track to be encoded.
OH_AVErrCode OH_VideoEncoder_Prepare (OH_AVCodec *codec)Prepares internal resources for a video encoder.
OH_AVErrCode OH_VideoEncoder_Start (OH_AVCodec *codec)Starts a video encoder. This function can be called only after the encoder is prepared.
OH_AVErrCode OH_VideoEncoder_Stop (OH_AVCodec *codec)Stops a video encoder.
OH_AVErrCode OH_VideoEncoder_Flush (OH_AVCodec *codec)Clears the input and output data in the internal buffer of a video encoder.
OH_AVErrCode OH_VideoEncoder_Reset (OH_AVCodec *codec)Resets a video encoder.
OH_AVFormat * OH_VideoEncoder_GetOutputDescription (OH_AVCodec *codec)Obtains the description information about the output data of a video encoder.
OH_AVErrCode OH_VideoEncoder_SetParameter (OH_AVCodec *codec, OH_AVFormat *format)Sets dynamic parameters for a video encoder.
OH_AVErrCode OH_VideoEncoder_GetSurface (OH_AVCodec *codec, OHNativeWindow **window)Obtains the input surface from a video encoder.
OH_AVErrCode OH_VideoEncoder_FreeOutputData (OH_AVCodec *codec, uint32_t index)Frees an output buffer of a video encoder.
OH_AVErrCode OH_VideoEncoder_NotifyEndOfStream (OH_AVCodec *codec)Notifies a video encoder that input streams end.
OH_AVErrCode OH_VideoEncoder_PushInputData (OH_AVCodec *codec, uint32_t index, OH_AVCodecBufferAttr attr)Pushes the input buffer filled with data to a video encoder.
OH_AVErrCode OH_VideoEncoder_PushInputBuffer (OH_AVCodec *codec, uint32_t index)Pushes the input buffer filled with data to a video encoder.
OH_AVErrCode OH_VideoEncoder_PushInputParameter (OH_AVCodec *codec, uint32_t index)Pushes the input buffer filled with the input parameters to a video encoder.
OH_AVErrCode OH_VideoEncoder_FreeOutputBuffer (OH_AVCodec *codec, uint32_t index)Frees an output buffer of a video encoder.
OH_AVFormat * OH_VideoEncoder_GetInputDescription (OH_AVCodec *codec)Obtains the description received by a video encoder.
OH_AVErrCode OH_VideoEncoder_IsValid (OH_AVCodec *codec, bool *isValid)Checks whether a video encoder instance is valid.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙AVCodec Kit

harmony 鸿蒙AVCapability

harmony 鸿蒙AVDemuxer

harmony 鸿蒙AVMuxer

harmony 鸿蒙AVSource

harmony 鸿蒙AudioCodec

harmony 鸿蒙AudioDecoder

harmony 鸿蒙AudioEncoder

harmony 鸿蒙CodecBase

harmony 鸿蒙Core

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/Laaxhw