From 35ef980b623cbb8cf3383d0103c1492391518a9f Mon Sep 17 00:00:00 2001 From: caochuan Date: Thu, 14 Mar 2024 15:29:14 +0800 Subject: [PATCH] =?UTF-8?q?Feature:=20=E6=94=AF=E6=8C=81Gif=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: caochuan --- .../include/image_packer_mdk.h | 23 +++++++++++++++++++ .../libimage_packer_ndk.ndk.json | 4 ++++ 2 files changed, 27 insertions(+) diff --git a/multimedia/image_framework/include/image_packer_mdk.h b/multimedia/image_framework/include/image_packer_mdk.h index 0a49718d78f..e6a0677ccfc 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 6a4b55b61e1..48147c20e0a 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 -- Gitee