diff --git a/multimedia/image_framework/include/image_pixel_map_mdk.h b/multimedia/image_framework/include/image_pixel_map_mdk.h
index b5cf58c3a993432a666fd1cab7b7126e44b73723..327054732f9813cd6da5bf22d1e95c890e7642b2 100644
--- a/multimedia/image_framework/include/image_pixel_map_mdk.h
+++ b/multimedia/image_framework/include/image_pixel_map_mdk.h
@@ -547,6 +547,22 @@ int32_t OH_PixelMap_Crop(const NativePixelMap* native, int32_t x, int32_t y, int
*/
int32_t OH_PixelMap_GetImageInfo(const NativePixelMap* native, OhosPixelMapInfos *info);
+/**
+ * @brief Obtains the image encodedformat of a PixelMap object.
+ *
+ * @param native Indicates the pointer to a NativePixelMap object.
+ * @param format Indicates a pointer to the string of image encodedformat obtained.
+ * @return Returns {@link IRNdkErrCode} IMAGE_RESULT_SUCCESS - if the operation is successful.
+ * returns {@link IRNdkErrCode} IMAGE_RESULT_BAD_PARAMETER - if bad parameter.
+ * returns {@link IRNdkErrCode} IMAGE_RESULT_JNI_ENV_ABNORMAL - if Abnormal JNI environment.
+ * returns {@link IRNdkErrCode} IMAGE_RESULT_INVALID_PARAMETER - if invalid parameter.
+ * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_FAILED - if decode fail.
+ * returns {@link IRNdkErrCode} IMAGE_RESULT_CHECK_FORMAT_ERROR - if decode fail.
+ * @since 12
+ * @version 5.0
+ */
+int32_t OH_PixelMap_GetEncodedFormat(const NativePixelMap* native, char* format);
+
/**
* @brief Obtains the memory address of a NativePixelMap object and locks the memory.
*
diff --git a/multimedia/image_framework/include/image_source_mdk.h b/multimedia/image_framework/include/image_source_mdk.h
index 437e4816ac99f7eaab7d49eb170da10e0fd88a51..111e8d21da59de929a1bd1ca732f1049e3fc8c5d 100644
--- a/multimedia/image_framework/include/image_source_mdk.h
+++ b/multimedia/image_framework/include/image_source_mdk.h
@@ -814,6 +814,25 @@ int32_t OH_ImageSource_GetFrameCount(const ImageSourceNative* native, uint32_t *
int32_t OH_ImageSource_GetImageInfo(const ImageSourceNative* native, int32_t index,
struct OhosImageSourceInfo* info);
+/**
+ * @brief Obtains the encodedformat of image from an ImageSource object.
+ *
+ * @param native Indicates a pointer to the {@link ImageSourceNative} object at the C++ native layer.
+ * @param format Indicates a pointer to the string of image encodedformat obtained.
+ * @return Returns {@link IRNdkErrCode} IMAGE_RESULT_SUCCESS - if the operation is successful.
+ * returns {@link IRNdkErrCode} IMAGE_RESULT_BAD_PARAMETER - if bad parameter.
+ * returns {@link IRNdkErrCode} IMAGE_RESULT_JNI_ENV_ABNORMAL - if Abnormal JNI environment.
+ * returns {@link IRNdkErrCode} IMAGE_RESULT_INVALID_PARAMETER - if invalid parameter.
+ * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_FAILED - if decode fail.
+ * returns {@link IRNdkErrCode} IMAGE_RESULT_CHECK_FORMAT_ERROR - if decode fail.
+ * @see {@link ImageSourceNative}
+ *
+ * @Syscap SystemCapability.Multimedia.Image
+ * @since 12
+ * @version 5.0
+ */
+int32_t OH_ImageSource_GetEncodedFormat(const ImageSourceNative* native, char* format);
+
/**
* @brief Obtains the value of an image property from an ImageSource object.
*
diff --git a/multimedia/image_framework/libimage_pixelmap_napi.ndk.json b/multimedia/image_framework/libimage_pixelmap_napi.ndk.json
index 64800fe826282f2c62c68ee354f432af18ea4fed..77e631c992abbc0764a8d82423e51d467c39a808 100644
--- a/multimedia/image_framework/libimage_pixelmap_napi.ndk.json
+++ b/multimedia/image_framework/libimage_pixelmap_napi.ndk.json
@@ -62,5 +62,9 @@
},
{
"name": "OH_PixelMap_UnAccessPixels"
+ },
+ {
+ "first_introduced": "12",
+ "name": "OH_PixelMap_GetEncodedFormat"
}
]
\ No newline at end of file
diff --git a/multimedia/image_framework/libimage_source_ndk.ndk.json b/multimedia/image_framework/libimage_source_ndk.ndk.json
index 04f0e233129039a238f98e9c7aa82330da71b4f7..af6c358e51bbd49f329f06b5b4cc617187c9ad7d 100644
--- a/multimedia/image_framework/libimage_source_ndk.ndk.json
+++ b/multimedia/image_framework/libimage_source_ndk.ndk.json
@@ -58,5 +58,9 @@
{
"first_introduced": "11",
"name": "OH_ImageSource_CreateIncrementalFromData"
+ },
+ {
+ "first_introduced": "12",
+ "name": "OH_ImageSource_GetEncodedFormat"
}
]
\ No newline at end of file