harmony 鸿蒙avrecorder_base.h

2025-06-12 浏览 (1)

avrecorder_base.h

Overview

The avrecorder_base.h file declares the struct and enums used by the AVRecorder.

Library: libavrecorder.so

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

System capability: SystemCapability.Multimedia.Media.AVRecorder

Since: 18

Related module: AVRecorder

Summary

Structs

NameDescription
struct  OH_AVRecorder_ProfileDescribes the parameters used for audio and video recording.
You can choose to record only audio or only video by setting the parameters. When audioBitrate or audioChannels is set to 0, audio recording is disabled. When videoFrameWidth or videoFrameHeight is set to 0, video recording is disabled.
struct  OH_AVRecorder_LocationDescribes the geographical location information about a media asset.
struct  OH_AVRecorder_MetadataTemplateDescribes the basic template of metadata.
struct  OH_AVRecorder_MetadataDescribes the metadata.
struct  OH_AVRecorder_ConfigDescribes the AVRecorder configuration.
struct  OH_AVRecorder_RangeDescribes the range.
struct  OH_AVRecorder_EncoderInfoDescribes the encoder information.

Types

NameDescription
typedef struct OH_AVRecorder OH_AVRecorderDefines a struct for the AVRecorder.
typedef enum OH_AVRecorder_AudioSourceType OH_AVRecorder_AudioSourceTypeDefines an enum for the audio source types of the AVRecorder.
typedef enum OH_AVRecorder_VideoSourceType OH_AVRecorder_VideoSourceTypeDefines an enum for the video source types of the AVRecorder.
typedef enum OH_AVRecorder_CodecMimeType OH_AVRecorder_CodecMimeTypeDefines an enum for the MIME types of the encoder.
typedef enum OH_AVRecorder_ContainerFormatType OH_AVRecorder_ContainerFormatTypeDefines an enum for the Container Format Types (CFTs).
typedef enum OH_AVRecorder_State OH_AVRecorder_StateDefines an enum for the AVRecorder states.
typedef enum OH_AVRecorder_StateChangeReason OH_AVRecorder_StateChangeReasonDefines an enum for the reasons for AVRecorder state changes.
typedef enum OH_AVRecorder_FileGenerationMode OH_AVRecorder_FileGenerationModeDefines an enum for the modes available for creating a recording file.
typedef struct OH_AVRecorder_Profile OH_AVRecorder_ProfileDefines a struct for the parameters used for audio and video recording.
You can choose to record only audio or only video by setting the parameters. When audioBitrate or audioChannels is set to 0, audio recording is disabled. When videoFrameWidth or videoFrameHeight is set to 0, video recording is disabled.
typedef struct OH_AVRecorder_Location OH_AVRecorder_LocationDefines a struct for the geographical location information about a media asset.
typedef struct OH_AVRecorder_MetadataTemplate OH_AVRecorder_MetadataTemplateDefines a struct for the basic template of metadata.
typedef struct OH_AVRecorder_Metadata OH_AVRecorder_MetadataDefines a struct for the metadata.
typedef struct OH_AVRecorder_Config OH_AVRecorder_ConfigDefines a struct for the AVRecorder configuration.
typedef struct OH_AVRecorder_Range OH_AVRecorder_RangeDefines a struct for the range.
typedef struct OH_AVRecorder_EncoderInfo OH_AVRecorder_EncoderInfoDefines a struct for the encoder information.
typedef void(* OH_AVRecorder_OnStateChange) (OH_AVRecorder *recorder, OH_AVRecorder_State state, OH_AVRecorder_StateChangeReason reason, void *userData)Defines a callback invoked when the AVRecorder state changes.
typedef void(* OH_AVRecorder_OnError) (OH_AVRecorder *recorder, int32_t errorCode, const char *errorMsg, void *userData)Defines a callback invoked when an error occurs during recording.
typedef void(* OH_AVRecorder_OnUri) (OH_AVRecorder *recorder, OH_MediaAsset *asset, void *userData)Defines a callback invoked when the recording is in OH_AVRecorder_FileGenerationMode.AVRECORDER_AUTO_CREATE_CAMERA_SCENE mode.

Enums

NameDescription
OH_AVRecorder_AudioSourceType {
AVRECORDER_DEFAULT = 0,
AVRECORDER_MIC = 1,
AVRECORDER_VOICE_RECOGNITION = 2,
AVRECORDER_VOICE_COMMUNICATION = 7,
AVRECORDER_VOICE_MESSAGE = 10,
AVRECORDER_CAMCORDER = 13
}
Enumerates the audio source types of the AVRecorder.
OH_AVRecorder_VideoSourceType {
AVRECORDER_SURFACE_YUV = 0,
AVRECORDER_SURFACE_ES = 1
}
Enumerates the video source types of the AVRecorder.
OH_AVRecorder_CodecMimeType {
AVRECORDER_VIDEO_AVC = 2,
AVRECORDER_AUDIO_AAC = 3,
AVRECORDER_AUDIO_MP3 = 4,
AVRECORDER_AUDIO_G711MU = 5,
AVRECORDER_VIDEO_MPEG4 = 6,
AVRECORDER_VIDEO_HEVC = 8,
AVRECORDER_AUDIO_AMR_NB = 9,
AVRECORDER_AUDIO_AMR_WB = 10
}
Enumerates the MIME types of the encoder.
OH_AVRecorder_ContainerFormatType {
AVRECORDER_CFT_MPEG_4 = 2,
AVRECORDER_CFT_MPEG_4A = 6,
AVRECORDER_CFT_AMR = 8,
AVRECORDER_CFT_MP3 = 9,
AVRECORDER_CFT_WAV = 10
}
Enumerates the CFTs.
OH_AVRecorder_State {
AVRECORDER_IDLE = 0,
AVRECORDER_PREPARED = 1,
AVRECORDER_STARTED = 2,
AVRECORDER_PAUSED = 3,
AVRECORDER_STOPPED = 4,
AVRECORDER_RELEASED = 5,
AVRECORDER_ERROR = 6
}
Enumerates the AVRecorder states.
OH_AVRecorder_StateChangeReason {
AVRECORDER_USER = 0,
AVRECORDER_BACKGROUND = 1
}
Enumerates the reasons for AVRecorder state changes.
OH_AVRecorder_FileGenerationMode {
AVRECORDER_APP_CREATE = 0,
AVRECORDER_AUTO_CREATE_CAMERA_SCENE = 1
}
Enumerates the modes available for creating a recording file.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Media Kit

harmony 鸿蒙AVImageGenerator

harmony 鸿蒙AVMetadataExtractor

harmony 鸿蒙AVPlayer

harmony 鸿蒙AVPlayerCallback

harmony 鸿蒙AVRecorder

harmony 鸿蒙AVScreenCapture

harmony 鸿蒙OH_AVRecorder_Config

harmony 鸿蒙OH_AVRecorder_EncoderInfo

harmony 鸿蒙OH_AVRecorder_Location

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