harmony 鸿蒙avrecorder_base.h

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

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

Name Description
struct  OH_AVRecorder_Profile Describes 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_Location Describes the geographical location information about a media asset.
struct  OH_AVRecorder_MetadataTemplate Describes the basic template of metadata.
struct  OH_AVRecorder_Metadata Describes the metadata.
struct  OH_AVRecorder_Config Describes the AVRecorder configuration.
struct  OH_AVRecorder_Range Describes the range.
struct  OH_AVRecorder_EncoderInfo Describes the encoder information.

Types

Name Description
typedef struct OH_AVRecorder OH_AVRecorder Defines a struct for the AVRecorder.
typedef enum OH_AVRecorder_AudioSourceType OH_AVRecorder_AudioSourceType Defines an enum for the audio source types of the AVRecorder.
typedef enum OH_AVRecorder_VideoSourceType OH_AVRecorder_VideoSourceType Defines an enum for the video source types of the AVRecorder.
typedef enum OH_AVRecorder_CodecMimeType OH_AVRecorder_CodecMimeType Defines an enum for the MIME types of the encoder.
typedef enum OH_AVRecorder_ContainerFormatType OH_AVRecorder_ContainerFormatType Defines an enum for the Container Format Types (CFTs).
typedef enum OH_AVRecorder_State OH_AVRecorder_State Defines an enum for the AVRecorder states.
typedef enum OH_AVRecorder_StateChangeReason OH_AVRecorder_StateChangeReason Defines an enum for the reasons for AVRecorder state changes.
typedef enum OH_AVRecorder_FileGenerationMode OH_AVRecorder_FileGenerationMode Defines an enum for the modes available for creating a recording file.
typedef struct OH_AVRecorder_Profile OH_AVRecorder_Profile Defines 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_Location Defines a struct for the geographical location information about a media asset.
typedef struct OH_AVRecorder_MetadataTemplate OH_AVRecorder_MetadataTemplate Defines a struct for the basic template of metadata.
typedef struct OH_AVRecorder_Metadata OH_AVRecorder_Metadata Defines a struct for the metadata.
typedef struct OH_AVRecorder_Config OH_AVRecorder_Config Defines a struct for the AVRecorder configuration.
typedef struct OH_AVRecorder_Range OH_AVRecorder_Range Defines a struct for the range.
typedef struct OH_AVRecorder_EncoderInfo OH_AVRecorder_EncoderInfo Defines 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

Name Description
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

0  赞