From f3396512b0945c3748d72b4308b19cbcba7844c7 Mon Sep 17 00:00:00 2001 From: xwx1135370 Date: Thu, 25 Jul 2024 09:20:57 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dpart=5Fconfig=E4=B8=AD?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=9A=84musl=20feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit issue:https://gitee.com/openharmony/third_party_musl/issues/IAF1XE?from=project-issue Test:Source code compilation Signed-off-by: xwx1135370 Signed-off-by: 陈乔异 --- third_party/musl/ndk_script/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/musl/ndk_script/BUILD.gn b/third_party/musl/ndk_script/BUILD.gn index 683b2e30d..a71e33565 100644 --- a/third_party/musl/ndk_script/BUILD.gn +++ b/third_party/musl/ndk_script/BUILD.gn @@ -208,7 +208,7 @@ group("musl_sysroot") { action("copy_ndk_uapi") { outputs = [ "${musl_target_out_dir}/${ndk_musl_include}/linux" ] script = "${musl_dir}/scripts/copy_uapi.sh" - args = [ "-i" ] + [ rebase_path("${uapi_dir}") ] + args = [ "-i" ] + [ rebase_path("${musl_uapi_dir}") ] args += [ "-o" ] + [ rebase_path("${musl_target_out_dir}/${ndk_musl_include}") ] args += [ "-t" ] + [ "${musl_arch}" ] -- Gitee From 36cfba3feaafde25735cc079f63942cf8d560d09 Mon Sep 17 00:00:00 2001 From: m30063213 Date: Wed, 31 Jul 2024 21:30:08 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=92=8C=E5=AE=9E=E7=8E=B0=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: m30063213 Signed-off-by: 陈乔异 --- network/netmanager/include/net_connection_type.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/network/netmanager/include/net_connection_type.h b/network/netmanager/include/net_connection_type.h index 1698a6593..777c0c0be 100644 --- a/network/netmanager/include/net_connection_type.h +++ b/network/netmanager/include/net_connection_type.h @@ -69,6 +69,8 @@ typedef enum NetConn_NetCap { NETCONN_NET_CAPABILITY_NOT_VPN = 15, /** Validated */ NETCONN_NET_CAPABILITY_VALIDATED = 16, + /** portal */ + NETCONN_NET_CAPABILITY_PORTAL = 17 } NetConn_NetCap; /** -- Gitee From 4a69a4aa2d65f229a7fa7916e60d79023db4e06c Mon Sep 17 00:00:00 2001 From: m30063213 Date: Thu, 1 Aug 2024 17:39:29 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=92=8C=E5=AE=9E=E7=8E=B0=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: m30063213 Signed-off-by: 陈乔异 --- network/netmanager/include/net_connection_type.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network/netmanager/include/net_connection_type.h b/network/netmanager/include/net_connection_type.h index 777c0c0be..184479315 100644 --- a/network/netmanager/include/net_connection_type.h +++ b/network/netmanager/include/net_connection_type.h @@ -69,7 +69,7 @@ typedef enum NetConn_NetCap { NETCONN_NET_CAPABILITY_NOT_VPN = 15, /** Validated */ NETCONN_NET_CAPABILITY_VALIDATED = 16, - /** portal */ + /** Portal */ NETCONN_NET_CAPABILITY_PORTAL = 17 } NetConn_NetCap; -- Gitee From 210a6b67cf0a22fbd570bfe6a1a9f6d71d08c8b5 Mon Sep 17 00:00:00 2001 From: m30063213 Date: Fri, 2 Aug 2024 11:42:27 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=92=8C=E5=AE=9E=E7=8E=B0=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: m30063213 Signed-off-by: 陈乔异 --- network/netmanager/include/net_connection_type.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/network/netmanager/include/net_connection_type.h b/network/netmanager/include/net_connection_type.h index 184479315..c2e25e2b5 100644 --- a/network/netmanager/include/net_connection_type.h +++ b/network/netmanager/include/net_connection_type.h @@ -69,7 +69,10 @@ typedef enum NetConn_NetCap { NETCONN_NET_CAPABILITY_NOT_VPN = 15, /** Validated */ NETCONN_NET_CAPABILITY_VALIDATED = 16, - /** Portal */ + /** + * portal + * @since 12 + */ NETCONN_NET_CAPABILITY_PORTAL = 17 } NetConn_NetCap; -- Gitee From eae50e595beaf8bf0dc9d39c3f3aeb95cf6074e5 Mon Sep 17 00:00:00 2001 From: m30063213 Date: Sat, 3 Aug 2024 11:29:43 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=92=8C=E5=AE=9E=E7=8E=B0=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: m30063213 Signed-off-by: 陈乔异 --- network/netmanager/include/net_connection_type.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/network/netmanager/include/net_connection_type.h b/network/netmanager/include/net_connection_type.h index c2e25e2b5..d8a70cf6d 100644 --- a/network/netmanager/include/net_connection_type.h +++ b/network/netmanager/include/net_connection_type.h @@ -70,9 +70,9 @@ typedef enum NetConn_NetCap { /** Validated */ NETCONN_NET_CAPABILITY_VALIDATED = 16, /** - * portal - * @since 12 - */ + * Portal + * @since 12 + */ NETCONN_NET_CAPABILITY_PORTAL = 17 } NetConn_NetCap; -- Gitee From b30e980f98617e7844fe7419e508f62ca7fac4fe Mon Sep 17 00:00:00 2001 From: m30063213 Date: Sat, 3 Aug 2024 17:00:54 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=92=8C=E5=AE=9E=E7=8E=B0=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: m30063213 Signed-off-by: 陈乔异 --- network/netmanager/include/net_connection_type.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/network/netmanager/include/net_connection_type.h b/network/netmanager/include/net_connection_type.h index d8a70cf6d..32a8118c8 100644 --- a/network/netmanager/include/net_connection_type.h +++ b/network/netmanager/include/net_connection_type.h @@ -70,9 +70,9 @@ typedef enum NetConn_NetCap { /** Validated */ NETCONN_NET_CAPABILITY_VALIDATED = 16, /** - * Portal - * @since 12 - */ + * Portal + * @since 12 + */ NETCONN_NET_CAPABILITY_PORTAL = 17 } NetConn_NetCap; -- Gitee From 6a215d34589a6d5ace086807246c8710e5f6271b Mon Sep 17 00:00:00 2001 From: caochuan Date: Tue, 6 Aug 2024 09:52:49 +0800 Subject: [PATCH 07/11] Add ndk API for Picture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue: https://gitee.com/openharmony/interface_sdk_c/issues/IACICD?from=project-issue Signed-off-by: caochuan Signed-off-by: 陈乔异 --- multimedia/image_effect/image_effect.h | 28 + .../image_effect/libimage_effect.ndk.json | 8 + multimedia/image_framework/BUILD.gn | 37 +- .../include/image/image_common.h | 133 +++++ .../include/image/image_packer_native.h | 34 ++ .../include/image/image_source_native.h | 85 +++ .../include/image/picture_native.h | 490 ++++++++++++++++++ .../include/image/pixelmap_native.h | 8 +- .../image_framework/libimage_common.ndk.json | 22 + .../image_framework/libimage_packer.ndk.json | 8 + .../image_framework/libimage_source.ndk.json | 20 + .../image_framework/libpicture.ndk.json | 114 ++++ 12 files changed, 979 insertions(+), 8 deletions(-) create mode 100644 multimedia/image_framework/include/image/picture_native.h create mode 100644 multimedia/image_framework/libimage_common.ndk.json create mode 100644 multimedia/image_framework/libpicture.ndk.json diff --git a/multimedia/image_effect/image_effect.h b/multimedia/image_effect/image_effect.h index 921d8a5b0..b1bb66de6 100644 --- a/multimedia/image_effect/image_effect.h +++ b/multimedia/image_effect/image_effect.h @@ -40,6 +40,7 @@ #include "image_effect_filter.h" #include "native_buffer/native_buffer.h" #include "native_window/external_window.h" +#include "multimedia/image_framework/image/picture_native.h" #ifdef __cplusplus extern "C" { @@ -315,6 +316,33 @@ ImageEffect_ErrorCode OH_ImageEffect_SetInputUri(OH_ImageEffect *imageEffect, co */ ImageEffect_ErrorCode OH_ImageEffect_SetOutputUri(OH_ImageEffect *imageEffect, const char *uri); +/** + * @brief Set input picture that contains the image information. It should be noted that the input picture will be + * directly rendered and modified if the output is not set + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @param picture Indicates the OH_PictureNative that contains the image information + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * {@link EFFECT_ERROR_PARAM_INVALID}, the input parameter is a null pointer. + * @since 12 + */ +ImageEffect_ErrorCode OH_ImageEffect_SetInputPicture(OH_ImageEffect *imageEffect, OH_PictureNative *picture); + +/** + * @brief Set output picture that contains the image information + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @param picture Indicates the OH_PictureNative that contains the image information + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * {@link EFFECT_ERROR_PARAM_INVALID}, the input parameter is a null pointer. + * @since 12 + */ +ImageEffect_ErrorCode OH_ImageEffect_SetOutputPicture(OH_ImageEffect *imageEffect, OH_PictureNative *picture); + /** * @brief Render the filter effects that can be a single filter or a chain of filters * diff --git a/multimedia/image_effect/libimage_effect.ndk.json b/multimedia/image_effect/libimage_effect.ndk.json index 6b3c6abab..99226c04a 100644 --- a/multimedia/image_effect/libimage_effect.ndk.json +++ b/multimedia/image_effect/libimage_effect.ndk.json @@ -203,6 +203,14 @@ "first_introduced": "12", "name": "OH_ImageEffect_SetOutputUri" }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_SetInputPicture" + }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_SetOutputPicture" + }, { "first_introduced": "12", "name": "OH_ImageEffect_Start" diff --git a/multimedia/image_framework/BUILD.gn b/multimedia/image_framework/BUILD.gn index be2610e97..9b5e9895a 100644 --- a/multimedia/image_framework/BUILD.gn +++ b/multimedia/image_framework/BUILD.gn @@ -44,6 +44,38 @@ ohos_ndk_headers("libpixelmap_header") { sources = [ "./include/image/pixelmap_native.h" ] } +ohos_ndk_library("libpicture") { + ndk_description_file = "./libpicture.ndk.json" + output_name = "picture" + output_extension = "so" + min_compact_version = "12" + system_capability = "SystemCapability.Multimedia.Image.Core" + system_capability_headers = [ + "multimedia/image_framework/image/picture_native.h", + "multimedia/image_framework/image/image_common.h", + ] +} + +ohos_ndk_headers("libpicture_header") { + dest_dir = "$ndk_headers_out_dir/multimedia/image_framework/image" + sources = [ "./include/image/picture_native.h" ] +} + +ohos_ndk_library("libimage_common") { + ndk_description_file = "./libimage_common.ndk.json" + output_name = "image_common" + output_extension = "so" + min_compact_version = "12" + system_capability = "SystemCapability.Multimedia.Image.Core" + system_capability_headers = + [ "multimedia/image_framework/image/image_common.h" ] +} + +ohos_ndk_headers("libimage_common_header") { + dest_dir = "$ndk_headers_out_dir/multimedia/image_framework/image" + sources = [ "./include/image/image_common.h" ] +} + ohos_ndk_library("libimage_ndk") { ndk_description_file = "./libimage_ndk.ndk.json" min_compact_version = "1" @@ -119,10 +151,7 @@ ohos_ndk_library("libohimage") { ohos_ndk_headers("ohimage_header") { dest_dir = "$ndk_headers_out_dir/multimedia/image_framework/image" - sources = [ - "./include/image/image_common.h", - "./include/image/image_native.h", - ] + sources = [ "./include/image/image_native.h" ] } ohos_ndk_library("libimage_receiver") { diff --git a/multimedia/image_framework/include/image/image_common.h b/multimedia/image_framework/include/image/image_common.h index 6e50d7764..f44cf9b9a 100644 --- a/multimedia/image_framework/include/image/image_common.h +++ b/multimedia/image_framework/include/image/image_common.h @@ -95,6 +95,20 @@ struct Image_String { size_t size = 0; }; +/** + * @brief Define a PictureMetadata struct type, used for picture metadata. + * + * @since 12 + */ +struct OH_PictureMetadata; + +/** + * @brief Define a PictureMetadata struct type, used for picture metadata. + * + * @since 12 + */ +typedef struct OH_PictureMetadata OH_PictureMetadata; + /** * @brief Defines the property string (in key-value format) of the image source. * @@ -147,6 +161,89 @@ typedef enum { IMAGE_ENCODE_FAILED = 7800301, } Image_ErrorCode; +/** + * @brief Define the metadata type. + * + * @since 12 + */ +typedef enum { + /* + * EXIF metadata. + */ + EXIF_METADATA = 1, + /* + * Fragment metadata. + */ + FRAGMENT_METADATA = 2, +} Image_MetadataType; + +/** + * @brief Creates a PictureMetadata object. + * + * @param metadataType The type of metadata. + * @param metadata The PictureMetadata pointer will be operated. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} metadata is nullptr. + * @since 12 + */ +Image_ErrorCode OH_PictureMetadata_Create(Image_MetadataType metadataType, OH_PictureMetadata **metadata); + +/** + * @brief Obtains the property of picture metadata. + * + * @param metadata The PictureMetadata pointer will be operated. + * @param key The property's key. + * @param value The property's value. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} metadata is nullptr, or key is nullptr, or value is nullptr. + * {@link IMAGE_UNSUPPORTED_METADATA} unsupported metadata type, or the metadata type does not match the + * auxiliary picture type. + * @since 12 + */ +Image_ErrorCode OH_PictureMetadata_GetProperty(OH_PictureMetadata *metadata, Image_String *key, Image_String *value); + +/** + * @brief Set picture metadata property. + * + * @param metadata The PictureMetadata pointer will be operated. + * @param key The property's key. + * @param value The property's value. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} metadata is nullptr, or key is nullptr, or value is nullptr. + * {@link IMAGE_UNSUPPORTED_METADATA} unsupported metadata type, or the metadata type does not match the + * auxiliary picture type. + * @since 12 + */ +Image_ErrorCode OH_PictureMetadata_SetProperty(OH_PictureMetadata *metadata, Image_String *key, Image_String *value); + +/** + * @brief Releases this PictureMetadata object. + * + * @param metadata The PictureMetadata pointer will be operated. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} metadata is nullptr. + * @since 12 + */ +Image_ErrorCode OH_PictureMetadata_Release(OH_PictureMetadata *metadata); + +/** + * @brief Obtains a clone of metadata. + * + * @param oldMetadata The PictureMetadata pointer will be operated. + * @param newMetadata The PictureMetadata pointer will be cloned. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} metadata is nullptr. + * {@link IMAGE_ALLOC_FAILED} memory alloc failed. + * {@link IMAGE_COPY_FAILED} memory copy failed. + * @since 12 + */ +Image_ErrorCode OH_PictureMetadata_Clone(OH_PictureMetadata *oldMetadata, OH_PictureMetadata **newMetadata); + /** * @brief Defines the bmp mime type. * @@ -1333,6 +1430,42 @@ static const char *OHOS_IMAGE_PROPERTY_WIND_SNAPSHOT_MODE = "HwMnoteWindSnapshot * @since 12 */ static const char *OHOS_IMAGE_PROPERTY_GIF_LOOP_COUNT = "GIFLoopCount"; + +/** + * @brief X in original + * It is used in {@link OH_ImageSource_GetImageProperty}. + * The top left corner of the fragment image is at the X-coordinate of the original image + * + * @since 12 + */ +static const char *OHOS_IMAGE_PROPERTY_X_IN_ORIGINAL = "XInOriginal"; + +/** + * @brief Y in original + * It is used in {@link OH_ImageSource_GetImageProperty}. + * The top left corner of the fragment image is at the Y-coordinate of the original image + * + * @since 12 + */ +static const char *OHOS_IMAGE_PROPERTY_Y_IN_ORIGINAL = "YInOriginal"; + +/** + * @brief Fragment map width + * It is used in {@link OH_ImageSource_GetImageProperty}. + * The width of the fragment image + * + * @since 12 + */ +static const char *OHOS_IMAGE_PROPERTY_FRAGMENT_WIDTH = "FragmentImageWidth"; + +/** + * @brief Fragment map height + * It is used in {@link OH_ImageSource_GetImageProperty}. + * The height of the fragment image + * + * @since 12 + */ +static const char *OHOS_IMAGE_PROPERTY_FRAGMENT_HEIGHT = "FragmentImageHeight"; #ifdef __cplusplus }; #endif diff --git a/multimedia/image_framework/include/image/image_packer_native.h b/multimedia/image_framework/include/image/image_packer_native.h index 6a5a4e9b5..bef398006 100644 --- a/multimedia/image_framework/include/image/image_packer_native.h +++ b/multimedia/image_framework/include/image/image_packer_native.h @@ -219,6 +219,24 @@ Image_ErrorCode OH_ImagePackerNative_PackToDataFromImageSource(OH_ImagePackerNat Image_ErrorCode OH_ImagePackerNative_PackToDataFromPixelmap(OH_ImagePackerNative *imagePacker, OH_PackingOptions *options, OH_PixelmapNative *pixelmap, uint8_t *outData, size_t *size); +/** + * @brief Encoding a Picture into the data with required format. + * + * @param imagePacker The imagePacker to use for packing. + * @param options Indicates the encoding {@link OH_PackingOptions}. + * @param picture The picture to be packed. + * @param outData The output data buffer to store the packed image. + * @param size A pointer to the size of the output data buffer. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} imagePacker is nullptr, or picture is nullptr, or outData is nullptr, + * or size is invalid. + * {@link IMAGE_ENCODE_FAILED} encode failed. + * @since 12 + */ +Image_ErrorCode OH_ImagePackerNative_PackToDataFromPicture(OH_ImagePackerNative *imagePacker, + OH_PackingOptions *options, OH_PictureNative *picture, uint8_t *outData, size_t *size); + /** * @brief Encoding an ImageSource into the a file with fd with required format. * @@ -245,6 +263,22 @@ Image_ErrorCode OH_ImagePackerNative_PackToFileFromImageSource(OH_ImagePackerNat Image_ErrorCode OH_ImagePackerNative_PackToFileFromPixelmap(OH_ImagePackerNative *imagePacker, OH_PackingOptions *options, OH_PixelmapNative *pixelmap, int32_t fd); +/** + * @brief Encoding a Picture into the a file with fd with required format. + * + * @param imagePacker The imagePacker to use for packing. + * @param options Indicates the encoding {@link OH_PackingOptions}. + * @param picture The picture to be packed. + * @param fd Indicates a writable file descriptor. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} imagePacker is nullptr, or picture is nullptr, or fd is invalid. + * {@link IMAGE_ENCODE_FAILED} encode failed. + * @since 12 + */ +Image_ErrorCode OH_ImagePackerNative_PackToFileFromPicture(OH_ImagePackerNative *imagePacker, + OH_PackingOptions *options, OH_PictureNative *picture, int32_t fd); + /** * @brief Releases an imagePacker object. * diff --git a/multimedia/image_framework/include/image/image_source_native.h b/multimedia/image_framework/include/image/image_source_native.h index 72cf4dae2..803fe4928 100644 --- a/multimedia/image_framework/include/image/image_source_native.h +++ b/multimedia/image_framework/include/image/image_source_native.h @@ -38,6 +38,7 @@ #include "image_common.h" #include "pixelmap_native.h" +#include "picture_native.h" #include "rawfile/raw_file.h" #ifdef __cplusplus @@ -61,6 +62,22 @@ typedef struct OH_ImageSourceNative OH_ImageSourceNative; struct OH_ImageSource_Info; typedef struct OH_ImageSource_Info OH_ImageSource_Info; +/** + * @brief Defines decoding options for picture + * {@link OH_DecodingOptionsForPicture_Create}. + * + * @since 12 + */ +struct OH_DecodingOptionsForPicture; + +/** + * @brief Defines decoding options for picture + * {@link OH_DecodingOptionsForPicture_Create}. + * + * @since 12 + */ +typedef struct OH_DecodingOptionsForPicture OH_DecodingOptionsForPicture; + /** * @brief Enumerates decoding dynamic range.. * @@ -360,6 +377,23 @@ Image_ErrorCode OH_ImageSourceNative_CreatePixelmap(OH_ImageSourceNative *source Image_ErrorCode OH_ImageSourceNative_CreatePixelmapList(OH_ImageSourceNative *source, OH_DecodingOptions *options, OH_PixelmapNative *resVecPixMap[], size_t size); +/** + * @brief Create Picture pointer from ImageSource + * based on the specified {@link OH_DecodingOptionsForPicture} struct. + * + * @param source Indicates a void pointer(from ImageSource pointer convert). + * @param options Indicates a pointer to the options for decoding the image source. + * For details, see {@link OH_DecodingOptionsForPicture}. + * @param picture Indicates a void pointer to the Picture object obtained at the C++ native layer. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} source is nullptr, or picture is nullptr. + * {@link IMAGE_DECODE_FAILED} decode failed. + * @since 12 + */ +Image_ErrorCode OH_ImageSourceNative_CreatePicture(OH_ImageSourceNative *source, OH_DecodingOptionsForPicture *options, + OH_PictureNative **picture); + /** * @brief Obtains the delay time list from some ImageSource objects (such as GIF image sources). * @@ -429,6 +463,57 @@ Image_ErrorCode OH_ImageSourceNative_GetFrameCount(OH_ImageSourceNative *source, */ Image_ErrorCode OH_ImageSourceNative_Release(OH_ImageSourceNative *source); +/** + * @brief Create a pointer for OH_DecodingOptionsForPicture struct. + * + * @param options The OH_DecodingOptionsForPicture pointer will be operated. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} options is nullptr. + * @since 12 + */ +Image_ErrorCode OH_DecodingOptionsForPicture_Create(OH_DecodingOptionsForPicture **options); + +/** + * @brief Obtains the desired auxiliary pictures of decoding options. + * + * @param options The OH_DecodingOptionsForPicture pointer will be operated. + * @param desiredAuxiliaryPictures The desired auxiliary pictures in DecodingOptionsForPicture. + * @param length The length of desired auxiliary pictures. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} options is nullptr, desiredAuxiliaryPictures is nullptr, + * or length is invalid. + * @since 12 + */ +Image_ErrorCode OH_DecodingOptionsForPicture_GetDesiredAuxiliaryPictures(OH_DecodingOptionsForPicture *options, + Image_AuxiliaryPictureType **desiredAuxiliaryPictures, size_t *length); + +/** + * @brief Set decoding options desired auxiliary pictures. + * + * @param options The OH_DecodingOptionsForPicture pointer will be operated. + * @param desiredAuxiliaryPictures The desired auxiliary pictures will be set. + * @param length The length of desired auxiliary pictures. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} options is nullptr, desiredAuxiliaryPictures is nullptr, + * or length is invalid. + * @since 12 + */ +Image_ErrorCode OH_DecodingOptionsForPicture_SetDesiredAuxiliaryPictures(OH_DecodingOptionsForPicture *options, + Image_AuxiliaryPictureType *desiredAuxiliaryPictures, size_t length); + +/** + * @brief Releases an DecodingOptionsForPicture object. + * + * @param options Indicates a DecodingOptionsForPicture pointer. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} options is nullptr. + * @since 12 + */ +Image_ErrorCode OH_DecodingOptionsForPicture_Release(OH_DecodingOptionsForPicture *options); #ifdef __cplusplus }; #endif diff --git a/multimedia/image_framework/include/image/picture_native.h b/multimedia/image_framework/include/image/picture_native.h new file mode 100644 index 000000000..36b012402 --- /dev/null +++ b/multimedia/image_framework/include/image/picture_native.h @@ -0,0 +1,490 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup image + * @{ + * + * @brief Provides APIs for obtaining picture data and information. + * + * @Syscap SystemCapability.Multimedia.Image.Core + * @since 12 + */ + +/** + * @file picture_native.h + * + * @brief Declares the APIs that can access a picture. + * + * @library libpicture.so + * @Syscap SystemCapability.Multimedia.Image.Core + * @since 12 + */ +#ifndef INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_PICTURE_NATIVE_H_ +#define INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_PICTURE_NATIVE_H_ +#include "image_common.h" +#include "pixelmap_native.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Define a Picture struct type, used for picture pointer controls. + * + * @since 12 + */ +struct OH_PictureNative; + +/** + * @brief Define a Picture struct type, used for picture pointer controls. + * + * @since 12 + */ +typedef struct OH_PictureNative OH_PictureNative; + +/** + * @brief Define a AuxiliaryPicture struct type, used for auxiliary + * picture pointer controls. + * + * @since 12 + */ +struct OH_AuxiliaryPictureNative; + +/** + * @brief Define a AuxiliaryPicture struct type, used for auxiliary + * picture pointer controls. + * + * @since 12 + */ +typedef struct OH_AuxiliaryPictureNative OH_AuxiliaryPictureNative; + +/** + * @brief Define a AuxiliaryPictureInfo struct type, used for auxiliary + * picture info controls. + * + * @since 12 + */ +struct OH_AuxiliaryPictureInfo; + +/** + * @brief Define a AuxiliaryPictureInfo struct type, used for auxiliary + * picture info controls. + * + * @since 12 + */ +typedef struct OH_AuxiliaryPictureInfo OH_AuxiliaryPictureInfo; + +/** + * @brief Define a auxiliary picture type. + * + * @since 12 + */ +typedef enum { + /* + * Gainmap + */ + AUXILIARY_PICTURE_TYPE_GAINMAP = 1, + /* + * Depth map + */ + AUXILIARY_PICTURE_TYPE_DEPTH_MAP = 2, + /* + * Unrefocus map + */ + AUXILIARY_PICTURE_TYPE_UNREFOCUS_MAP = 3, + /* + * Linear map + */ + AUXILIARY_PICTURE_TYPE_LINEAR_MAP = 4, + /* + * Fragment map + */ + AUXILIARY_PICTURE_TYPE_FRAGMENT_MAP = 5, +} Image_AuxiliaryPictureType; + +/** + * @brief Create a Picture object. + * + * @param mainPixelmap The pixel map of the main image. + * @param picture Picture pointer for created. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} mainPixelmap is nullptr, or picture is nullptr. + * @since 12 + */ +Image_ErrorCode OH_PictureNative_CreatePicture(OH_PixelmapNative *mainPixelmap, OH_PictureNative **picture); + +/** + * @brief Obtains the pixel map of the main image. + * + * @param picture The Picture pointer will be operated. + * @param mainPixelmap Main pixel map pointer for obtained. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} picture is nullptr, or mainPixelmap is nullptr. + * @since 12 + */ +Image_ErrorCode OH_PictureNative_GetMainPixelmap(OH_PictureNative *picture, OH_PixelmapNative **mainPixelmap); + +/** + * @brief Obtains the hdr pixel map. + * + * @param picture The Picture pointer will be operated. + * @param hdrPixelmap Hdr pixel map pointer for obtained. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} picture is nullptr, or hdrPixelmap is nullptr. + * {@link IMAGE_UNSUPPORTED_OPERATION} Unsupported operation, e.g. the picture does not has a gainmap + * @since 12 + */ +Image_ErrorCode OH_PictureNative_GetHdrComposedPixelmap(OH_PictureNative *picture, OH_PixelmapNative **hdrPixelmap); + +/** + * @brief Obtains the gainmap pixel map. + * + * @param picture The Picture pointer will be operated. + * @param gainmapPixelmap Gainmap pointer for obtained. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} picture is nullptr, or gainmapPixelmap is nullptr. + * @since 12 + */ +Image_ErrorCode OH_PictureNative_GetGainmapPixelmap(OH_PictureNative *picture, OH_PixelmapNative **gainmapPixelmap); + +/** + * @brief Set auxiliary picture. + * + * @param picture The Picture pointer will be operated. + * @param type The type of auxiliary picture. + * @param auxiliaryPicture AuxiliaryPicture object. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} picture is nullptr, or auxiliaryPicture is nullptr, or the type is invalid. + * @since 12 + */ +Image_ErrorCode OH_PictureNative_SetAuxiliaryPicture(OH_PictureNative *picture, Image_AuxiliaryPictureType type, + OH_AuxiliaryPictureNative *auxiliaryPicture); + +/** + * @brief Obtains the auxiliary picture based on type. + * + * @param picture The Picture pointer will be operated. + * @param type The type of auxiliary picture. + * @param auxiliaryPicture AuxiliaryPicture pointer for obtained. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} picture is nullptr, or auxiliaryPicture is nullptr, or the type is invalid. + * @since 12 + */ +Image_ErrorCode OH_PictureNative_GetAuxiliaryPicture(OH_PictureNative *picture, Image_AuxiliaryPictureType type, + OH_AuxiliaryPictureNative **auxiliaryPicture); + +/** + * @brief Obtains the metadata of main picture. + * + * @param picture The Picture pointer will be operated. + * @param metadataType The type of metadata. + * @param metadata The metadata of main picture. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} picture is nullptr, or metadata is nullptr. + * {@link IMAGE_UNSUPPORTED_METADATA} unsupported metadata type. + * @since 12 + */ +Image_ErrorCode OH_PictureNative_GetMetadata(OH_PictureNative *picture, Image_MetadataType metadataType, + OH_PictureMetadata **metadata); + +/** + * @brief Set main picture metadata. + * + * @param picture The Picture pointer will be operated. + * @param metadataType The type of metadata. + * @param metadata The metadata will be set. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} picture is nullptr, or metadata is nullptr. + * {@link IMAGE_UNSUPPORTED_METADATA} unsupported metadata type. + * @since 12 + */ +Image_ErrorCode OH_PictureNative_SetMetadata(OH_PictureNative *picture, Image_MetadataType metadataType, + OH_PictureMetadata *metadata); + +/** + * @brief Releases this Picture object. + * + * @param picture The Picture pointer will be operated. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} picture is nullptr. + * @since 12 + */ +Image_ErrorCode OH_PictureNative_Release(OH_PictureNative *picture); + +/** + * @brief Create a AuxiliaryPicture object. + * + * @param data The image data buffer. + * @param dataLength The length of data. + * @param size The size of auxiliary picture. + * @param type The type of auxiliary picture. + * @param auxiliaryPicture AuxiliaryPicture pointer for created. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} data is nullptr, or dataLength is invalid, or size is nullptr, or the type + * is invalid, or auxiliaryPicture is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureNative_Create(uint8_t *data, size_t dataLength, Image_Size *size, + Image_AuxiliaryPictureType type, OH_AuxiliaryPictureNative **auxiliaryPicture); + +/** + * @brief Write pixels to auxiliary picture. + * + * @param auxiliaryPicture The AuxiliaryPicture pointer will be operated. + * @param source The pixels will be written. + * @param bufferSize The size of pixels. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} auxiliaryPicture is nullptr, or source is nullptr, or the bufferSize is invalid. + * {@link IMAGE_ALLOC_FAILED} memory alloc failed. + * {@link IMAGE_COPY_FAILED} memory copy failed. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureNative_WritePixels(OH_AuxiliaryPictureNative *auxiliaryPicture, uint8_t *source, + size_t bufferSize); + +/** + * @brief Read pixels from auxiliary picture. + * + * @param auxiliaryPicture The AuxiliaryPicture pointer will be operated. + * @param destination The pixels will be read. + * @param bufferSize The size of pixels for reading. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} auxiliaryPicture is nullptr, or destination is nullptr, + * or the bufferSize is invalid. + * {@link IMAGE_ALLOC_FAILED} memory alloc failed. + * {@link IMAGE_COPY_FAILED} memory copy failed. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureNative_ReadPixels(OH_AuxiliaryPictureNative *auxiliaryPicture, uint8_t *destination, + size_t *bufferSize); + +/** + * @brief Obtains the type of auxiliary picture. + * + * @param auxiliaryPicture The AuxiliaryPicture pointer will be operated. + * @param type The type of auxiliary picture. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} auxiliaryPicture is nullptr, or type is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureNative_GetType(OH_AuxiliaryPictureNative *auxiliaryPicture, + Image_AuxiliaryPictureType *type); + +/** + * @brief Obtains the info of auxiliary picture. + * + * @param auxiliaryPicture The AuxiliaryPicture pointer will be operated. + * @param info The info of auxiliary picture. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} auxiliaryPicture is nullptr, or info is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureNative_GetInfo(OH_AuxiliaryPictureNative *auxiliaryPicture, + OH_AuxiliaryPictureInfo **info); + +/** + * @brief Set auxiliary picture info. + * + * @param auxiliaryPicture The AuxiliaryPicture pointer will be operated. + * @param info The info will be set. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} auxiliaryPicture is nullptr, or info is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureNative_SetInfo(OH_AuxiliaryPictureNative *auxiliaryPicture, + OH_AuxiliaryPictureInfo *info); + +/** + * @brief Obtains the metadata of auxiliary picture. + * + * @param auxiliaryPicture The AuxiliaryPicture pointer will be operated. + * @param metadataType The type of metadata. + * @param metadata The metadata of auxiliary picture. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} auxiliaryPicture is nullptr, or metadata is nullptr. + * {@link IMAGE_UNSUPPORTED_METADATA} unsupported metadata type, or the metadata type does not match the + * auxiliary picture type. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureNative_GetMetadata(OH_AuxiliaryPictureNative *auxiliaryPicture, + Image_MetadataType metadataType, OH_PictureMetadata **metadata); + +/** + * @brief Set auxiliary picture metadata. + * + * @param auxiliaryPicture The AuxiliaryPicture pointer will be operated. + * @param metadataType The type of metadata. + * @param metadata The metadata will be set. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} auxiliaryPicture is nullptr, or metadata is nullptr. + * {@link IMAGE_UNSUPPORTED_METADATA} unsupported metadata type, or the metadata type does not match the + * auxiliary picture type. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureNative_SetMetadata(OH_AuxiliaryPictureNative *auxiliaryPicture, + Image_MetadataType metadataType, OH_PictureMetadata *metadata); + +/** + * @brief Releases this AuxiliaryPicture object. + * + * @param picture The Picture pointer will be operated. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} picture is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureNative_Release(OH_AuxiliaryPictureNative *picture); + +/** + * @brief Create a AuxiliaryPictureInfo object. + * + * @param info The AuxiliaryPictureInfo pointer will be operated. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} info is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureInfo_Create(OH_AuxiliaryPictureInfo **info); + +/** + * @brief Obtains the type of auxiliary picture info. + * + * @param info The AuxiliaryPictureInfo pointer will be operated. + * @param type The type of auxiliary picture info. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} info is nullptr, or type is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureInfo_GetType(OH_AuxiliaryPictureInfo *info, Image_AuxiliaryPictureType *type); + +/** + * @brief Set auxiliary picture info type. + * + * @param info The AuxiliaryPictureInfo pointer will be operated. + * @param type The type will be set. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} info is nullptr, or type is invalid. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureInfo_SetType(OH_AuxiliaryPictureInfo *info, Image_AuxiliaryPictureType type); + +/** + * @brief Obtains the size of auxiliary picture info. + * + * @param info The AuxiliaryPictureInfo pointer will be operated. + * @param size The size of auxiliary picture info. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} info is nullptr, or size is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureInfo_GetSize(OH_AuxiliaryPictureInfo *info, Image_Size *size); + +/** + * @brief Set auxiliary picture info size. + * + * @param info The AuxiliaryPictureInfo pointer will be operated. + * @param size The size will be set. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} info is nullptr, or size is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureInfo_SetSize(OH_AuxiliaryPictureInfo *info, Image_Size *size); + +/** + * @brief Obtains the rowStride of auxiliary picture info. + * + * @param info The AuxiliaryPictureInfo pointer will be operated. + * @param rowStride The rowStride of auxiliary picture info. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} info is nullptr, or rowStride is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureInfo_GetRowStride(OH_AuxiliaryPictureInfo *info, uint32_t *rowStride); + +/** + * @brief Set auxiliary picture info rowStride. + * + * @param info The AuxiliaryPictureInfo pointer will be operated. + * @param rowStride The rowStride will be set. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} info is nullptr, or rowStride is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureInfo_SetRowStride(OH_AuxiliaryPictureInfo *info, uint32_t rowStride); + +/** + * @brief Obtains the pixelFormat of auxiliary picture info. + * + * @param info The AuxiliaryPictureInfo pointer will be operated. + * @param pixelFormat The pixelFormat will be get. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} info is nullptr, or pixelFormat is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureInfo_GetPixelFormat(OH_AuxiliaryPictureInfo *info, PIXEL_FORMAT *pixelFormat); + +/** + * @brief Set auxiliary picture info pixelFormat. + * + * @param info The AuxiliaryPictureInfo pointer will be operated. + * @param pixelFormat The pixelFormat will be set. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} info is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureInfo_SetPixelFormat(OH_AuxiliaryPictureInfo *info, PIXEL_FORMAT pixelFormat); + +/** + * @brief Releases this AuxiliaryPictureInfo object. + * + * @param info The AuxiliaryPictureInfo pointer will be operated. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} info is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureInfo_Release(OH_AuxiliaryPictureInfo *info); + +#ifdef __cplusplus +}; +#endif +/** @} */ +#endif //INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_PICTURE_NATIVE_H_ \ No newline at end of file diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index 5f8be7c78..875bafe5b 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -171,19 +171,19 @@ typedef enum { /** * No metadata. */ - NONE = 0, + HDR_METADATA_TYPE_NONE = 0, /** * Indicates that metadata will be used for the base image. */ - BASE = 1, + HDR_METADATA_TYPE_BASE = 1, /** * Indicates that metadata will be used for the gainmap image. */ - GAINMAP = 2, + HDR_METADATA_TYPE_GAINMAP = 2, /** * Indicates that metadata will be used for the alternate image. */ - ALTERNATE = 3, + HDR_METADATA_TYPE_ALTERNATE = 3, } OH_Pixelmap_HdrMetadataType; /** diff --git a/multimedia/image_framework/libimage_common.ndk.json b/multimedia/image_framework/libimage_common.ndk.json new file mode 100644 index 000000000..9faa63b59 --- /dev/null +++ b/multimedia/image_framework/libimage_common.ndk.json @@ -0,0 +1,22 @@ +[ + { + "first_introduced": "12", + "name": "OH_PictureMetadata_Create" + }, + { + "first_introduced": "12", + "name": "OH_PictureMetadata_GetProperty" + }, + { + "first_introduced": "12", + "name": "OH_PictureMetadata_SetProperty" + }, + { + "first_introduced": "12", + "name": "OH_PictureMetadata_Release" + }, + { + "first_introduced": "12", + "name": "OH_PictureMetadata_Clone" + } +] \ No newline at end of file diff --git a/multimedia/image_framework/libimage_packer.ndk.json b/multimedia/image_framework/libimage_packer.ndk.json index 0b5efcecf..3488cb646 100644 --- a/multimedia/image_framework/libimage_packer.ndk.json +++ b/multimedia/image_framework/libimage_packer.ndk.json @@ -51,6 +51,10 @@ "first_introduced": "12", "name": "OH_ImagePackerNative_PackToDataFromPixelmap" }, + { + "first_introduced": "12", + "name": "OH_ImagePackerNative_PackToDataFromPicture" + }, { "first_introduced": "12", "name": "OH_ImagePackerNative_PackToFileFromImageSource" @@ -59,6 +63,10 @@ "first_introduced": "12", "name": "OH_ImagePackerNative_PackToFileFromPixelmap" }, + { + "first_introduced": "12", + "name": "OH_ImagePackerNative_PackToFileFromPicture" + }, { "first_introduced": "12", "name": "OH_ImagePackerNative_Release" diff --git a/multimedia/image_framework/libimage_source.ndk.json b/multimedia/image_framework/libimage_source.ndk.json index 562ec53ca..133bba8ec 100644 --- a/multimedia/image_framework/libimage_source.ndk.json +++ b/multimedia/image_framework/libimage_source.ndk.json @@ -99,6 +99,10 @@ "first_introduced": "12", "name": "OH_ImageSourceNative_CreatePixelmapList" }, + { + "first_introduced": "12", + "name": "OH_ImageSourceNative_CreatePicture" + }, { "first_introduced": "12", "name": "OH_ImageSourceNative_GetDelayTimeList" @@ -122,5 +126,21 @@ { "first_introduced": "12", "name": "OH_ImageSourceNative_Release" + }, + { + "first_introduced": "12", + "name": "OH_DecodingOptionsForPicture_Create" + }, + { + "first_introduced": "12", + "name": "OH_DecodingOptionsForPicture_GetDesiredAuxiliaryPictures" + }, + { + "first_introduced": "12", + "name": "OH_DecodingOptionsForPicture_SetDesiredAuxiliaryPictures" + }, + { + "first_introduced": "12", + "name": "OH_DecodingOptionsForPicture_Release" } ] \ No newline at end of file diff --git a/multimedia/image_framework/libpicture.ndk.json b/multimedia/image_framework/libpicture.ndk.json new file mode 100644 index 000000000..d74f9c0f2 --- /dev/null +++ b/multimedia/image_framework/libpicture.ndk.json @@ -0,0 +1,114 @@ +[ + { + "first_introduced": "12", + "name": "OH_PictureNative_CreatePicture" + }, + { + "first_introduced": "12", + "name": "OH_PictureNative_GetMainPixelmap" + }, + { + "first_introduced": "12", + "name": "OH_PictureNative_GetHdrComposedPixelmap" + }, + { + "first_introduced": "12", + "name": "OH_PictureNative_GetGainmapPixelmap" + }, + { + "first_introduced": "12", + "name": "OH_PictureNative_SetAuxiliaryPicture" + }, + { + "first_introduced": "12", + "name": "OH_PictureNative_GetAuxiliaryPicture" + }, + { + "first_introduced": "12", + "name": "OH_PictureNative_GetMetadata" + }, + { + "first_introduced": "12", + "name": "OH_PictureNative_SetMetadata" + }, + { + "first_introduced": "12", + "name": "OH_PictureNative_Release" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureNative_Create" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureNative_WritePixels" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureNative_ReadPixels" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureNative_GetType" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureNative_GetInfo" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureNative_SetInfo" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureNative_GetMetadata" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureNative_SetMetadata" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureNative_Release" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureInfo_Create" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureInfo_GetType" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureInfo_SetType" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureInfo_GetSize" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureInfo_SetSize" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureInfo_GetRowStride" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureInfo_SetRowStride" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureInfo_GetPixelFormat" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureInfo_SetPixelFormat" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureInfo_Release" + } + ] \ No newline at end of file -- Gitee From 65751bdc988c913fd5f747dc1087af6037b25d86 Mon Sep 17 00:00:00 2001 From: duanhan Date: Wed, 7 Aug 2024 10:46:06 +0800 Subject: [PATCH 08/11] libpixelmap json fix Signed-off-by: duanhan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈乔异 --- multimedia/image_framework/libpixelmap.ndk.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/image_framework/libpixelmap.ndk.json b/multimedia/image_framework/libpixelmap.ndk.json index f06f6b186..5a1af8e20 100644 --- a/multimedia/image_framework/libpixelmap.ndk.json +++ b/multimedia/image_framework/libpixelmap.ndk.json @@ -149,10 +149,10 @@ }, { "first_introduced": "12", - "name": "OH_PixelmapNative_ConvertPixelmapToNapi" + "name": "OH_PixelmapNative_ConvertPixelmapNativeToNapi" }, { "first_introduced": "12", - "name": "OH_PixelmapNative_ConvertPixelmapFromNapi" + "name": "OH_PixelmapNative_ConvertPixelmapNativeFromNapi" } ] \ No newline at end of file -- Gitee From faf790acc9b3bc9ca070f05484ba3fa90243a953 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 7 Aug 2024 14:27:19 +0800 Subject: [PATCH 09/11] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dhitrace.h=20NDK?= =?UTF-8?q?=E8=AF=AD=E6=B3=95=E9=94=99=E8=AF=AF=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: root Signed-off-by: 陈乔异 --- hiviewdfx/hitrace/include/hitrace/trace.h | 1 + 1 file changed, 1 insertion(+) diff --git a/hiviewdfx/hitrace/include/hitrace/trace.h b/hiviewdfx/hitrace/include/hitrace/trace.h index 9142b2637..e771136da 100644 --- a/hiviewdfx/hitrace/include/hitrace/trace.h +++ b/hiviewdfx/hitrace/include/hitrace/trace.h @@ -65,6 +65,7 @@ * @since 10 */ #include +#include #ifdef __cplusplus extern "C" { -- Gitee From b6e4e294fbfa61e226d93e6b6a44ff3a0635207f Mon Sep 17 00:00:00 2001 From: liyang Date: Wed, 7 Aug 2024 16:42:45 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=B1=81=E5=85=8D?= =?UTF-8?q?=E9=9A=90=E7=A7=81=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liyang Signed-off-by: 陈乔异 --- .../player_framework/native_avscreen_capture.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/multimedia/player_framework/native_avscreen_capture.h b/multimedia/player_framework/native_avscreen_capture.h index 1264f7882..d30838a29 100644 --- a/multimedia/player_framework/native_avscreen_capture.h +++ b/multimedia/player_framework/native_avscreen_capture.h @@ -398,6 +398,23 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_ContentFilter_AddWindowContent( */ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_ResizeCanvas(struct OH_AVScreenCapture *capture, int32_t width, int32_t height); + +/** + * @brief skip some windows' privacy mode of current app during the screen recording + * @syscap SystemCapability.Multimedia.Media.AVScreenCapture + * @param capture Pointer to an OH_AVScreenCapture instance + * @param Pointer to windowID list + * @param length of windowID list + * @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 input windowIDs are not belong current + * app. + * {@link AV_SCREEN_CAPTURE_ERR_OPERATE_NOT_PERMIT} opertation not be permitted. + * @since 12 + * @version 1.0 + */ +OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_SkipPrivacyMode(struct OH_AVScreenCapture *capture, + int32_t *windowIDs, int32_t windowCount); #ifdef __cplusplus } #endif -- Gitee From bf129e83bd1799343843cfaa24bb71829cd96471 Mon Sep 17 00:00:00 2001 From: liyang Date: Wed, 7 Aug 2024 16:45:30 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=B1=81=E5=85=8D?= =?UTF-8?q?=E9=9A=90=E7=A7=81=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liyang Signed-off-by: 陈乔异 --- multimedia/player_framework/native_avscreen_capture.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/player_framework/native_avscreen_capture.h b/multimedia/player_framework/native_avscreen_capture.h index d30838a29..e993b8ef2 100644 --- a/multimedia/player_framework/native_avscreen_capture.h +++ b/multimedia/player_framework/native_avscreen_capture.h @@ -403,7 +403,7 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_ResizeCanvas(struct OH_AVScreenCa * @brief skip some windows' privacy mode of current app during the screen recording * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @param capture Pointer to an OH_AVScreenCapture instance - * @param Pointer to windowID list + * @param Pointer of windowID list * @param length of windowID list * @return Function result code. * {@link AV_SCREEN_CAPTURE_ERR_OK} if the execution is successful. -- Gitee