From 7b4ee1abef2c8151d1f39708cc7cafc8ce59849c Mon Sep 17 00:00:00 2001 From: yaozhupeng Date: Sat, 14 Sep 2024 23:34:16 +0800 Subject: [PATCH] add pixelmap dfx interface Signed-off-by: yaozhupeng --- .../image_framework/include/image/image_common.h | 5 +++++ .../include/image/pixelmap_native.h | 15 +++++++++++++++ multimedia/image_framework/libpixelmap.ndk.json | 4 ++++ 3 files changed, 24 insertions(+) diff --git a/multimedia/image_framework/include/image/image_common.h b/multimedia/image_framework/include/image/image_common.h index ecd7ae93a..fac9bcf4a 100644 --- a/multimedia/image_framework/include/image/image_common.h +++ b/multimedia/image_framework/include/image/image_common.h @@ -151,6 +151,11 @@ typedef enum { IMAGE_UNSUPPORTED_CONVERSION = 7600203, /** invalid region */ IMAGE_INVALID_REGION = 7600204, + /** + * @error unsupported memory format + * @since 13 + */ + IMAGE_UNSUPPORTED_MEMORY_FORMAT = 7600205, /** failed to allocate memory */ IMAGE_ALLOC_FAILED = 7600301, /** memory copy failed */ diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index 0e5956cfe..9b7a2390b 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -834,6 +834,21 @@ Image_ErrorCode OH_PixelmapNative_SetMetadata(OH_PixelmapNative *pixelmap, OH_Pi */ Image_ErrorCode OH_PixelmapNative_GetNativeBuffer(OH_PixelmapNative *pixelmap, OH_NativeBuffer **nativeBuffer); +/** + * @brief Set pixelmap memory name. + * + * @param pixelmap The Pixelmap pointer to be operated. + * @param name The pointer of name that needs to be set. + * @param size The size of name size that needs to be set. + * @return Function result code: + * {@link IMAGE_SUCCESS} If the operation is successful. + * {@link IMAGE_BAD_PARAMETER} If invalid parameter, name and size are incorrect. + * {@link IMAGE_UNSUPPORTED_MEMORY_FORMAT} If memory format is unsupported. + * @see OH_PixelmapNative + * @since 13 + */ +Image_ErrorCode OH_PixelmapNative_SetMemoryName(OH_PixelmapNative *pixelmap, char *name, size_t *size); + #ifdef __cplusplus }; #endif diff --git a/multimedia/image_framework/libpixelmap.ndk.json b/multimedia/image_framework/libpixelmap.ndk.json index 78c1a0235..add12ebb4 100644 --- a/multimedia/image_framework/libpixelmap.ndk.json +++ b/multimedia/image_framework/libpixelmap.ndk.json @@ -166,5 +166,9 @@ { "first_introduced": "12", "name": "OH_PixelmapNative_ConvertPixelmapNativeFromNapi" + }, + { + "first_introduced": "13", + "name": "OH_PixelmapNative_SetMemoryName" } ] \ No newline at end of file -- Gitee