openharmony 鸿蒙 capi-avtranscoder-base-h

2026-08-25 浏览 (1)

avtranscoder_base.h

Overview

The file declares the struct and enums used by the AVTranscoder.

File to include: <multimedia/player_framework/avtranscoder_base.h>

Library: libavtranscoder.so

System capability: SystemCapability.Multimedia.Media.AVTranscoder

Since: 20

Related module: AVTranscoder

Summary

Structs

Nametypedef KeywordDescription
OH_AVTranscoderOH_AVTranscoderInitializes an AVTranscoder.
OH_AVTranscoder_ConfigOH_AVTranscoder_ConfigInitializes an AVTranscoder_Config.

Enums

Nametypedef KeywordDescription
OH_AVTranscoder_StateOH_AVTranscoder_StateEnumerates the transcoding states.

Functions

Nametypedef KeywordDescription
typedef void (*OH_AVTranscoder_OnStateChange)(OH_AVTranscoder *transcoder, OH_AVTranscoder_State state, void *userData)OH_AVTranscoder_OnStateChangeDefines a callback invoked when the state of the transcoding process changes.
typedef void (*OH_AVTranscoder_OnError)(OH_AVTranscoder *transcoder, int32_t errorCode, const char *errorMsg, void *userData)OH_AVTranscoder_OnErrorDefines a callback invoked when an error occurs during the transcoding process.
typedef void (*OH_AVTranscoder_OnProgressUpdate)(OH_AVTranscoder *transcoder, int32_t progress, void *userData)OH_AVTranscoder_OnProgressUpdateDefines a callback invoked when the progress of the transcoding process is updated.

Enum Description

OH_AVTranscoder_State

enum OH_AVTranscoder_State

Description

Enumerates the transcoding states.

System capability: SystemCapability.Multimedia.Media.AVTranscoder

Since: 20

Enum ItemDescription
AVTRANSCODER_PREPARED = 1The transcoding process is prepared and ready to start.
AVTRANSCODER_STARTED = 2The transcoding process has started.
AVTRANSCODER_PAUSED = 3The transcoding process is paused.
AVTRANSCODER_CANCELLED = 4The transcoding process has been canceled.
AVTRANSCODER_COMPLETED = 5The transcoding process is completed.

Function Description

OH_AVTranscoder_OnStateChange()

typedef void (*OH_AVTranscoder_OnStateChange)(OH_AVTranscoder *transcoder, OH_AVTranscoder_State state, void *userData)

Description

Defines a callback invoked when the state of the transcoding process changes.

System capability: SystemCapability.Multimedia.Media.AVTranscoder

Since: 20

Parameters

NameDescription
OH_AVTranscoder *transcoderPointer to an OH_AVTranscoder instance.
OH_AVTranscoder_State stateTranscoding state. For details, see OH_AVTranscoder_State.
void *userDataPointer to user-defined data.

OH_AVTranscoder_OnError()

typedef void (*OH_AVTranscoder_OnError)(OH_AVTranscoder *transcoder, int32_t errorCode, const char *errorMsg,void *userData)

Description

Defines a callback invoked when an error occurs during the transcoding process.

System capability: SystemCapability.Multimedia.Media.AVTranscoder

Since: 20

Parameters

NameDescription
OH_AVTranscoder *transcoderPointer to an OH_AVTranscoder instance.
int32_t errorCodeError code.
AV_ERR_NO_MEMORY: No memory. The value is 1.
AV_ERR_OPERATE_NOT_PERMIT: The operation is not allowed. The value is 2.
AV_ERR_INVALID_VAL: The parameter check fails. The value is 3.
AV_ERR_IO: I/O error. The value is 4.
AV_ERR_INVALID_STATE: The operation is not supported in the current state. The value is 8.
AV_ERR_UNSUPPORT: The function is not supported. The value is 9.
const char *errorMsgPointer to the error message.
void *userDataPointer to user-defined data.

OH_AVTranscoder_OnProgressUpdate()

typedef void (*OH_AVTranscoder_OnProgressUpdate)(OH_AVTranscoder *transcoder, int32_t progress, void *userData)

Description

Defines a callback invoked when the progress of the transcoding process is updated.

System capability: SystemCapability.Multimedia.Media.AVTranscoder

Since: 20

Parameters

NameDescription
OH_AVTranscoder *transcoderPointer to an OH_AVTranscoder instance.
int32_t progressTranscoding progress.
void *userDataPointer to user-defined data.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 capi-avrecorder-oh-avrecorder-range

openharmony 鸿蒙 errorcode-media

openharmony 鸿蒙 capi-avplayer

openharmony 鸿蒙 capi-avplayer-base-h

openharmony 鸿蒙 capi-avimage-generator-h

openharmony 鸿蒙 capi-avscreencapture-oh-rect

openharmony 鸿蒙 capi-videoprocessing-videoprocessing-callback

openharmony 鸿蒙 capi-avsinkbase

openharmony 鸿蒙 capi-avmetadataextractor

openharmony 鸿蒙 capi-avscreencapture-oh-multidisplaycapability

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