From 199e85e69ad5c4533a47094d4aadedd0010301fe Mon Sep 17 00:00:00 2001 From: sqwlly Date: Sat, 8 Feb 2025 09:33:29 +0000 Subject: [PATCH] h266 interface Signed-off-by: s30029175 Signed-off-by: sqwlly Change-Id: I65dc87f26eb4694e584d2befa671ec82fce68360 --- .../native_image/libnative_image.ndk.json | 4 ++++ graphic/graphic_2d/native_image/native_image.h | 18 ++++++++++++++++++ .../native_window/graphic_error_code.h | 5 +++++ 3 files changed, 27 insertions(+) diff --git a/graphic/graphic_2d/native_image/libnative_image.ndk.json b/graphic/graphic_2d/native_image/libnative_image.ndk.json index 1a8c6688d..1b40db3aa 100644 --- a/graphic/graphic_2d/native_image/libnative_image.ndk.json +++ b/graphic/graphic_2d/native_image/libnative_image.ndk.json @@ -11,6 +11,10 @@ { "name": "OH_NativeImage_UnsetOnFrameAvailableListener" }, { "name": "OH_NativeImage_Destroy" }, { "name": "OH_NativeImage_GetTransformMatrixV2" }, + { + "first_introduced": "15", + "name": "OH_NativeImage_GetBufferMatrix" + }, { "first_introduced": "12", "name": "OH_NativeImage_AcquireNativeWindowBuffer" diff --git a/graphic/graphic_2d/native_image/native_image.h b/graphic/graphic_2d/native_image/native_image.h index 38702c9e1..9ad3ebbd7 100644 --- a/graphic/graphic_2d/native_image/native_image.h +++ b/graphic/graphic_2d/native_image/native_image.h @@ -239,6 +239,24 @@ void OH_NativeImage_Destroy(OH_NativeImage** image); */ int32_t OH_NativeImage_GetTransformMatrixV2(OH_NativeImage* image, float matrix[16]); +/** + * @brief Obtains the transform matrix that combines with crop rect. + * + * This API returns a transform matrix that combines the crop rect. + * Note that the matrix will not be updated until OH_NativeImage_UpdateSurfaceImage is called.\n + * This interface is a non-thread-safe type interface.\n + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeImage + * @param image Indicates the pointer to a OH_NativeImage instance. + * @param matrix Indicates the retrieved 4*4 transform matrix . + * @return {@link NATIVE_ERROR_OK} 0 - Success. + * {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - image is NULL. + * {@link NATIVE_ERROR_MEM_OPERATION_ERROR} 30001000 - Memory operation error, failed to get transform matrix. + * @since 15 + * @version 1.0 + */ +int32_t OH_NativeImage_GetBufferMatrix(OH_NativeImage* image, float matrix[16]); + /** * @brief Acquire an OHNativeWindowBuffer through an OH_NativeImage instance for content consumer.\n * This method can not be used at the same time with OH_NativeImage_UpdateSurfaceImage.\n diff --git a/graphic/graphic_2d/native_window/graphic_error_code.h b/graphic/graphic_2d/native_window/graphic_error_code.h index 1c16d7b95..fe1df86f5 100644 --- a/graphic/graphic_2d/native_window/graphic_error_code.h +++ b/graphic/graphic_2d/native_window/graphic_error_code.h @@ -52,6 +52,11 @@ extern "C" { typedef enum OHNativeErrorCode { /** @error succeed */ NATIVE_ERROR_OK = 0, + /** + * @error memory operation error + * @since 15 + */ + NATIVE_ERROR_MEM_OPERATION_ERROR = 30001000, /** @error input invalid parameter */ NATIVE_ERROR_INVALID_ARGUMENTS = 40001000, /** @error unauthorized operation */ -- Gitee