diff --git a/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json b/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json index d113e6ba51d77855357756f7a1ebcfa2f02db353..7229854286eaca809f9ecab1d45265599474ec73 100644 --- a/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json +++ b/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json @@ -138,5 +138,17 @@ { "first_introduced": "20", "name": "OH_AVScreenCapture_StrategyForPrivacyMaskMode" + }, + { + "first_introduced": "20", + "name": "OH_AVScreenCapture_SetSelectionCallback" + }, + { + "first_introduced": "20", + "name": "OH_AVScreenCapture_GetCaptureTypeSelected" + }, + { + "first_introduced": "20", + "name": "OH_AVScreenCapture_GetDisplayIdSelected" } ] \ No newline at end of file diff --git a/multimedia/player_framework/native_avscreen_capture.h b/multimedia/player_framework/native_avscreen_capture.h index a5abf9c911b77670af2af06e493ecdae8a0003d3..091e3ccf863bf3553911868f96f192da7a690338 100644 --- a/multimedia/player_framework/native_avscreen_capture.h +++ b/multimedia/player_framework/native_avscreen_capture.h @@ -547,8 +547,8 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_SetCaptureArea(struct OH_AVScreen * @param {OH_AVScreenCapture_CaptureStrategy*} strategy Pointer to an OH_AVScreenCapture_CaptureStrategy instance * @param {int32_t} value * If set to 0, it means that when there is a privacy window interface, the output screen image is completely black. - * If set to 1, it means that when there is a privacy window interface, only the privacy window area of the output screen becomes black, - * and other values returns an error. + * If set to 1, it means that when there is a privacy window interface, only the privacy window area of the output + * screen becomes black, and other values returns an error. * @return Function result code. * {@link AV_SCREEN_CAPTURE_ERR_OK} if the execution is successful. * {@link AV_SCREEN_CAPTURE_ERR_INVALID_VAL} strategy is nullptr or value is invalid. @@ -556,6 +556,49 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_SetCaptureArea(struct OH_AVScreen */ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_StrategyForPrivacyMaskMode( OH_AVScreenCapture_CaptureStrategy *strategy, int32_t value); + +/** + * @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_AVSCREEN_CAPTURE_ErrCode 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_AVSCREEN_CAPTURE_ErrCode 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 7b00c4201ecc631bd3d84d656d9cafc3089280de..966a09b4eabc013ae6d7d9667ec1935b3822ca76 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