diff --git a/multimedia/image_framework/include/image/image_common.h b/multimedia/image_framework/include/image/image_common.h index 753fddaeba45809fb3796b67982f2193c46bab0a..6917057d2046268090d54ecd413d21e600ec9cf7 100644 --- a/multimedia/image_framework/include/image/image_common.h +++ b/multimedia/image_framework/include/image/image_common.h @@ -170,6 +170,11 @@ typedef enum { * @since 13 */ IMAGE_UNSUPPORTED_MEMORY_FORMAT = 7600205, + /** + * @error Invalid parameter. + * @since 19 + */ + IMAGE_INVALID_PARAMETER = 7600206, /** failed to allocate memory */ IMAGE_ALLOC_FAILED = 7600301, /** memory copy failed */ @@ -215,6 +220,11 @@ typedef enum { * @since 15 */ IMAGE_SOURCE_ALLOC_FAILED = 7700302, + /** + * @error Invalid parameter for ImagePacker. + * @since 19 + */ + IMAGE_PACKER_INVALID_PARAMETER = 7800202, /** encode failed */ IMAGE_ENCODE_FAILED = 7800301, } Image_ErrorCode; @@ -277,6 +287,21 @@ Image_ErrorCode OH_PictureMetadata_GetProperty(OH_PictureMetadata *metadata, Ima */ Image_ErrorCode OH_PictureMetadata_SetProperty(OH_PictureMetadata *metadata, Image_String *key, Image_String *value); +/** + * @brief Obtains the property of picture metadata. The output value.data is null-terminated. + * + * @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_INVALID_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 19 + */ +Image_ErrorCode OH_PictureMetadata_GetPropertyWithNull(OH_PictureMetadata *metadata, Image_String *key, Image_String *value); + /** * @brief Releases this PictureMetadata object. * diff --git a/multimedia/image_framework/include/image/image_packer_native.h b/multimedia/image_framework/include/image/image_packer_native.h index 0a1498f3ac1ca8f4dbdfb18190d9d0293ff63064..6020ea9ccea86798472d023cbe3b052520e48487 100644 --- a/multimedia/image_framework/include/image/image_packer_native.h +++ b/multimedia/image_framework/include/image/image_packer_native.h @@ -110,6 +110,19 @@ Image_ErrorCode OH_PackingOptions_Create(OH_PackingOptions **options); Image_ErrorCode OH_PackingOptions_GetMimeType(OH_PackingOptions *options, Image_MimeType *format); +/** + * @brief Gets MIME type from OH_PackingOptions. The output format.data is null-terminated. + * + * @param options The OH_PackingOptions pointer will be operated. + * @param format MimeType set in the OH_PackingOptions. + * @return Returns functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_PACKER_INVALID_PARAMETER} if options or format is nullptr. + * @since 19 + */ +Image_ErrorCode OH_PackingOptions_GetMimeTypeWithNull(OH_PackingOptions *options, + Image_MimeType *format); + /** * @brief Set format number for OH_PackingOptions struct. * diff --git a/multimedia/image_framework/include/image/image_source_native.h b/multimedia/image_framework/include/image/image_source_native.h index 43000f092642d374b6691ebc83e47a952ef5f53f..66e83042b94f9b6dfb577cce2c9455bca9e5ab19 100644 --- a/multimedia/image_framework/include/image/image_source_native.h +++ b/multimedia/image_framework/include/image/image_source_native.h @@ -552,6 +552,20 @@ Image_ErrorCode OH_ImageSourceNative_GetImageInfo(OH_ImageSourceNative *source, Image_ErrorCode OH_ImageSourceNative_GetImageProperty(OH_ImageSourceNative *source, Image_String *key, Image_String *value); +/** + * @brief Obtains the value of an image property from an ImageSource object. The output value.data is null-terminated. + * + * @param source Pointer to ImageSource. + * @param key Pointer to the property key. + * @param value Pointer to the property value. Output Parameter. + * @return Returns One of the following result codes: + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_SOURCE_INVALID_PARAMETER} if source, key or value is nullptr. + * @since 19 + */ +Image_ErrorCode OH_ImageSourceNative_GetImagePropertyWithNull(OH_ImageSourceNative *source, Image_String *key, + Image_String *value); + /** * @brief Modifies the value of an image property of an ImageSource object. * @param source Indicates a void pointer(from ImageSource pointer convert). diff --git a/multimedia/image_framework/libimage_common.ndk.json b/multimedia/image_framework/libimage_common.ndk.json index 63d2820cc1fb4da91e3e0f1b9efea3415c20312b..2a242c3eb098bd704d8929cb7a762adb766b42e0 100644 --- a/multimedia/image_framework/libimage_common.ndk.json +++ b/multimedia/image_framework/libimage_common.ndk.json @@ -11,6 +11,10 @@ "first_introduced": "13", "name": "OH_PictureMetadata_SetProperty" }, + { + "first_introduced": "19", + "name": "OH_PictureMetadata_GetPropertyWithNull" + }, { "first_introduced": "13", "name": "OH_PictureMetadata_Release" diff --git a/multimedia/image_framework/libimage_packer.ndk.json b/multimedia/image_framework/libimage_packer.ndk.json index 5684b6584c97749e90b4408202c1b0662c81f5b4..ea2143d7ccec983a882b01e21072723bcbae656c 100644 --- a/multimedia/image_framework/libimage_packer.ndk.json +++ b/multimedia/image_framework/libimage_packer.ndk.json @@ -7,6 +7,10 @@ "first_introduced": "12", "name": "OH_PackingOptions_GetMimeType" }, + { + "first_introduced": "19", + "name": "OH_PackingOptions_GetMimeTypeWithNull" + }, { "first_introduced": "12", "name": "OH_PackingOptions_SetMimeType" diff --git a/multimedia/image_framework/libimage_source.ndk.json b/multimedia/image_framework/libimage_source.ndk.json index 104bb376a28f2b6593fb091819268a0dbaf79520..877bae5741ec1a1d666bd2abf1d7293180a057b3 100644 --- a/multimedia/image_framework/libimage_source.ndk.json +++ b/multimedia/image_framework/libimage_source.ndk.json @@ -135,6 +135,10 @@ "first_introduced": "12", "name": "OH_ImageSourceNative_GetImageProperty" }, + { + "first_introduced": "19", + "name": "OH_ImageSourceNative_GetImagePropertyWithNull" + }, { "first_introduced": "12", "name": "OH_ImageSourceNative_ModifyImageProperty"