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 078df5d3fd9b3c4a9918840c8a5b13e4b4c56041..82fb19071e11218c695b074805c1a6db84591b73 100644 --- a/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json +++ b/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json @@ -162,5 +162,9 @@ { "first_introduced": "20", "name": "OH_AVScreenCapture_StrategyForPickerPopUp" + }, + { + "first_introduced": "20", + "name": "OH_AVScreenCapture_StrategyForFillMode" } ] \ 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 7d52b610bb2424c24356ddcbdeaf5cda7d846605..1cdec7d92c5d45d64e5d86358004e71b2e6757c3 100644 --- a/multimedia/player_framework/native_avscreen_capture.h +++ b/multimedia/player_framework/native_avscreen_capture.h @@ -633,6 +633,18 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_StrategyForBFramesEncoding( */ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_StrategyForPickerPopUp( OH_AVScreenCapture_CaptureStrategy *strategy, bool value); + +/** + * @brief Set the fill mode of the captured image in the target area + * @param {OH_AVScreenCapture_CaptureStrategy*} strategy Pointer to an OH_AVScreenCapture_CaptureStrategy instance + * @param {OH_AVScreenCapture_FillMode} mode Value of the captured image fill mode + * @return Function result code. + * {@link AV_SCREEN_CAPTURE_ERR_OK} if the execution is successful. + * {@link AV_SCREEN_CAPTURE_ERR_INVALID_VAL} strategy value is nullptr. + * @since 20 + */ +OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_StrategyForFillMode( + OH_AVScreenCapture_CaptureStrategy *strategy, OH_AVScreenCapture_FillMode mode); #ifdef __cplusplus } #endif diff --git a/multimedia/player_framework/native_avscreen_capture_base.h b/multimedia/player_framework/native_avscreen_capture_base.h index 966a09b4eabc013ae6d7d9667ec1935b3822ca76..bba395b1aa7a5c3c4e9d5e6dd88800fb9374d0e6 100644 --- a/multimedia/player_framework/native_avscreen_capture_base.h +++ b/multimedia/player_framework/native_avscreen_capture_base.h @@ -20,7 +20,7 @@ * @brief Provides APIs of request capability for Screen Capture. * @since 10 */ - + /** * @file native_avscreen_capture_base.h * @@ -31,7 +31,7 @@ * @kit MediaKit * @since 10 */ - + #ifndef NATIVE_AVSCREEN_CAPTURE_BASE_H #define NATIVE_AVSCREEN_CAPTURE_BASE_H @@ -496,6 +496,24 @@ typedef enum OH_AVScreenCaptureContentChangedEvent_Enum { OH_SCREEN_CAPTURE_CONTENT_UNAVAILABLE = 2, } OH_AVScreenCaptureContentChangedEvent; +/** + * @brief content fill mode. + * + * @since 20 + */ +typedef enum OH_AVScreenCapture_FillMode { + /** + * Keep the original image aspect ratio to match the target + * image size. If the ratio is inconsistent, there may be black edges. + */ + OH_SCREENCAPTURE_FILLMODE_ASPECT_SCALE_FIT = 0, + /** + * The image is stretched to match the target output size. + * If the ratios are inconsistent, the image will be deformed. + */ + OH_SCREENCAPTURE_FILLMODE_SCALE_TO_FILL = 1, +} OH_AVScreenCapture_FillMode; + /** * @brief When state of OH_AVScreenCapture is changed, the function pointer will be called. * @syscap SystemCapability.Multimedia.Media.AVScreenCapture