From 10ff0b6239c7c59432f210691a66b6c72c59dc5d Mon Sep 17 00:00:00 2001
From: zhanghaodong <443802242@qq.com>
Date: Mon, 17 Apr 2023 07:06:36 +0000
Subject: [PATCH 1/2] feat:add codec jpeg idl
Signed-off-by: zhanghaodong <443802242@qq.com>
---
codec/bundle.json | 24 +++++
codec/image/BUILD.gn | 33 ++++++
codec/image/CodecImageType.idl | 156 ++++++++++++++++++++++++++++
codec/image/ICodecImageCallback.idl | 74 +++++++++++++
codec/image/ICodecImageJpeg.idl | 152 +++++++++++++++++++++++++++
5 files changed, 439 insertions(+)
create mode 100644 codec/image/BUILD.gn
create mode 100644 codec/image/CodecImageType.idl
create mode 100644 codec/image/ICodecImageCallback.idl
create mode 100644 codec/image/ICodecImageJpeg.idl
diff --git a/codec/bundle.json b/codec/bundle.json
index 09f505be..93d38b47 100644
--- a/codec/bundle.json
+++ b/codec/bundle.json
@@ -56,6 +56,30 @@
],
"header_base": "//drivers/interface/codec"
}
+ },
+ {
+ "name": "//drivers/interface/codec/v1_0:libimage_proxy_1.0",
+ "header": {
+ "header_files": [
+ ],
+ "header_base": "//drivers/interface/codec"
+ }
+ },
+ {
+ "name": "//drivers/interface/codec/v1_0:image_idl_headers",
+ "header": {
+ "header_files": [
+ ],
+ "header_base": "//drivers/interface/codec"
+ }
+ },
+ {
+ "name": "//drivers/interface/codec/v1_0:libimage_proxy_1.0",
+ "header": {
+ "header_files": [
+ ],
+ "header_base": "//drivers/interface/codec"
+ }
}
]
}
diff --git a/codec/image/BUILD.gn b/codec/image/BUILD.gn
new file mode 100644
index 00000000..2a238ac1
--- /dev/null
+++ b/codec/image/BUILD.gn
@@ -0,0 +1,33 @@
+# Copyright (c) 2021 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.
+
+import("../../../drivers/hdf_core/adapter/uhdf2/hdi.gni")
+if (defined(ohos_lite)) {
+ group("libimage_proxy_1.0") {
+ deps = []
+ public_configs = []
+ }
+} else {
+ hdi("image") {
+ module_name = "codec_service"
+
+ sources = [
+ "CodecImageType.idl",
+ "ICodecImageCallback.idl",
+ "ICodecImageJpeg.idl",
+ ]
+ language = "cpp"
+ subsystem_name = "hdf"
+ part_name = "drivers_interface_codec"
+ }
+}
diff --git a/codec/image/CodecImageType.idl b/codec/image/CodecImageType.idl
new file mode 100644
index 00000000..c564c4e3
--- /dev/null
+++ b/codec/image/CodecImageType.idl
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2023 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 Codec
+ * @{
+ *
+ * @brief Defines APIs of the image Codec module.
+ *
+ * The Codec module provides APIs for image codec, setting codec parameters,
+ * and controlling and transferring image data.
+ *
+ * @since 4.0
+ * @version 1.0
+ */
+
+/**
+ * @file CodecImageTypes.idl
+ *
+ * @brief Defines custom data types used in the image Codec module APIs,
+ * including the codec image parameters, types and buffers.
+ *
+ *
+ * @since 4.0
+ * @version 1.0
+ */
+
+/**
+ * @brief Defines the path for the package of the image Codec module APIs.
+ *
+ * @since 4.0
+ * @version 1.0
+ */
+package ohos.hdi.codec.v1_0;
+
+/**
+ * @brief Defines the image region information.
+ */
+struct CodecRegionInfo {
+ unsigned int left; /**< Distance to the left of the image. */
+ unsigned int right; /**< Distance to the right of the image. */
+ unsigned int top; /**< Distance to the top of the image. */
+ unsigned int bottom; /**< Distance to the bottom of the image. */
+ unsigned int flag; /**< True is use regionInfo. */
+ unsigned int rsv; /**< Reserved for extend. */
+};
+
+/**
+ * @brief Defines the codec image buffer information.
+ */
+struct CodecImageBuffer {
+ unsigned int id; /**< Buffer ID. */
+ unsigned int size; /**< Size of buffer. */
+ NativeBuffer buffer; /**< Buffer handle used for encoding or decoding. For details,
+ see {@link NativeBuffer}. */
+ FileDescriptor fenceFd; /**< Fence file descriptor. */
+};
+
+/**
+ * @brief Enumerates the types of image that can be encoded or decoded
+ */
+enum ImageCodecRole {
+ CODEC_IMAGE_JPEG = 0; /**< Jpeg image. */
+ CODEC_IMAGE_HEIF; /**< Heif image. */
+};
+
+/**
+ * @brief Defines the image codec type.
+ */
+enum ImageCodecType {
+ CODEC_IMAGE_TYPE_DECODER = 0; /**< Image decoder. */
+ CODEC_IMAGE_TYPE_ENCODER; /**< Image encoder. */
+};
+
+/**
+ * @brief Defines the image codec capabilities.
+ */
+struct CodecImageCapability {
+ String name; /**< Name of the image codec. */
+ enum ImageCodecRole role; /**< Role of the image codec. */
+ enum ImageCodecType type; /**< Type of the image codec. */
+ unsigned int widthAlignment; /**< Alignment value of the width. */
+ unsigned int heightAlignment; /**< Alignment value of the height. */
+ unsigned int maxSample; /**< Maximum sample. */
+ unsigned int maxWidth; /**< Maximum width. */
+ unsigned int maxHeight; /**< Maximum height. */
+ unsigned int minWidth; /**< Minimum width. */
+ unsigned int minHeight; /**< Minimum height. */
+ unsigned int maxInst; /**< Maximum instance. */
+ unsigned int[] supportPixFmts; /**< Supported PixFormat. For details, see {@link PixFormat}. */
+ boolean isSoftwareCodec; /**< Whether it is a software codec. */
+};
+
+/**
+ * @brief Defines the jpeg image quant table information.
+ */
+struct CodecJpegQuantTable {
+ unsigned short[] quantVal; /**< Quant table value. */
+ boolean tableFlag; /**< True when quant has been output. */
+};
+
+/**
+ * @brief Defines the jpeg image huff table information.
+ */
+struct CodecJpegHuffTable {
+ unsigned char[] bits;
+ unsigned char[] huffVal; /**< Huff table value. */
+ boolean tableFlag; /**< True when huff table valid. */
+};
+
+/**
+ * @brief Defines the jpeg image huff table information.
+ */
+struct CodecJpegCompInfo {
+ unsigned int componentId; /**< CompInfo index in JpegDecInfo. */
+ unsigned int componentIndex; /**< CompInfo index in JpegDecInfo. */
+ unsigned int hSampFactor; /**< Horizontal sample factor. */
+ unsigned int vSampFactor; /**< vertical sample factor. */
+ unsigned int quantTableNo; /**< Quant table value. */
+ unsigned int dcTableNo; /**< Dc table index. */
+ unsigned int acTableNo; /**< Ac table index. */
+ boolean infoFlag;
+};
+
+/**
+ * @brief Defines the jpeg image decode information.
+ */
+struct JpegDecInfo {
+ unsigned int imageWidth; /**< Image width. */
+ unsigned int imageHeight; /**< Image height. */
+ unsigned int dataPrecision; /**< Bit height. */
+ unsigned int numComponents; /**< Num of color component in jpeg image. */
+ unsigned int restartInterval; /**< MCUs per restart. */
+ boolean arithCode; /**< False is Huff coding,
+ true is arithmetic coding. */
+ boolean progressiveMode; /**< If SOF specifiy progressive mode. */
+ struct CodecJpegCompInfo[] compInfo; /**< Jpeg compress information. */
+ struct CodecJpegHuffTable[] dcHuffTbl; /**< Dc huffman table information. */
+ struct CodecJpegHuffTable[] acHuffTbl; /**< Ac huffman table information. */
+ struct CodecJpegQuantTable[] quantTbl; /**< Quant table information. */
+ struct CodecRegionInfo region; /**< Image region information. */
+ unsigned int sampleSize; /**< Image sample size. */
+ unsigned int compressPos; /**< The offset of Jpeg compressed data. */
+};
diff --git a/codec/image/ICodecImageCallback.idl b/codec/image/ICodecImageCallback.idl
new file mode 100644
index 00000000..c2f2e09e
--- /dev/null
+++ b/codec/image/ICodecImageCallback.idl
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2023 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 Codec
+ * @{
+ *
+ * @brief Defines APIs of the image Codec module.
+ *
+ * The Codec module provides APIs for image codec, setting codec parameters,
+ * and controlling and transferring image data.
+ *
+ * @since 4.0
+ * @version 1.0
+ */
+
+/**
+ * @file ICodecImageCallback.idl
+ *
+ * @brief Defines the callbacks used to report image codec result.
+ *
+ *
+ * @since 4.0
+ * @version 1.0
+ */
+
+/**
+ * @brief Defines the path for the package of the image Codec module APIs.
+ *
+ * @since 4.0
+ * @version 1.0
+ */
+package ohos.hdi.codec.v1_0;
+
+import ohos.hdi.codec.v1_0.CodecImageType;
+
+
+/**
+ * @brief Defines the callbacks of the Image Codec module.
+ *
+ * The following callbacks are provided:
+ * - Callback used to report image codec result,For details, see {@link OnImageEvent}.
+ * The callbacks are registered by using:
+ * - {@link DoJpegDecode} when decode jpeg image.
+ */
+
+
+[callback] interface ICodecImageCallback {
+
+ /**
+ * @brief Reports image codec result, such as an error.
+ *
+ * @param error Indicates the result of the image codec. For details, see {@link HDF_STATUS}.
+ *
+ * @error is HDF_SUCCESS if the image codec successfully.
+ * @error is other values if the image codec failed. For details about the error codes,
+ * see HDF_STATUS defined by HDF.
+ *
+ * @since 4.0
+ */
+ OnImageEvent([in] int error);
+}
diff --git a/codec/image/ICodecImageJpeg.idl b/codec/image/ICodecImageJpeg.idl
new file mode 100644
index 00000000..c3db6638
--- /dev/null
+++ b/codec/image/ICodecImageJpeg.idl
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2023 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 Codec
+ * @{
+ *
+ * @brief Defines APIs of the image Codec module.
+ *
+ * The Codec module provides APIs for image codec, setting codec parameters,
+ * and controlling and transferring image data.
+ *
+ * @since 4.0
+ * @version 1.0
+ */
+
+/**
+ * @file ICodecImageJpeg.idl
+ *
+ * @brief Declares the APIs for jpeg image codec.
+ *
+ *You can use these APIs to allocate input buffer, and decode jpeg image
+ *
+ * @since 4.0
+ * @version 1.0
+ */
+
+/**
+ * @brief Defines the path for the package of the image Codec module APIs.
+ *
+ * @since 4.0
+ * @version 1.0
+ */
+package ohos.hdi.codec.v1_0;
+
+import ohos.hdi.codec.v1_0.CodecImageType;
+import ohos.hdi.codec.v1_0.ICodecImageCallback;
+
+interface ICodecImageJpeg {
+
+ /**
+ * @brief Obtains image codec capabilities.
+ *
+ * You can use this API to obtain the encoding and decoding capabilities provided by the image Codec module.
+ * For details, see {@link CodecImageCapability}.
+ *
+ * @param capList Indicates the image codec capabilities {@link CodecImageCapability} obtained.
+ *
+ * @return Returns HDF_SUCCESS if the operation is successful.
+ * @return Returns HDF_FAILURE if the execution fails.
+ *
+ * @since 4.0
+ */
+ GetImageCapability([out] struct CodecImageCapability[] capList);
+
+ /**
+ * @brief Jpeg image codec module init.
+ *
+ * You can use this API to init the jpeg image Codec module.
+ *
+ * @return Returns HDF_SUCCESS if the operation is successful.
+ * @return Returns HDF_FAILURE if the execution fails.
+ * @return Returns other values if the underlying layer returns a failure. For details about the error codes,
+ * see HDF_STATUS defined by HDF.
+ *
+ * @since 4.0
+ */
+ JpegInit();
+
+ /**
+ * @brief Jpeg image codec module deinit.
+ *
+ * You can use this API to deinit the jpeg image Codec module.
+ *
+ * @return Returns HDF_SUCCESS if the operation is successful.
+ * @return Returns HDF_FAILURE if the execution fails.
+ * @return Returns other values if the underlying layer returns a failure. For details about the error codes,
+ * see HDF_STATUS defined by HDF.
+ *
+ * @since 4.0
+ */
+ JpegDeInit();
+
+ /**
+ * @brief Start jpeg image decode.
+ *
+ * You can use this API to start jpeg image decode, if return Returns HDF_SUCCESS,
+ * the image is decoding, you should receive the decode result by callbacks.
+ *
+ * @param inBuffer Indicates input buffer of the jpeg image decode {@link CodecImageBuffer} obtained.
+ * @param outBuffer Indicates output buffer of the jpeg image decode {@link CodecImageBuffer} obtained.
+ * @param callbacks Indicates callback of the image decode {@link ICodecImageCallback} obtained.
+ * @param decInfo Indicates decode information of the image decode {@link JpegDecInfo} obtained.
+ *
+ * @return Returns HDF_SUCCESS if the operation is successful.
+ * @return Returns HDF_ERR_INVALID_PARAM if the operation fails due to invalid parameters.
+ * @return Returns HDF_FAILURE if the execution fails.
+ * @return Returns other values if the underlying layer returns a failure. For details about the error codes,
+ * see HDF_STATUS defined by HDF.
+ *
+ * @since 4.0
+ */
+ DoJpegDecode([in] struct CodecImageBuffer inBuffer, [in] struct CodecImageBuffer outBuffer,
+ [in] ICodecImageCallback callbacks, [in] struct JpegDecInfo decInfo);
+
+ /**
+ * @brief Allocate input buffer.
+ *
+ * You can use this API to allocate input buffer for jpeg image decode.
+ *
+ * @param inBuffer Indicates input buffer of the jpeg image decode {@link CodecImageBuffer} obtained.
+ * @param size Indicates size of input buffer {@link CodecImageBuffer} obtained.
+ *
+ * @return Returns HDF_SUCCESS if the operation is successful.
+ * @return Returns HDF_ERR_INVALID_PARAM if the operation fails due to invalid parameters.
+ * @return Returns HDF_FAILURE if the execution fails.
+ * @return Returns other values if the underlying layer returns a failure. For details about the error codes,
+ * see HDF_STATUS defined by HDF.
+ *
+ * @since 4.0
+ */
+ AllocateInBuffer([out] struct CodecImageBuffer inBuffer, [in] unsigned int size);
+
+ /**
+ * @brief Free input buffer.
+ *
+ * You can use this API to free input buffer for jpeg image decode.
+ *
+ * @param buffer Indicates input buffer of the jpeg image decode {@link CodecImageBuffer} obtained.
+ *
+ * @return Returns HDF_SUCCESS if the operation is successful.
+ * @return Returns HDF_FAILURE if the execution fails.
+ * @return Returns other values if the underlying layer returns a failure. For details about the error codes,
+ * see HDF_STATUS defined by HDF.
+ *
+ * @since 4.0
+ */
+ FreeInBuffer([in] struct CodecImageBuffer inBuffer);
+
+}
--
Gitee
From ece04c521c05d6e3af0d129774dfd21b77577e5d Mon Sep 17 00:00:00 2001
From: zhanghaodong <443802242@qq.com>
Date: Mon, 17 Apr 2023 07:11:48 +0000
Subject: [PATCH 2/2] feat:add codec jpeg idl
Signed-off-by: zhanghaodong <443802242@qq.com>
---
codec/bundle.json | 9 +++---
codec/image/{ => v1_0}/BUILD.gn | 4 +--
codec/image/{ => v1_0}/CodecImageType.idl | 28 ++++++++++---------
.../image/{ => v1_0}/ICodecImageCallback.idl | 12 ++++----
codec/image/{ => v1_0}/ICodecImageJpeg.idl | 8 +++---
codec/v1_0/BUILD.gn | 4 +--
6 files changed, 34 insertions(+), 31 deletions(-)
rename codec/image/{ => v1_0}/BUILD.gn (89%)
rename codec/image/{ => v1_0}/CodecImageType.idl (85%)
rename codec/image/{ => v1_0}/ICodecImageCallback.idl (78%)
rename codec/image/{ => v1_0}/ICodecImageJpeg.idl (94%)
diff --git a/codec/bundle.json b/codec/bundle.json
index 93d38b47..1b6bbb62 100644
--- a/codec/bundle.json
+++ b/codec/bundle.json
@@ -28,7 +28,8 @@
},
"build": {
"sub_component": [
- "//drivers/interface/codec/v1_0:codec_idl_target"
+ "//drivers/interface/codec/v1_0:codec_idl_target",
+ "//drivers/interface/codec/image/v1_0:image_idl_target"
],
"test": [
],
@@ -58,7 +59,7 @@
}
},
{
- "name": "//drivers/interface/codec/v1_0:libimage_proxy_1.0",
+ "name": "//drivers/interface/codec/image/v1_0:libimage_proxy_1.0",
"header": {
"header_files": [
],
@@ -66,7 +67,7 @@
}
},
{
- "name": "//drivers/interface/codec/v1_0:image_idl_headers",
+ "name": "//drivers/interface/codec/image/v1_0:image_idl_headers",
"header": {
"header_files": [
],
@@ -74,7 +75,7 @@
}
},
{
- "name": "//drivers/interface/codec/v1_0:libimage_proxy_1.0",
+ "name": "//drivers/interface/codec/image/v1_0:libimage_stub_1.0",
"header": {
"header_files": [
],
diff --git a/codec/image/BUILD.gn b/codec/image/v1_0/BUILD.gn
similarity index 89%
rename from codec/image/BUILD.gn
rename to codec/image/v1_0/BUILD.gn
index 2a238ac1..1b6ed3f3 100644
--- a/codec/image/BUILD.gn
+++ b/codec/image/v1_0/BUILD.gn
@@ -1,4 +1,4 @@
-# Copyright (c) 2021 Huawei Device Co., Ltd.
+# Copyright (c) 2023 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
@@ -11,7 +11,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import("../../../drivers/hdf_core/adapter/uhdf2/hdi.gni")
+import("../../../../hdf_core/adapter/uhdf2/hdi.gni")
if (defined(ohos_lite)) {
group("libimage_proxy_1.0") {
deps = []
diff --git a/codec/image/CodecImageType.idl b/codec/image/v1_0/CodecImageType.idl
similarity index 85%
rename from codec/image/CodecImageType.idl
rename to codec/image/v1_0/CodecImageType.idl
index c564c4e3..1a802e1c 100644
--- a/codec/image/CodecImageType.idl
+++ b/codec/image/v1_0/CodecImageType.idl
@@ -43,12 +43,12 @@
* @since 4.0
* @version 1.0
*/
-package ohos.hdi.codec.v1_0;
+package ohos.hdi.codec.image.v1_0;
/**
* @brief Defines the image region information.
*/
-struct CodecRegionInfo {
+struct CodecImageRegion {
unsigned int left; /**< Distance to the left of the image. */
unsigned int right; /**< Distance to the right of the image. */
unsigned int top; /**< Distance to the top of the image. */
@@ -71,17 +71,19 @@ struct CodecImageBuffer {
/**
* @brief Enumerates the types of image that can be encoded or decoded
*/
-enum ImageCodecRole {
- CODEC_IMAGE_JPEG = 0; /**< Jpeg image. */
- CODEC_IMAGE_HEIF; /**< Heif image. */
+enum CodecImageRole {
+ CODEC_IMAGE_JPEG = 0, /**< Jpeg image. */
+ CODEC_IMAGE_HEIF, /**< Heif image. */
+ CODEC_IMAGE_INVALID, /**< Invalid image type. */
};
/**
* @brief Defines the image codec type.
*/
-enum ImageCodecType {
- CODEC_IMAGE_TYPE_DECODER = 0; /**< Image decoder. */
- CODEC_IMAGE_TYPE_ENCODER; /**< Image encoder. */
+enum CodecImageType {
+ CODEC_IMAGE_TYPE_DECODER = 0, /**< Image decoder. */
+ CODEC_IMAGE_TYPE_ENCODER, /**< Image encoder. */
+ CODEC_IMAGE_TYPE_INVALID, /**< Invalid type. */
};
/**
@@ -89,8 +91,8 @@ enum ImageCodecType {
*/
struct CodecImageCapability {
String name; /**< Name of the image codec. */
- enum ImageCodecRole role; /**< Role of the image codec. */
- enum ImageCodecType type; /**< Type of the image codec. */
+ enum CodecImageRole role; /**< Role of the image codec. */
+ enum CodecImageType type; /**< Type of the image codec. */
unsigned int widthAlignment; /**< Alignment value of the width. */
unsigned int heightAlignment; /**< Alignment value of the height. */
unsigned int maxSample; /**< Maximum sample. */
@@ -115,7 +117,7 @@ struct CodecJpegQuantTable {
* @brief Defines the jpeg image huff table information.
*/
struct CodecJpegHuffTable {
- unsigned char[] bits;
+ unsigned char[] bits; /**< Bits value, bits[0] is unused. */
unsigned char[] huffVal; /**< Huff table value. */
boolean tableFlag; /**< True when huff table valid. */
};
@@ -137,7 +139,7 @@ struct CodecJpegCompInfo {
/**
* @brief Defines the jpeg image decode information.
*/
-struct JpegDecInfo {
+struct CodecJpegDecInfo {
unsigned int imageWidth; /**< Image width. */
unsigned int imageHeight; /**< Image height. */
unsigned int dataPrecision; /**< Bit height. */
@@ -150,7 +152,7 @@ struct JpegDecInfo {
struct CodecJpegHuffTable[] dcHuffTbl; /**< Dc huffman table information. */
struct CodecJpegHuffTable[] acHuffTbl; /**< Ac huffman table information. */
struct CodecJpegQuantTable[] quantTbl; /**< Quant table information. */
- struct CodecRegionInfo region; /**< Image region information. */
+ struct CodecImageRegion region; /**< Image region information. */
unsigned int sampleSize; /**< Image sample size. */
unsigned int compressPos; /**< The offset of Jpeg compressed data. */
};
diff --git a/codec/image/ICodecImageCallback.idl b/codec/image/v1_0/ICodecImageCallback.idl
similarity index 78%
rename from codec/image/ICodecImageCallback.idl
rename to codec/image/v1_0/ICodecImageCallback.idl
index c2f2e09e..f4117888 100644
--- a/codec/image/ICodecImageCallback.idl
+++ b/codec/image/v1_0/ICodecImageCallback.idl
@@ -42,9 +42,9 @@
* @since 4.0
* @version 1.0
*/
-package ohos.hdi.codec.v1_0;
+package ohos.hdi.codec.image.v1_0;
-import ohos.hdi.codec.v1_0.CodecImageType;
+import ohos.hdi.codec.image.v1_0.CodecImageType;
/**
@@ -62,13 +62,13 @@ import ohos.hdi.codec.v1_0.CodecImageType;
/**
* @brief Reports image codec result, such as an error.
*
- * @param error Indicates the result of the image codec. For details, see {@link HDF_STATUS}.
+ * @param status Indicates the result of the image codec. For details, see {@link HDF_STATUS}.
*
- * @error is HDF_SUCCESS if the image codec successfully.
- * @error is other values if the image codec failed. For details about the error codes,
+ * @status is HDF_SUCCESS if the image codec successfully.
+ * @status is other values if the image codec failed. For details about the status codes,
* see HDF_STATUS defined by HDF.
*
* @since 4.0
*/
- OnImageEvent([in] int error);
+ OnImageEvent([in] int status);
}
diff --git a/codec/image/ICodecImageJpeg.idl b/codec/image/v1_0/ICodecImageJpeg.idl
similarity index 94%
rename from codec/image/ICodecImageJpeg.idl
rename to codec/image/v1_0/ICodecImageJpeg.idl
index c3db6638..5a307ae7 100644
--- a/codec/image/ICodecImageJpeg.idl
+++ b/codec/image/v1_0/ICodecImageJpeg.idl
@@ -43,10 +43,10 @@
* @since 4.0
* @version 1.0
*/
-package ohos.hdi.codec.v1_0;
+package ohos.hdi.codec.image.v1_0;
-import ohos.hdi.codec.v1_0.CodecImageType;
-import ohos.hdi.codec.v1_0.ICodecImageCallback;
+import ohos.hdi.codec.image.v1_0.CodecImageType;
+import ohos.hdi.codec.image.v1_0.ICodecImageCallback;
interface ICodecImageJpeg {
@@ -113,7 +113,7 @@ interface ICodecImageJpeg {
* @since 4.0
*/
DoJpegDecode([in] struct CodecImageBuffer inBuffer, [in] struct CodecImageBuffer outBuffer,
- [in] ICodecImageCallback callbacks, [in] struct JpegDecInfo decInfo);
+ [in] ICodecImageCallback callbacks, [in] struct CodecJpegDecInfo decInfo);
/**
* @brief Allocate input buffer.
diff --git a/codec/v1_0/BUILD.gn b/codec/v1_0/BUILD.gn
index 0ece51d9..6de4ce09 100644
--- a/codec/v1_0/BUILD.gn
+++ b/codec/v1_0/BUILD.gn
@@ -1,4 +1,4 @@
-# Copyright (c) 2021 Huawei Device Co., Ltd.
+# Copyright (c) 2021-2023 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
@@ -11,7 +11,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import("//drivers/hdf_core/adapter/uhdf2/hdi.gni")
+import("../../../hdf_core/adapter/uhdf2/hdi.gni")
if (defined(ohos_lite)) {
group("libcodec_proxy_1.0") {
deps = []
--
Gitee