harmony 鸿蒙native_avscreen_capture_base.h

2025-06-12 浏览 (1)

native_avscreen_capture_base.h

Overview

The native_avscreen_capture_base.h file declares the common structs, character constants, and enums used for running screen capture.

Library: libnative_avscreen_capture.so

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

System capability: SystemCapability.Multimedia.Media.AVScreenCapture

Since: 10

Related module: AVScreenCapture

Summary

Structs

NameDescription
struct OH_AudioCaptureInfoDescribes the audio capture information.
struct OH_AudioEncInfoDescribes the audio encoding information.
struct OH_AudioInfoDescribes the audio information.
struct OH_VideoCaptureInfoDescribes the video capture information.
struct OH_VideoEncInfoDescribes the video encoding information.
struct OH_VideoInfoDescribes the video information.
struct OH_RecorderInfoDescribes the recording file information.
struct OH_AVScreenCaptureConfigDescribes the screen capture configuration.
struct OH_AVScreenCaptureCallbackDescribes all the asynchronous callback function pointers of an OH_AVScreenCapture instance.
struct OH_RectDescribes the width, height, and image information of the rectangle used for screen capture.
struct OH_AudioBufferDescribes the configuration such as the size, type, and timestamp of audio data.

Types

NameDescription
typedef struct OH_NativeBuffer OH_NativeBufferDefines the native video stream class for screen capture.
typedef struct OH_AVScreenCapture OH_AVScreenCaptureDefines a screen capture instance used to obtain original video and audio streams.
typedef struct OH_AVScreenCapture_ContentFilter OH_AVScreenCapture_ContentFilterDefines a struct that describes the filter used to filter audio and video content.
typedef enum OH_CaptureMode OH_CaptureModeDefines an enum for the screen capture modes.
typedef enum OH_AudioCaptureSourceType OH_AudioCaptureSourceTypeDefines an enum for the audio source types during screen capture.
typedef enum OH_AudioCodecFormat OH_AudioCodecFormatDefines an enum for the audio encoding formats.
typedef enum OH_VideoCodecFormat OH_VideoCodecFormatDefines an enum for the video encoding formats.
typedef enum OH_DataType OH_DataTypeDefines an enum for the data types of screen capture streams.
typedef enum OH_VideoSourceType OH_VideoSourceTypeDefines an enum for the video source formats. Currently, only the RGBA format is supported.
typedef enum OH_ContainerFormatType OH_ContainerFormatTypeDefines an enum for the types of files generated during screen capture.
typedef struct OH_AudioCaptureInfo OH_AudioCaptureInfoDefines a struct that describes the audio capture information.
typedef struct OH_AudioEncInfo OH_AudioEncInfoDefines a struct that describes the audio encoding information.
typedef struct OH_AudioInfo OH_AudioInfoDefines a struct that describes the audio information.
typedef struct OH_VideoCaptureInfo OH_VideoCaptureInfoDefines a struct that describes the video capture information.
typedef struct OH_VideoEncInfo OH_VideoEncInfoDefines a struct that describes the video encoding information.
typedef struct OH_VideoInfo OH_VideoInfoDefines a struct that describes the video information.
typedef struct OH_RecorderInfo OH_RecorderInfoDefines a struct that describes the recording file information.
typedef struct OH_AVScreenCaptureConfig OH_AVScreenCaptureConfigDefines a struct that describes the screen capture configuration.
typedef void(* OH_AVScreenCaptureOnError) (OH_AVScreenCapture *capture, int32_t errorCode)Defines a pointer to a callback function that is called when an error occurs during the running of an OH_AVScreenCapture instance.
typedef void(* OH_AVScreenCaptureOnAudioBufferAvailable) (OH_AVScreenCapture *capture, bool isReady, OH_AudioCaptureSourceType type)Defines a pointer to a callback function that is called when an audio buffer is available during the running of an OH_AVScreenCapture instance.
typedef void(* OH_AVScreenCaptureOnVideoBufferAvailable) (OH_AVScreenCapture *capture, bool isReady)Defines a pointer to a callback function that is called when a video buffer is available during the running of an OH_AVScreenCapture instance.
typedef struct OH_AVScreenCaptureCallback OH_AVScreenCaptureCallbackDefines a struct that describes all the asynchronous callback function pointers of an OH_AVScreenCapture instance.
typedef struct OH_Rect OH_RectDefines a struct that describes the width, height, and image information of the rectangle used for screen capture.
typedef struct OH_AudioBuffer OH_AudioBufferDefines a struct that describes the configuration such as the size, type, and timestamp of audio data.
typedef enum OH_AVScreenCaptureStateCode OH_AVScreenCaptureStateCodeDefines an enum for the screen capture states.
typedef enum OH_AVScreenCaptureBufferType OH_AVScreenCaptureBufferTypeDefines an enum for the buffer types.
typedef enum OH_AVScreenCaptureFilterableAudioContent OH_AVScreenCaptureFilterableAudioContentDefines an enum for the types of audio that can be added to a content filter.
typedef void(* OH_AVScreenCapture_OnStateChange) (struct OH_AVScreenCapture *capture, OH_AVScreenCaptureStateCode stateCode, void *userData)Defines a pointer to a callback function that is called when the state changes during the running of an OH_AVScreenCapture instance.
typedef void(* OH_AVScreenCapture_OnError) (OH_AVScreenCapture *capture, int32_t errorCode, void *userData)Defines a pointer to a callback function that is called when an error occurs during the running of an OH_AVScreenCapture instance.
typedef void(* OH_AVScreenCapture_OnBufferAvailable) (OH_AVScreenCapture *capture, OH_AVBuffer *buffer, OH_AVScreenCaptureBufferType bufferType, int64_t timestamp, void *userData)Defines a pointer to a callback function that is called when an audio or a video buffer is available during the running of an OH_AVScreenCapture instance.
typedef void(* OH_AVScreenCapture_OnDisplaySelected) (OH_AVScreenCapture *capture, uint64_t displayId, void *userData)Defines a pointer to a callback function that is called when screen capture starts.

