From 91455ca169a5544a4a62a55e3b50a23da31f7fc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=B8=80=E9=B8=A3?= Date: Tue, 20 May 2025 13:21:03 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0UserSelected?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李一鸣 --- .../native_avscreen_capture.h | 38 +++++++++++++++++++ .../native_avscreen_capture_base.h | 21 ++++++++++ 2 files changed, 59 insertions(+) diff --git a/multimedia/player_framework/native_avscreen_capture.h b/multimedia/player_framework/native_avscreen_capture.h index f63d40b263..bc25365f22 100644 --- a/multimedia/player_framework/native_avscreen_capture.h +++ b/multimedia/player_framework/native_avscreen_capture.h @@ -526,6 +526,44 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_StrategyForKeepCaptureDuringCall( */ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_SetCaptureContentChangedCallback(struct OH_AVScreenCapture *capture, OH_AVScreenCapture_OnCaptureContentChanged callback, void *userData); + +/** + * @brief Register user selection notification callback function + * @syscap SystemCapability.Multimedia.Media.AVScreenCapture + * @param {OH_AVScreenCapture*} capture Pointer to OH_AVScreenCapture which want to handle user selection info + * @param {OH_AVScreenCapture_OnUserSelected} callback user selection callback function, see {@link OH_AVScreenCapture_OnUserSelected} + * @param {void*} userData The control block pointer passed by the application is carried to the application when it is returned + * @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. + * @since 20 + */ +OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_SetSelectionCallback(struct OH_AVScreenCapture *capture, + OH_AVScreenCapture_OnUserSelected callback, void *userData); + +/** + * @brief Get the recording content type selected by the user in the confirmation interface + * @syscap SystemCapability.Multimedia.Media.AVScreenCapture + * @param {OH_AVScreenCapture_UserSelectionInfo*} selection Pointer to an OH_AVScreenCapture_UserSelectionInfo instance + * @param {int32_t*} type The capture object type selected by the user, 0: represents the screen, 1: represents the window. + * @return Function result code. + * {@link AV_SCREEN_CAPTURE_ERR_OK} if the execution is successful. + * {@link AV_SCREEN_CAPTURE_ERR_INVALID_VAL} if selections is nullptr. + * @since 20 + */ +OH_AVErrCode OH_AVScreenCapture_GetCaptureTypeSelected(OH_AVScreenCapture_UserSelectionInfo *selection, int32_t* type); + +/** + * @brief Get the Display ID of user selections in the confirmation interface + * @syscap SystemCapability.Multimedia.Media.AVScreenCapture + * @param {OH_AVScreenCapture_UserSelectionInfo*} selection Pointer to an OH_AVScreenCapture_UserSelectionInfo instance + * @param {uint64_t*} displayId Returns the screen ID value selected by the user + * @return Function result code. + * {@link AV_SCREEN_CAPTURE_ERR_OK} if the execution is successful. + * {@link AV_SCREEN_CAPTURE_ERR_INVALID_VAL} if selections is nullptr. + * @since 20 + */ +OH_AVErrCode OH_AVScreenCapture_GetDisplayIdSelected(OH_AVScreenCapture_UserSelectionInfo *selection, uint64_t* displayId); #ifdef __cplusplus } #endif diff --git a/multimedia/player_framework/native_avscreen_capture_base.h b/multimedia/player_framework/native_avscreen_capture_base.h index 52412d56ad..dd7afe68bd 100644 --- a/multimedia/player_framework/native_avscreen_capture_base.h +++ b/multimedia/player_framework/native_avscreen_capture_base.h @@ -569,6 +569,27 @@ typedef struct OH_AVScreenCapture_CaptureStrategy OH_AVScreenCapture_CaptureStra typedef void (*OH_AVScreenCapture_OnCaptureContentChanged)(OH_AVScreenCapture* capture, OH_AVScreenCaptureContentChangedEvent event, OH_Rect* area, void *userData); +/** + * @brief Initialization of OH_AVScreenCapture_UserSelectionInfo + * @syscap SystemCapability.Multimedia.Media.AVScreenCapture + * + * @since 20 + */ +typedef struct OH_AVScreenCapture_UserSelectionInfo OH_AVScreenCapture_UserSelectionInfo; + +/** + * @brief When the user selects parameters in the authorization interface (selection interface), + * the function interface returns the parameters to the application. + * @syscap SystemCapability.Multimedia.Media.AVScreenCapture + * @param {OH_AVScreenCapture*} capture Pointer to an OH_AVScreenCapture instance + * @param {OH_AVScreenCapture_UserSelectionInfo*} selections The recording parameter information + * selected by the user on the authorization interface + * @param {void*} userData Pointer to user specific data + * + * @since 20 + */ +typedef void (*OH_AVScreenCapture_OnUserSelected)(OH_AVScreenCapture* capture, + OH_AVScreenCapture_UserSelectionInfo* selections, void *userData); #ifdef __cplusplus } #endif -- Gitee From ad73c8ab1bf4aefa88e7e787245472f8722fc710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=B8=80=E9=B8=A3?= Date: Thu, 22 May 2025 01:53:18 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0codecheck?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李一鸣 --- multimedia/player_framework/native_avscreen_capture.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/multimedia/player_framework/native_avscreen_capture.h b/multimedia/player_framework/native_avscreen_capture.h index bc25365f22..5d2ca5df09 100644 --- a/multimedia/player_framework/native_avscreen_capture.h +++ b/multimedia/player_framework/native_avscreen_capture.h @@ -563,7 +563,8 @@ OH_AVErrCode OH_AVScreenCapture_GetCaptureTypeSelected(OH_AVScreenCapture_UserSe * {@link AV_SCREEN_CAPTURE_ERR_INVALID_VAL} if selections is nullptr. * @since 20 */ -OH_AVErrCode OH_AVScreenCapture_GetDisplayIdSelected(OH_AVScreenCapture_UserSelectionInfo *selection, uint64_t* displayId); +OH_AVErrCode OH_AVScreenCapture_GetDisplayIdSelected(OH_AVScreenCapture_UserSelectionInfo *selection, + uint64_t* displayId); #ifdef __cplusplus } #endif -- Gitee