diff --git a/multimedia/image_framework/include/image_packer_mdk.h b/multimedia/image_framework/include/image_packer_mdk.h index 0a49718d78ff8d120b607bd88d163d3a2a807132..e6a0677ccfc155fb3356e45daad979340afc183e 100644 --- a/multimedia/image_framework/include/image_packer_mdk.h +++ b/multimedia/image_framework/include/image_packer_mdk.h @@ -157,6 +157,29 @@ int32_t OH_ImagePacker_PackToData(ImagePacker_Native* native, napi_value source, int32_t OH_ImagePacker_PackToFile(ImagePacker_Native* native, napi_value source, ImagePacker_Opts* opts, int fd); +/** + * @brief Encoding a PixelMap list into the a file with fd with required format + * + * @param native Indicates the pointer to an {@link ImagePacker} object at the native layer. + * @param source Indicates an encoding source, a JS pixel map object. + * @param opts Indicates the encoding {@link ImagePacker_Opts} . + * @param fd Indicates the a writable file descriptor. + * @param loop Indicates the number of times the loop should. + * @param delayTimes Indicates the delay time for each frame of the dynamic image. + * @param size Indicates the pointer to the {@link delayTimes} object obtained. + * @return Returns {@link IRNdkErrCode} IMAGE_RESULT_SUCCESS - if the operation is successful. + * returns {@link IRNdkErrCode} IMAGE_RESULT_INVALID_PARAMETER - if invalid parameter. + * returns {@link IRNdkErrCode} ERR_IMAGE_DATA_ABNORMAL - if output target abnormal + * returns {@link IRNdkErrCode} ERR_IMAGE_MISMATCHED_FORMAT - if format mismatched + * returns {@link IRNdkErrCode} ERR_IMAGE_MALLOC_ABNORMAL - if malloc internal buffer error + * returns {@link IRNdkErrCode} ERR_IMAGE_DECODE_ABNORMAL - if init codec internal error + * returns {@link IRNdkErrCode} ERR_IMAGE_ENCODE_FAILED - if encoder occur error during encoding + * @see {@link OH_ImagePacker_PackToFileMultiFrames} + * @since 12 + * @version 5.0 + */ +int32_t OH_ImagePacker_PackToFileMultiFrames(ImagePacker_Native* native, napi_value source, + ImagePacker_Opts* opts, int fd, uint16_t loop, uint16_t* delayTimes, int size); /** * @brief Releases an {@link ImagePacker_Native} object at the native layer. diff --git a/multimedia/image_framework/libimage_packer_ndk.ndk.json b/multimedia/image_framework/libimage_packer_ndk.ndk.json index 6a4b55b61e16e8ca8cb0ed9332e42179d242fdf4..48147c20e0ad2ddb4fba772456a7252b19c4eccf 100644 --- a/multimedia/image_framework/libimage_packer_ndk.ndk.json +++ b/multimedia/image_framework/libimage_packer_ndk.ndk.json @@ -18,5 +18,9 @@ { "first_introduced": "11", "name": "OH_ImagePacker_Release" + }, + { + "first_introduced": "12", + "name": "OH_ImagePacker_PackToFileMultiFrames" } ] \ No newline at end of file