Enums

NameDescription
OH_CaptureMode {
OH_CAPTURE_HOME_SCREEN = 0,
OH_CAPTURE_SPECIFIED_SCREEN = 1,
OH_CAPTURE_SPECIFIED_WINDOW = 2,
OH_CAPTURE_INVAILD = -1
}
Enumerates the screen capture modes.
OH_AudioCaptureSourceType {
OH_SOURCE_INVALID = -1,
OH_SOURCE_DEFAULT = 0,
OH_MIC = 1,
OH_ALL_PLAYBACK = 2,
OH_APP_PLAYBACK = 3
}
Enumerates the audio source types during screen capture.
OH_AudioCodecFormat {
OH_AUDIO_DEFAULT = 0,
OH_AAC_LC = 3,
OH_AUDIO_CODEC_FORMAT_BUTT
}
Enumerates the audio encoding formats.
OH_VideoCodecFormat {
OH_VIDEO_DEFAULT = 0,
OH_H264 = 2,
OH_H265 = 4,
OH_MPEG4 = 6,
OH_VP8 = 8,
OH_VP9 = 10,
OH_VIDEO_CODEC_FORMAT_BUTT
}
Enumerates the video encoding formats.
OH_DataType {
OH_ORIGINAL_STREAM = 0,
OH_ENCODED_STREAM = 1,
OH_CAPTURE_FILE = 2,
OH_INVAILD = -1
}
Enumerates the data types of screen capture streams.
OH_VideoSourceType {
OH_VIDEO_SOURCE_SURFACE_YUV = 0,
OH_VIDEO_SOURCE_SURFACE_ES,
OH_VIDEO_SOURCE_SURFACE_RGBA,
OH_VIDEO_SOURCE_BUTT
}
Enumerates the video source formats. Currently, only the RGBA format is supported.
OH_ContainerFormatType {
CFT_MPEG_4A = 0,
CFT_MPEG_4 = 1
}
Enumerates the types of files generated during screen capture.
OH_AVScreenCaptureStateCode {
OH_SCREEN_CAPTURE_STATE_STARTED = 0,
OH_SCREEN_CAPTURE_STATE_CANCELED = 1,
OH_SCREEN_CAPTURE_STATE_STOPPED_BY_USER = 2,
OH_SCREEN_CAPTURE_STATE_INTERRUPTED_BY_OTHER = 3,
OH_SCREEN_CAPTURE_STATE_STOPPED_BY_CALL = 4,
OH_SCREEN_CAPTURE_STATE_MIC_UNAVAILABLE = 5,
OH_SCREEN_CAPTURE_STATE_MIC_MUTED_BY_USER = 6,
OH_SCREEN_CAPTURE_STATE_MIC_UNMUTED_BY_USER = 7,
OH_SCREEN_CAPTURE_STATE_ENTER_PRIVATE_SCENE = 8,
OH_SCREEN_CAPTURE_STATE_EXIT_PRIVATE_SCENE = 9,
OH_SCREEN_CAPTURE_STATE_STOPPED_BY_USER_SWITCHES = 10
}
Enumerates the screen capture states.
OH_AVScreenCaptureBufferType {
OH_SCREEN_CAPTURE_BUFFERTYPE_VIDEO = 0,
OH_SCREEN_CAPTURE_BUFFERTYPE_AUDIO_INNER = 1,
OH_SCREEN_CAPTURE_BUFFERTYPE_AUDIO_MIC = 2
}
Enumerates the buffer types.
OH_AVScreenCaptureFilterableAudioContent {
OH_SCREEN_CAPTURE_NOTIFICATION_AUDIO = 0,
OH_SCREEN_CAPTURE_CURRENT_APP_AUDIO = 1
}
Enumerates the types of audio that can be added to a content filter.

你可能感兴趣的鸿蒙文章

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/l0z9Ax