From 3ab8b808498581653492426ef6354d03fdc976d8 Mon Sep 17 00:00:00 2001 From: Trouvaille Date: Mon, 21 Apr 2025 19:27:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=95=E5=B1=8F=E6=A1=86=E6=9E=B6=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E5=BA=94=E7=94=A8=E8=AE=A2=E9=98=85=E5=BD=95=E5=88=B6?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E7=8A=B6=E6=80=81=E5=8F=98=E5=8C=96=E9=80=9A?= =?UTF-8?q?=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Trouvaille --- .../native_avscreen_capture.h | 16 +++++++++++ .../native_avscreen_capture_base.h | 28 +++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/multimedia/player_framework/native_avscreen_capture.h b/multimedia/player_framework/native_avscreen_capture.h index 150ebef4f..46c06c9c7 100644 --- a/multimedia/player_framework/native_avscreen_capture.h +++ b/multimedia/player_framework/native_avscreen_capture.h @@ -463,6 +463,22 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_ShowCursor(struct OH_AVScreenCapt */ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_SetDisplayCallback(struct OH_AVScreenCapture *capture, OH_AVScreenCapture_OnDisplaySelected callback, void *userData); + +/** + * @brief Set the Capture Content Changed callback function so that your application can + * customize event handler generated by the av screen capture. This interface must be called before Start is called. + * @syscap SystemCapability.Multimedia.Media.AVScreenCapture + * @param capture Pointer to an OH_AVScreenCapture instance + * @param callback contentchanged callback function, see {@link OH_AVScreenCapture_OnCaptureContentChanged} + * @param userData Pointer to user specific data + * @return Function result code. + * {@link AV_SCREEN_CAPTURE_ERR_OK} if the execution is successful. + * {@link AV_SCREEN_CAPTURE_ERR_INVALID_VAL} input capture is nullptr or input callback is nullptr. + * {@link AV_SCREEN_CAPTURE_ERR_OPERATE_NOT_PERMIT} opertation not be permitted, set ErrorCallback failed. + * @since 20 + */ +OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_SetCaptureContentChangedCallback(struct OH_AVScreenCapture *capture, + OH_AVScreenCapture_OnCaptureContentChanged callback, void *userData) #ifdef __cplusplus } #endif diff --git a/multimedia/player_framework/native_avscreen_capture_base.h b/multimedia/player_framework/native_avscreen_capture_base.h index 85b1280d1..06193cb56 100644 --- a/multimedia/player_framework/native_avscreen_capture_base.h +++ b/multimedia/player_framework/native_avscreen_capture_base.h @@ -481,6 +481,21 @@ typedef enum OH_AVScreenCaptureFilterableAudioContent { OH_SCREEN_CAPTURE_CURRENT_APP_AUDIO = 1, } OH_AVScreenCaptureFilterableAudioContent; +/** + * @brief Enumerates screen capture content state. + * @syscap SystemCapability.Multimedia.Media.AVScreenCapture + * + * @since 20 + */ +typedef enum OH_AVScreenCaptureContentChangedEvent { + /** Content is hiden */ + OH_SCREEN_CAPTURE_CONTENT_HIDE = 0, + /** Content is visible */ + OH_SCREEN_CAPTURE_CONTENT_VISIBLE = 1, + /** ScreenCapture stopped by user */ + OH_SCREEN_CAPTURE_CONTENT_UNAVAILABLE = 2, +} OH_AVScreenCaptureContentChangedEvent; + /** * @brief When state of OH_AVScreenCapture is changed, the function pointer will be called. * @syscap SystemCapability.Multimedia.Media.AVScreenCapture @@ -532,6 +547,19 @@ typedef void (*OH_AVScreenCapture_OnBufferAvailable)(OH_AVScreenCapture *capture */ typedef void (*OH_AVScreenCapture_OnDisplaySelected)(OH_AVScreenCapture *capture, uint64_t displayId, void *userData); +/** + * @brief When Capture Content info changes, the function will be called to notify user + * @syscap SystemCapability.Multimedia.Media.AVScreenCapture + * @param {OH_AVScreenCapture*} capture Pointer to an OH_AVScreenCapture instance + * @param {OH_AVScreenCaptureContentChangedEvent} event enum for content change event + * @param {OH_Rect*} area capture content rect position + * @param { void*} userData Pointer to user specific data + * + * @since 20 + * @version 1.0 + */ +typedef void (*OH_AVScreenCapture_OnCaptureContentChanged)(OH_AVScreenCapture *capture, + OH_AVScreenCaptureContentChangedEvent event, OH_Rect *area, void *userData); #ifdef __cplusplus } #endif -- Gitee