From 4331d6a5e717e0977c995c413ce57ff68efbf28e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=B8=80=E9=B8=A3?= Date: Fri, 23 May 2025 14:36:44 +0800 Subject: [PATCH] add SetCaptureArea MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李一鸣 --- .../libnative_avscreen_capture.ndk.json | 4 ++++ .../player_framework/native_avscreen_capture.h | 14 ++++++++++++++ 2 files changed, 18 insertions(+) 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 0c790e079..48aa9a0d4 100644 --- a/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json +++ b/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json @@ -130,5 +130,9 @@ { "first_introduced": "20", "name": "OH_AVScreenCapture_SetCaptureContentChangedCallback" + }, + { + "first_introduced": "20", + "name": "OH_AVScreenCapture_SetCaptureArea" } ] \ 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 eb62b5feb..5bf1e8487 100644 --- a/multimedia/player_framework/native_avscreen_capture.h +++ b/multimedia/player_framework/native_avscreen_capture.h @@ -526,6 +526,20 @@ 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 Set or update the captureArea + * @param {struct OH_AVScreenCapture*} capture capture Pointer to an OH_AVScreenCapture instance + * @param {uint64_t} displayId Indicates the screen index for setting area recording + * @param {OH_Rect*} area Pointer to an object describing the location and size of the region + * @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 displayid not exist or area is + * invalid. + * @since 20 + */ +OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_SetCaptureArea(struct OH_AVScreenCapture *capture, + uint64_t displayId, OH_Rect* area); #ifdef __cplusplus } #endif -- Gitee