harmony 鸿蒙native_avscreen_capture.h

  • 2023-10-30
  • 浏览 (282)

native_avscreen_capture.h

概述

声明用于构造屏幕录制对象的Native API。

起始版本:

10

相关模块:

AVScreenCapture

汇总

函数

名称 描述
OH_AVScreenCapture_Create (void) 实例化对象,创建OH_AVScreenCapture。
OH_AVScreenCapture_Init (struct OH_AVScreenCapture *capture, OH_AVScreenCaptureConfig config) 初始化OH_AVScreenCapture相关参数。
OH_AVScreenCapture_StartScreenCapture (struct OH_AVScreenCapture *capture) 开始录屏,采集原始码流。调用后可以通过回调的监听(OH_AVScreenCaptureOnAudioBufferAvailable,OH_AVScreenCaptureOnVideoBufferAvailable)来监听当前是否有码流的产生。
OH_AVScreenCapture_StopScreenCapture (struct OH_AVScreenCapture *capture) 结束录屏,与OH_AVScreenCapture_StartScreenCapture配合使用。调用后针对调用该接口的应用会停止录屏或屏幕共享,释放麦克风。
OH_AVScreenCapture_StartScreenRecording (struct OH_AVScreenCapture *capture) 启动录屏,调用此接口,可采集编码后的码流。
说明: 预留接口,将在后续版本提供。
OH_AVScreenCapture_StopScreenRecording (struct OH_AVScreenCapture *capture) 停止录屏,与OH_AVScreenCapture_StartScreenRecording配合使用。
说明: 预留接口,将在后续版本提供。
OH_AVScreenCapture_AcquireAudioBuffer (struct OH_AVScreenCapture *capture, OH_AudioBuffer **audiobuffer, OH_AudioCaptureSourceType type) 获取音频buffer,应用在调用时,需要对audiobuffer分配对应结构体大小的内存,否则会影响拿到音频buffer的获取。
OH_AVScreenCapture_AcquireVideoBuffer (struct OH_AVScreenCapture *capture, int32_t *fence, int64_t *timestamp, struct OH_Rect *region) 获取视频buffer,应用在调用时,通过此接口来获取到视频的buffer以及时间戳等信息。
OH_AVScreenCapture_ReleaseAudioBuffer (struct OH_AVScreenCapture *capture, OH_AudioCaptureSourceType type) 根据音频类型释放buffer。
OH_AVScreenCapture_ReleaseVideoBuffer (struct OH_AVScreenCapture *capture) 根据视频类型释放buffer。
OH_AVScreenCapture_SetCallback (struct OH_AVScreenCapture *capture, struct OH_AVScreenCaptureCallback callback) 设置监听接口,通过设置监听,可以监听到调用过程中的错误信息,以及是否有可用的视频buffer和音频buffer。
OH_AVScreenCapture_Release (struct OH_AVScreenCapture *capture) 释放创建的OH_AVScreenCapture实例,对应OH_AVScreenCapture_Create。
OH_AVScreenCapture_SetMicrophoneEnabled (struct OH_AVScreenCapture *capture, bool isMicrophone) 设置麦克风开关。

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Native API

harmony 鸿蒙AVCapability

harmony 鸿蒙AVDemuxer

harmony 鸿蒙AVMuxer

harmony 鸿蒙AVScreenCapture

harmony 鸿蒙AVSource

harmony 鸿蒙AudioDecoder

harmony 鸿蒙AudioEncoder

harmony 鸿蒙CodecBase

harmony 鸿蒙Core

0  赞