diff --git a/multimedia/player_framework/native_avscreen_capture.h b/multimedia/player_framework/native_avscreen_capture.h index f63d40b2630920902d6c122fe70dc7e4e4277ff0..5d2ca5df09c084f96ef83c40740520ed604ac11a 100644 --- a/multimedia/player_framework/native_avscreen_capture.h +++ b/multimedia/player_framework/native_avscreen_capture.h @@ -526,6 +526,45 @@ 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 52412d56adae2829218a912a0f92332f641f82eb..dd7afe68bd2969315e2ea37e72e9f9bf9807d252 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