From 5f42f0cb777ec1096f6734e10f98c9873436fb37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=AF=97=E9=AB=98?= Date: Sat, 7 Oct 2023 10:35:45 +0000 Subject: [PATCH 01/28] idl file add MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李诗高 --- codec/v1_0/omxExt.idl | 295 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 295 insertions(+) create mode 100644 codec/v1_0/omxExt.idl diff --git a/codec/v1_0/omxExt.idl b/codec/v1_0/omxExt.idl new file mode 100644 index 00000000..21ab4ad6 --- /dev/null +++ b/codec/v1_0/omxExt.idl @@ -0,0 +1,295 @@ +/* + * Copyright (c) 2022-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. + */ + + package ohos.hdi.codec.v1_0; + /** + * @brief Enumerates the extended codec codingtyps. + */ + enum CodecVideoExType { + CODEC_OMX_VIDEO_CodingVP9 = 10, /** VP9 Index in Codec HDI */ + CODEC_OMX_VIDEO_CodingHEVC = 11, /** HEVC Index in Codec HDI */ + }; + + /** + * @brief Enumerates the extended HEVC profile. + */ + enum CodecHevcProfile { + CODEC_HEVC_PROFILE_INVALID = 0x0, + CODEC_HEVC_PROFILE_MAIN = 0x1, + CODEC_HEVC_PROFILE_MAIN10 = 0x2, + CODEC_HEVC_PROFILE_MAIN_STILL = 0x3, + // main_10 profile with HDR SEI support. + CODEC_HEVC_PROFILE_MAIN10_HDR10 = 0x1000, + CODEC_HEVC_PROFILE_MAIN10_HDR10_PLUS = 0x2000, + CODEC_HEVC_PROFILE_MAX = 0x7FFFFFFF + }; + + /** + * @brief Enumerates the extended HEVC level. + */ +enum CodecHevcLevel { + CODEC_HEVC_LEVEL_INVALID = 0x0, + CODEC_HEVC_MAIN_TIER_LEVEL1 = 0x1, + CODEC_HEVC_HIGH_TIER_LEVEL1 = 0x2, + CODEC_HEVC_MAIN_TIER_LEVEL2 = 0x4, + CODEC_HEVC_HIGH_TIER_LEVEL2 = 0x8, + CODEC_HEVC_MAIN_TIER_LEVEL21 = 0x10, + CODEC_HEVC_HIGH_TIER_LEVEL21 = 0x20, + CODEC_HEVC_MAIN_TIER_LEVEL3 = 0x40, + CODEC_HEVC_HIGH_TIER_LEVEL3 = 0x80, + CODEC_HEVC_MAIN_TIER_LEVEL31 = 0x100, + CODEC_HEVC_HIGH_TIER_LEVEL31 = 0x200, + CODEC_HEVC_MAIN_TIER_LEVEL4 = 0x400, + CODEC_HEVC_HIGH_TIER_LEVEL4 = 0x800, + CODEC_HEVC_MAIN_TIER_LEVEL41 = 0x1000, + CODEC_HEVC_HIGH_TIER_LEVEL41 = 0x2000, + CODEC_HEVC_MAIN_TIER_LEVEL5 = 0x4000, + CODEC_HEVC_HIGH_TIER_LEVEL5 = 0x8000, + CODEC_HEVC_MAIN_TIER_LEVEL51 = 0x10000, + CODEC_HEVC_HIGH_TIER_LEVEL51 = 0x20000, + CODEC_HEVC_MAIN_TIER_LEVEL52 = 0x40000, + CODEC_HEVC_HIGH_TIER_LEVEL52 = 0x80000, + CODEC_HEVC_MAIN_TIER_LEVEL6 = 0x100000, + CODEC_HEVC_HIGH_TIER_LEVEL6 = 0x200000, + CODEC_HEVC_MAIN_TIER_LEVEL61 = 0x400000, + CODEC_HEVC_HIGH_TIER_LEVEL61 = 0x800000, + CODEC_HEVC_MAIN_TIER_LEVEL62 = 0x1000000, + CODEC_HEVC_HIGH_TIER_LEVEL62 = 0x2000000, + CODEC_HEVC_HIGH_TIER_MAX = 0x7FFFFFFF + }; + + /** + * @brief Enumerates the extended codec color format. + */ +enum CodecColorFormatExt { + CODEC_COLOR_FORMAT_RGBA8888 = 0x7F000000 + 100, + }; + + /** + * @brief Enumerates the buffer types. + */ +enum CodecBufferType { + /** Invalid buffer type. */ + CODEC_BUFFER_TYPE_INVALID = 0, + /** Virtual address type. */ + CODEC_BUFFER_TYPE_VIRTUAL_ADDR = 0x1, + /** Shared memory. */ + CODEC_BUFFER_TYPE_AVSHARE_MEM_FD = 0x2, + /** Handle. */ + CODEC_BUFFER_TYPE_HANDLE = 0x4, + /** Dynamic handle. */ + CODEC_BUFFER_TYPE_DYNAMIC_HANDLE = 0x8, + }; + + /** + * @brief Defines the CODEC_VERSIONTYPE=OMX_VERSIONTYPE. + */ +struct s { + unsigned char nVersionMajor; /**< Major version accessor element */ + unsigned char nVersionMinor; /**< Minor version accessor element */ + unsigned char nRevision; /**< Revision version accessor element */ + unsigned char nStep; /**< Step version accessor element */ +}; + +union CODEC_VERSIONTYPE { + struct s nVersionPara; + int nVersion; /**< 32 bit value to make accessing the + version easily done in a single word + size copy/compare operation */ +}; + /** + * @brief Defines the SupportBuffer. + */ +struct SupportBufferType { + unsigned int size; /** Size of the structure */ + union CODEC_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned int bufferTypes; /** Supported buffer types */ + }; + + /** + * @brief Define the UseBuffer. + */ +struct UseBufferType { + unsigned int size; /** Size of the structure */ + union CODEC_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned int bufferType; /** Buffer type */ + }; + + /** + * @brief Defines the BufferHandleUsage. + */ + struct GetBufferHandleUsageParams { + unsigned int size; /** Size of the structure */ + union CODEC_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned long usage; /** Usage */ + }; + + /** + * @brief Defines the CodecVideoPortFormatParam. + */ + struct CodecVideoPortFormatParam { + unsigned int size; /** Size of the structure */ + union CODEC_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned int codecColorIndex; /** Color format index */ + unsigned int codecColorFormat; /** Color format defined in Display */ + unsigned int codecCompressFormat; /** See */ + unsigned int framerate; /** Q16 format */ + }; + + /** + * @brief Defines the ControlRateConstantQuality. + */ + struct ControlRateConstantQuality { + unsigned int size; /** Size of the structure */ + union CODEC_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned int qualityValue; /** Control rate constant quality */ + }; + + /** + * @brief Enumerates the extended codec indexes. + */ + enum OmxIndexCodecExType { + /** Extended BufferType index */ + OMX_IndexExtBufferTypeStartUnused = 0x6F000000 + 0x00a00000, + /** SupportBuffer */ + OMX_IndexParamSupportBufferType, + /** UseBuffer */ + OMX_IndexParamUseBufferType, + /** GetBufferHandleUsage */ + OMX_IndexParamGetBufferHandleUsage, + /** CodecVideoPortFormatParam */ + OMX_IndexCodecVideoPortFormat, + /** ControlRateConstantQuality */ + OMX_IndexParamControlRateConstantQuality, + /** OMX_IndexParamVideoHevc */ + OMX_IndexParamVideoHevc, + /** range/primary/transfer/matrix */ + OMX_IndexColorAspects, + }; + + /** + * @brief Enumerates the Other extended codec indexes. + */ + enum OmxIndexCodecOtherExtType { + /** Extended Config AutoFramerate Conversion */ + OMX_IndexCodecExtConfigAutoFramerateConversion = 0x08000000 + 0x1, + /** Extended Config Priority */ + OMX_IndexCodecExtConfigPriority, + /** Extended Config OperatingRate index */ + OMX_IndexCodecExtConfigOperatingRate, + }; + + enum OmxIndexCodecVendorExtType { + /** Extended Channel Attributes index */ + OMX_IndexCodecExtChannelAttributes = 0x7F000000 + 0x1, + /** CodecEnableNativeBufferParams */ + OMX_IndexCodecExtEnableNativeBuffer, + }; + + /** + * @brief Structure for controlling HEVC video encoding + */ + struct CodecVideoParamHevc { + unsigned int size; /** Size of the structure */ + union CODEC_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + enum CodecHevcProfile profile; /** Hevc profile. For details, see {@link CodecHevcProfile}. */ + enum CodecHevcLevel level; /** Hevc level. For details, see {@link CodecHevcLevel}. */ + unsigned int keyFrameInterval; /** Distance between consecutive I-frames (including one of the I frams). + 0 means interval is unspecified and can be freely chosen by the codec. + 1 means a stream of only I frams. other means the real value. */ + }; + + /** + * @brief Defines the CodecEnableNativeBufferParams. + */ + struct CodecEnableNativeBufferParams { + unsigned int size; /** Size of the structure */ + union CODEC_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + boolean enable; /** Enable NativeBuffer */ + }; + + enum RangeType { + RANGE_UNSPECIFIED, + RANGE_FULL, + RANGE_LIMITED, + RANGE_MAX = 0xff, + }; + + enum Primaries { + PRIMARIES_UNSPECIFIED, + PRIMARIES_BT709, //Rec. ITU-R BT.709-6 + PRIMARIES_BT470_6M, //Rec. ITU-R BT.470-6 System M + PRIMARIES_BT601_625, //Rec. ITU-R BT.601-7 625 or Rec. ITU-R BT.470-6 System B,G + PRIMARIES_BT601_525, //Rec. ITU-R BT.601-7 525 or SMPTE ST 170 or SMPTE ST 240 + PRIMARIES_GENERICFILM, //Generic Film + PRIMARIES_BT2020, //Rec. ITU-R BT.2020-2 or Rec. ITU-R BT.2100-2 + PRIMARIES_MAX = 0xff, + }; + + enum Transfer { + TRANSFER_UNSPECIFIED, + TRANSFER_LINEAR, //Linear transfer characteristics + TRANSFER_SRGB, //IEC 61966-2-1 sRGB + TRANSFER_SMPTE170, //SMPTE ST 170 or Rec. ITU-R BT.709-6 or BT.601-7 or BT.2020-2 + TRANSFER_GAMMA22, //Rec. ITU-R BT.470-6 System M + TRANSFER_GAMMA28, //Rec. ITU-R BT.470-6 System B,G + TRANSFER_PQ, //Rec. ITU-R BT.2100-2 perceptual quantization (PQ) system + TRANSFER_HLG, //Rec. ITU-R BT.2100-2 hybrid log gamma (HLG) system + TRANSFER_SMPTE240 = 0x40, //SMPTE ST 240 + TRANSFER_XVYCC, //IEC 61966-2-4 + TRANSFER_BT1361, //Rec. ITU-R BT.1361-0 extended colour gamut system + TRANSFER_ST428, //SMPTE ST 428-1 + TRANSFER_MAX = 0xff, + }; + + enum MatrixCoeffs { + MATRIX_UNSPECIFED, + MATRIX_BT709, //Rec. ITU-R BT.709-6 + MATRIX_FCC, //United States Federal Communications Commission + MATRIX_BT601, //Rec. ITU-R BT.601-7 or Rec. ITU-R BT.470-6 System B,G + MATRIX_SMPTE240, //SMPTE ST 240 + MATRIX_BT2020, //Rec. ITU-R BT.2100-2 (non-constant luminance) + MATRIX_BT2020CONSTANT, //Rec. ITU-R BT.2100-2 (constant luminance) + MATRIX_MAX = 0xff, + }; + + struct ColorAspects { + enum RangeType range; + enum Primaries primaries; + enum Transfer transfer; + enum MatrixCoeffs matrixCoeffs; + }; + + /** + * @brief Structure for controlling color space + */ + struct CodecVideoColorspace { + unsigned int size; /** Size of the structure */ + union CODEC_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned int requestingDataSpace; + unsigned int dataSpaceChanged; + unsigned int pixeFormat; + unsigned int dataSpace; + struct ColorAspects aspects; + }; + -- Gitee From 3f5bad53eb53234d2d7d160a8c3bab1a7f1a2c57 Mon Sep 17 00:00:00 2001 From: lishigao Date: Sun, 8 Oct 2023 03:40:51 +0000 Subject: [PATCH 02/28] modify Signed-off-by: lishigao --- codec/v1_0/omxExt.idl | 48 ++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/codec/v1_0/omxExt.idl b/codec/v1_0/omxExt.idl index 21ab4ad6..ddc4db84 100644 --- a/codec/v1_0/omxExt.idl +++ b/codec/v1_0/omxExt.idl @@ -14,6 +14,12 @@ */ package ohos.hdi.codec.v1_0; + + OMX_COLOR_FormatVendorStartUnused = 0x7F000000; + OMX_IndexKhronosExtensions = 0x6F000000; + OMX_IndexOtherStartUnused = 0x08000000; + OMX_IndexVendorStartUnused = 0x7F000000; + /** * @brief Enumerates the extended codec codingtyps. */ @@ -74,7 +80,7 @@ enum CodecHevcLevel { * @brief Enumerates the extended codec color format. */ enum CodecColorFormatExt { - CODEC_COLOR_FORMAT_RGBA8888 = 0x7F000000 + 100, + CODEC_COLOR_FORMAT_RGBA8888 = OMX_COLOR_FormatVendorStartUnused + 100, }; /** @@ -94,17 +100,17 @@ enum CodecBufferType { }; /** - * @brief Defines the CODEC_VERSIONTYPE=OMX_VERSIONTYPE. + * @brief Defines the OMX_VERSIONTYPE. */ -struct s { +struct NversionPara { unsigned char nVersionMajor; /**< Major version accessor element */ unsigned char nVersionMinor; /**< Minor version accessor element */ unsigned char nRevision; /**< Revision version accessor element */ unsigned char nStep; /**< Step version accessor element */ }; -union CODEC_VERSIONTYPE { - struct s nVersionPara; +union OMX_VERSIONTYPE { + struct NversionPara s; int nVersion; /**< 32 bit value to make accessing the version easily done in a single word size copy/compare operation */ @@ -114,7 +120,7 @@ union CODEC_VERSIONTYPE { */ struct SupportBufferType { unsigned int size; /** Size of the structure */ - union CODEC_VERSIONTYPE version; /** Component version */ + union OMX_VERSIONTYPE version; /** Component version */ unsigned int portIndex; /** Port index */ unsigned int bufferTypes; /** Supported buffer types */ }; @@ -124,7 +130,7 @@ struct SupportBufferType { */ struct UseBufferType { unsigned int size; /** Size of the structure */ - union CODEC_VERSIONTYPE version; /** Component version */ + union OMX_VERSIONTYPE version; /** Component version */ unsigned int portIndex; /** Port index */ unsigned int bufferType; /** Buffer type */ }; @@ -134,7 +140,7 @@ struct UseBufferType { */ struct GetBufferHandleUsageParams { unsigned int size; /** Size of the structure */ - union CODEC_VERSIONTYPE version; /** Component version */ + union OMX_VERSIONTYPE version; /** Component version */ unsigned int portIndex; /** Port index */ unsigned long usage; /** Usage */ }; @@ -144,7 +150,7 @@ struct UseBufferType { */ struct CodecVideoPortFormatParam { unsigned int size; /** Size of the structure */ - union CODEC_VERSIONTYPE version; /** Component version */ + union OMX_VERSIONTYPE version; /** Component version */ unsigned int portIndex; /** Port index */ unsigned int codecColorIndex; /** Color format index */ unsigned int codecColorFormat; /** Color format defined in Display */ @@ -157,17 +163,25 @@ struct UseBufferType { */ struct ControlRateConstantQuality { unsigned int size; /** Size of the structure */ - union CODEC_VERSIONTYPE version; /** Component version */ + union OMX_VERSIONTYPE version; /** Component version */ unsigned int portIndex; /** Port index */ unsigned int qualityValue; /** Control rate constant quality */ }; + /** + * @brief Defines the PassthroughParam. + */ + struct PassthroughParam { + int32_t key; /**< Parameter type index */ + btye val; /**< Pointer to the parameter value */ + int size; /**< Parameter value size */ + }; /** * @brief Enumerates the extended codec indexes. */ enum OmxIndexCodecExType { /** Extended BufferType index */ - OMX_IndexExtBufferTypeStartUnused = 0x6F000000 + 0x00a00000, + OMX_IndexExtBufferTypeStartUnused = OMX_IndexKhronosExtensions + 0x00a00000, /** SupportBuffer */ OMX_IndexParamSupportBufferType, /** UseBuffer */ @@ -178,6 +192,8 @@ struct UseBufferType { OMX_IndexCodecVideoPortFormat, /** ControlRateConstantQuality */ OMX_IndexParamControlRateConstantQuality, + /** PassthroughParam */ + OMX_IndexParamPassthrough, /** OMX_IndexParamVideoHevc */ OMX_IndexParamVideoHevc, /** range/primary/transfer/matrix */ @@ -189,7 +205,7 @@ struct UseBufferType { */ enum OmxIndexCodecOtherExtType { /** Extended Config AutoFramerate Conversion */ - OMX_IndexCodecExtConfigAutoFramerateConversion = 0x08000000 + 0x1, + OMX_IndexCodecExtConfigAutoFramerateConversion = OMX_IndexOtherStartUnused + 0x1, /** Extended Config Priority */ OMX_IndexCodecExtConfigPriority, /** Extended Config OperatingRate index */ @@ -198,7 +214,7 @@ struct UseBufferType { enum OmxIndexCodecVendorExtType { /** Extended Channel Attributes index */ - OMX_IndexCodecExtChannelAttributes = 0x7F000000 + 0x1, + OMX_IndexCodecExtChannelAttributes = OMX_IndexVendorStartUnused + 0x1, /** CodecEnableNativeBufferParams */ OMX_IndexCodecExtEnableNativeBuffer, }; @@ -208,7 +224,7 @@ struct UseBufferType { */ struct CodecVideoParamHevc { unsigned int size; /** Size of the structure */ - union CODEC_VERSIONTYPE version; /** Component version */ + union OMX_VERSIONTYPE version; /** Component version */ unsigned int portIndex; /** Port index */ enum CodecHevcProfile profile; /** Hevc profile. For details, see {@link CodecHevcProfile}. */ enum CodecHevcLevel level; /** Hevc level. For details, see {@link CodecHevcLevel}. */ @@ -222,7 +238,7 @@ struct UseBufferType { */ struct CodecEnableNativeBufferParams { unsigned int size; /** Size of the structure */ - union CODEC_VERSIONTYPE version; /** Component version */ + union OMX_VERSIONTYPE version; /** Component version */ unsigned int portIndex; /** Port index */ boolean enable; /** Enable NativeBuffer */ }; @@ -284,7 +300,7 @@ struct UseBufferType { */ struct CodecVideoColorspace { unsigned int size; /** Size of the structure */ - union CODEC_VERSIONTYPE version; /** Component version */ + union OMX_VERSIONTYPE version; /** Component version */ unsigned int portIndex; /** Port index */ unsigned int requestingDataSpace; unsigned int dataSpaceChanged; -- Gitee From 0a098b1a79f7c588248fb605971910fe5a7f8119 Mon Sep 17 00:00:00 2001 From: lishigao Date: Sun, 8 Oct 2023 06:56:54 +0000 Subject: [PATCH 03/28] second modify Signed-off-by: lishigao --- codec/v1_0/omxExt.idl | 46 ++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/codec/v1_0/omxExt.idl b/codec/v1_0/omxExt.idl index ddc4db84..9e06f3c8 100644 --- a/codec/v1_0/omxExt.idl +++ b/codec/v1_0/omxExt.idl @@ -15,10 +15,32 @@ package ohos.hdi.codec.v1_0; - OMX_COLOR_FormatVendorStartUnused = 0x7F000000; - OMX_IndexKhronosExtensions = 0x6F000000; - OMX_IndexOtherStartUnused = 0x08000000; - OMX_IndexVendorStartUnused = 0x7F000000; + enum OMX_COLOR_FORAMTTYPE { + OMX_COLOR_FormatVendorStartUnused = 0x7F000000; + } + + enum OMX_INDEXTYPE { + OMX_IndexKhronosExtensions = 0x6F000000; + OMX_IndexOtherStartUnused = 0x08000000; + OMX_IndexVendorStartUnused = 0x7F000000; + } + + /** + * @brief Defines the OMX_VERSIONTYPE. + */ + struct NversionPara { + unsigned char nVersionMajor; /**< Major version accessor element */ + unsigned char nVersionMinor; /**< Minor version accessor element */ + unsigned char nRevision; /**< Revision version accessor element */ + unsigned char nStep; /**< Step version accessor element */ + }; + + union OMX_VERSIONTYPE { + struct NversionPara s; + int nVersion; /**< 32 bit value to make accessing the + version easily done in a single word + size copy/compare operation */ + }; /** * @brief Enumerates the extended codec codingtyps. @@ -99,22 +121,6 @@ enum CodecBufferType { CODEC_BUFFER_TYPE_DYNAMIC_HANDLE = 0x8, }; - /** - * @brief Defines the OMX_VERSIONTYPE. - */ -struct NversionPara { - unsigned char nVersionMajor; /**< Major version accessor element */ - unsigned char nVersionMinor; /**< Minor version accessor element */ - unsigned char nRevision; /**< Revision version accessor element */ - unsigned char nStep; /**< Step version accessor element */ -}; - -union OMX_VERSIONTYPE { - struct NversionPara s; - int nVersion; /**< 32 bit value to make accessing the - version easily done in a single word - size copy/compare operation */ -}; /** * @brief Defines the SupportBuffer. */ -- Gitee From 05d96cc936e36c1a3e286dabafd3aacec3262150 Mon Sep 17 00:00:00 2001 From: lishigao Date: Sun, 8 Oct 2023 07:22:41 +0000 Subject: [PATCH 04/28] third modify Signed-off-by: lishigao --- codec/v1_0/BUILD.gn | 1 + codec/v1_0/OmxExt.idl | 317 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 318 insertions(+) create mode 100644 codec/v1_0/OmxExt.idl diff --git a/codec/v1_0/BUILD.gn b/codec/v1_0/BUILD.gn index 6de4ce09..d7f813aa 100644 --- a/codec/v1_0/BUILD.gn +++ b/codec/v1_0/BUILD.gn @@ -26,6 +26,7 @@ if (defined(ohos_lite)) { "ICodecCallback.idl", "ICodecComponent.idl", "ICodecComponentManager.idl", + "OmxExt.idl" ] language = "cpp" subsystem_name = "hdf" diff --git a/codec/v1_0/OmxExt.idl b/codec/v1_0/OmxExt.idl new file mode 100644 index 00000000..27585e11 --- /dev/null +++ b/codec/v1_0/OmxExt.idl @@ -0,0 +1,317 @@ +/* + * Copyright (c) 2022-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. + */ + + package ohos.hdi.codec.v1_0; + + enum OMX_COLOR_FORAMTTYPE { + OMX_COLOR_FormatVendorStartUnused = 0x7F000000; + } + + enum OMX_INDEXTYPE { + OMX_IndexKhronosExtensions = 0x6F000000; + OMX_IndexOtherStartUnused = 0x08000000; + OMX_IndexVendorStartUnused = 0x7F000000; + } + + /** + * @brief Defines the OMX_VERSIONTYPE. + */ + struct NversionPara { + unsigned char nVersionMajor; /**< Major version accessor element */ + unsigned char nVersionMinor; /**< Minor version accessor element */ + unsigned char nRevision; /**< Revision version accessor element */ + unsigned char nStep; /**< Step version accessor element */ + }; + + union OMX_VERSIONTYPE { + struct NversionPara s; + int nVersion; /**< 32 bit value to make accessing the + version easily done in a single word + size copy/compare operation */ + }; + + /** + * @brief Enumerates the extended codec codingtyps. + */ + enum CodecVideoExType { + CODEC_OMX_VIDEO_CodingVP9 = 10, /** VP9 Index in Codec HDI */ + CODEC_OMX_VIDEO_CodingHEVC = 11, /** HEVC Index in Codec HDI */ + }; + + /** + * @brief Enumerates the extended HEVC profile. + */ + enum CodecHevcProfile { + CODEC_HEVC_PROFILE_INVALID = 0x0, + CODEC_HEVC_PROFILE_MAIN = 0x1, + CODEC_HEVC_PROFILE_MAIN10 = 0x2, + CODEC_HEVC_PROFILE_MAIN_STILL = 0x3, + // main_10 profile with HDR SEI support. + CODEC_HEVC_PROFILE_MAIN10_HDR10 = 0x1000, + CODEC_HEVC_PROFILE_MAIN10_HDR10_PLUS = 0x2000, + CODEC_HEVC_PROFILE_MAX = 0x7FFFFFFF + }; + + /** + * @brief Enumerates the extended HEVC level. + */ +enum CodecHevcLevel { + CODEC_HEVC_LEVEL_INVALID = 0x0, + CODEC_HEVC_MAIN_TIER_LEVEL1 = 0x1, + CODEC_HEVC_HIGH_TIER_LEVEL1 = 0x2, + CODEC_HEVC_MAIN_TIER_LEVEL2 = 0x4, + CODEC_HEVC_HIGH_TIER_LEVEL2 = 0x8, + CODEC_HEVC_MAIN_TIER_LEVEL21 = 0x10, + CODEC_HEVC_HIGH_TIER_LEVEL21 = 0x20, + CODEC_HEVC_MAIN_TIER_LEVEL3 = 0x40, + CODEC_HEVC_HIGH_TIER_LEVEL3 = 0x80, + CODEC_HEVC_MAIN_TIER_LEVEL31 = 0x100, + CODEC_HEVC_HIGH_TIER_LEVEL31 = 0x200, + CODEC_HEVC_MAIN_TIER_LEVEL4 = 0x400, + CODEC_HEVC_HIGH_TIER_LEVEL4 = 0x800, + CODEC_HEVC_MAIN_TIER_LEVEL41 = 0x1000, + CODEC_HEVC_HIGH_TIER_LEVEL41 = 0x2000, + CODEC_HEVC_MAIN_TIER_LEVEL5 = 0x4000, + CODEC_HEVC_HIGH_TIER_LEVEL5 = 0x8000, + CODEC_HEVC_MAIN_TIER_LEVEL51 = 0x10000, + CODEC_HEVC_HIGH_TIER_LEVEL51 = 0x20000, + CODEC_HEVC_MAIN_TIER_LEVEL52 = 0x40000, + CODEC_HEVC_HIGH_TIER_LEVEL52 = 0x80000, + CODEC_HEVC_MAIN_TIER_LEVEL6 = 0x100000, + CODEC_HEVC_HIGH_TIER_LEVEL6 = 0x200000, + CODEC_HEVC_MAIN_TIER_LEVEL61 = 0x400000, + CODEC_HEVC_HIGH_TIER_LEVEL61 = 0x800000, + CODEC_HEVC_MAIN_TIER_LEVEL62 = 0x1000000, + CODEC_HEVC_HIGH_TIER_LEVEL62 = 0x2000000, + CODEC_HEVC_HIGH_TIER_MAX = 0x7FFFFFFF + }; + + /** + * @brief Enumerates the extended codec color format. + */ +enum CodecColorFormatExt { + CODEC_COLOR_FORMAT_RGBA8888 = OMX_COLOR_FormatVendorStartUnused + 100, + }; + + /** + * @brief Enumerates the buffer types. + */ +enum CodecBufferType { + /** Invalid buffer type. */ + CODEC_BUFFER_TYPE_INVALID = 0, + /** Virtual address type. */ + CODEC_BUFFER_TYPE_VIRTUAL_ADDR = 0x1, + /** Shared memory. */ + CODEC_BUFFER_TYPE_AVSHARE_MEM_FD = 0x2, + /** Handle. */ + CODEC_BUFFER_TYPE_HANDLE = 0x4, + /** Dynamic handle. */ + CODEC_BUFFER_TYPE_DYNAMIC_HANDLE = 0x8, + }; + + /** + * @brief Defines the SupportBuffer. + */ +struct SupportBufferType { + unsigned int size; /** Size of the structure */ + union OMX_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned int bufferTypes; /** Supported buffer types */ + }; + + /** + * @brief Define the UseBuffer. + */ +struct UseBufferType { + unsigned int size; /** Size of the structure */ + union OMX_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned int bufferType; /** Buffer type */ + }; + + /** + * @brief Defines the BufferHandleUsage. + */ + struct GetBufferHandleUsageParams { + unsigned int size; /** Size of the structure */ + union OMX_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned long usage; /** Usage */ + }; + + /** + * @brief Defines the CodecVideoPortFormatParam. + */ + struct CodecVideoPortFormatParam { + unsigned int size; /** Size of the structure */ + union OMX_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned int codecColorIndex; /** Color format index */ + unsigned int codecColorFormat; /** Color format defined in Display */ + unsigned int codecCompressFormat; /** See */ + unsigned int framerate; /** Q16 format */ + }; + + /** + * @brief Defines the ControlRateConstantQuality. + */ + struct ControlRateConstantQuality { + unsigned int size; /** Size of the structure */ + union OMX_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned int qualityValue; /** Control rate constant quality */ + }; + + /** + * @brief Defines the PassthroughParam. + */ + struct PassthroughParam { + int32_t key; /**< Parameter type index */ + btye val; /**< Pointer to the parameter value */ + int size; /**< Parameter value size */ + }; + /** + * @brief Enumerates the extended codec indexes. + */ + enum OmxIndexCodecExType { + /** Extended BufferType index */ + OMX_IndexExtBufferTypeStartUnused = OMX_IndexKhronosExtensions + 0x00a00000, + /** SupportBuffer */ + OMX_IndexParamSupportBufferType, + /** UseBuffer */ + OMX_IndexParamUseBufferType, + /** GetBufferHandleUsage */ + OMX_IndexParamGetBufferHandleUsage, + /** CodecVideoPortFormatParam */ + OMX_IndexCodecVideoPortFormat, + /** ControlRateConstantQuality */ + OMX_IndexParamControlRateConstantQuality, + /** PassthroughParam */ + OMX_IndexParamPassthrough, + /** OMX_IndexParamVideoHevc */ + OMX_IndexParamVideoHevc, + /** range/primary/transfer/matrix */ + OMX_IndexColorAspects, + }; + + /** + * @brief Enumerates the Other extended codec indexes. + */ + enum OmxIndexCodecOtherExtType { + /** Extended Config AutoFramerate Conversion */ + OMX_IndexCodecExtConfigAutoFramerateConversion = OMX_IndexOtherStartUnused + 0x1, + /** Extended Config Priority */ + OMX_IndexCodecExtConfigPriority, + /** Extended Config OperatingRate index */ + OMX_IndexCodecExtConfigOperatingRate, + }; + + enum OmxIndexCodecVendorExtType { + /** Extended Channel Attributes index */ + OMX_IndexCodecExtChannelAttributes = OMX_IndexVendorStartUnused + 0x1, + /** CodecEnableNativeBufferParams */ + OMX_IndexCodecExtEnableNativeBuffer, + }; + + /** + * @brief Structure for controlling HEVC video encoding + */ + struct CodecVideoParamHevc { + unsigned int size; /** Size of the structure */ + union OMX_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + enum CodecHevcProfile profile; /** Hevc profile. For details, see {@link CodecHevcProfile}. */ + enum CodecHevcLevel level; /** Hevc level. For details, see {@link CodecHevcLevel}. */ + unsigned int keyFrameInterval; /** Distance between consecutive I-frames (including one of the I frams). + 0 means interval is unspecified and can be freely chosen by the codec. + 1 means a stream of only I frams. other means the real value. */ + }; + + /** + * @brief Defines the CodecEnableNativeBufferParams. + */ + struct CodecEnableNativeBufferParams { + unsigned int size; /** Size of the structure */ + union OMX_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + boolean enable; /** Enable NativeBuffer */ + }; + + enum RangeType { + RANGE_UNSPECIFIED, + RANGE_FULL, + RANGE_LIMITED, + RANGE_MAX = 0xff, + }; + + enum Primaries { + PRIMARIES_UNSPECIFIED, + PRIMARIES_BT709, //Rec. ITU-R BT.709-6 + PRIMARIES_BT470_6M, //Rec. ITU-R BT.470-6 System M + PRIMARIES_BT601_625, //Rec. ITU-R BT.601-7 625 or Rec. ITU-R BT.470-6 System B,G + PRIMARIES_BT601_525, //Rec. ITU-R BT.601-7 525 or SMPTE ST 170 or SMPTE ST 240 + PRIMARIES_GENERICFILM, //Generic Film + PRIMARIES_BT2020, //Rec. ITU-R BT.2020-2 or Rec. ITU-R BT.2100-2 + PRIMARIES_MAX = 0xff, + }; + + enum Transfer { + TRANSFER_UNSPECIFIED, + TRANSFER_LINEAR, //Linear transfer characteristics + TRANSFER_SRGB, //IEC 61966-2-1 sRGB + TRANSFER_SMPTE170, //SMPTE ST 170 or Rec. ITU-R BT.709-6 or BT.601-7 or BT.2020-2 + TRANSFER_GAMMA22, //Rec. ITU-R BT.470-6 System M + TRANSFER_GAMMA28, //Rec. ITU-R BT.470-6 System B,G + TRANSFER_PQ, //Rec. ITU-R BT.2100-2 perceptual quantization (PQ) system + TRANSFER_HLG, //Rec. ITU-R BT.2100-2 hybrid log gamma (HLG) system + TRANSFER_SMPTE240 = 0x40, //SMPTE ST 240 + TRANSFER_XVYCC, //IEC 61966-2-4 + TRANSFER_BT1361, //Rec. ITU-R BT.1361-0 extended colour gamut system + TRANSFER_ST428, //SMPTE ST 428-1 + TRANSFER_MAX = 0xff, + }; + + enum MatrixCoeffs { + MATRIX_UNSPECIFED, + MATRIX_BT709, //Rec. ITU-R BT.709-6 + MATRIX_FCC, //United States Federal Communications Commission + MATRIX_BT601, //Rec. ITU-R BT.601-7 or Rec. ITU-R BT.470-6 System B,G + MATRIX_SMPTE240, //SMPTE ST 240 + MATRIX_BT2020, //Rec. ITU-R BT.2100-2 (non-constant luminance) + MATRIX_BT2020CONSTANT, //Rec. ITU-R BT.2100-2 (constant luminance) + MATRIX_MAX = 0xff, + }; + + struct ColorAspects { + enum RangeType range; + enum Primaries primaries; + enum Transfer transfer; + enum MatrixCoeffs matrixCoeffs; + }; + + /** + * @brief Structure for controlling color space + */ + struct CodecVideoColorspace { + unsigned int size; /** Size of the structure */ + union OMX_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned int requestingDataSpace; + unsigned int dataSpaceChanged; + unsigned int pixeFormat; + unsigned int dataSpace; + struct ColorAspects aspects; + }; + -- Gitee From e6a3072b943aadf0956531caefddd6f788cf10db Mon Sep 17 00:00:00 2001 From: lishigao Date: Sun, 8 Oct 2023 08:27:49 +0000 Subject: [PATCH 05/28] four modify Signed-off-by: lishigao --- codec/v1_0/BUILD.gn | 2 +- codec/v1_0/CodedcExtTypes.idl | 318 ++++++++++++++++++++++++++++++++++ codec/v1_0/OmxExt.idl | 317 --------------------------------- codec/v1_0/omxExt.idl | 317 --------------------------------- 4 files changed, 319 insertions(+), 635 deletions(-) create mode 100644 codec/v1_0/CodedcExtTypes.idl delete mode 100644 codec/v1_0/OmxExt.idl delete mode 100644 codec/v1_0/omxExt.idl diff --git a/codec/v1_0/BUILD.gn b/codec/v1_0/BUILD.gn index d7f813aa..9e154e7a 100644 --- a/codec/v1_0/BUILD.gn +++ b/codec/v1_0/BUILD.gn @@ -26,7 +26,7 @@ if (defined(ohos_lite)) { "ICodecCallback.idl", "ICodecComponent.idl", "ICodecComponentManager.idl", - "OmxExt.idl" + "CodecExtTypes.idl" ] language = "cpp" subsystem_name = "hdf" diff --git a/codec/v1_0/CodedcExtTypes.idl b/codec/v1_0/CodedcExtTypes.idl new file mode 100644 index 00000000..3e6a7ff5 --- /dev/null +++ b/codec/v1_0/CodedcExtTypes.idl @@ -0,0 +1,318 @@ +/* + * Copyright (c) 2022-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. + */ + +package ohos.hdi.codec.v1_0; + +enum OMX_COLOR_FORAMTTYPE { + OMX_COLOR_FormatVendorStartUnused = 0x7F000000; +}; + +enum OMX_INDEXTYPE { + OMX_IndexKhronosExtensions = 0x6F000000; + OMX_IndexOtherStartUnused = 0x08000000; + OMX_IndexVendorStartUnused = 0x7F000000; +}; + +/** + * @brief Defines the OMX_VERSIONTYPE. + */ +struct NversionPara { + unsigned char nVersionMajor; /**< Major version accessor element */ + unsigned char nVersionMinor; /**< Minor version accessor element */ + unsigned char nRevision; /**< Revision version accessor element */ + unsigned char nStep; /**< Step version accessor element */ +}; + +union OMX_VERSIONTYPE { + struct NversionPara s; + int nVersion; /**< 32 bit value to make accessing the + version easily done in a single word + size copy/compare operation */ +}; + +/** + * @brief Enumerates the extended codec codingtyps. + */ +enum CodecVideoExType { + CODEC_OMX_VIDEO_CodingVP9 = 10, /** VP9 Index in Codec HDI */ + CODEC_OMX_VIDEO_CodingHEVC = 11, /** HEVC Index in Codec HDI */ +}; + +/** + * @brief Enumerates the extended HEVC profile. + */ +enum CodecHevcProfile { + CODEC_HEVC_PROFILE_INVALID = 0x0, + CODEC_HEVC_PROFILE_MAIN = 0x1, + CODEC_HEVC_PROFILE_MAIN10 = 0x2, + CODEC_HEVC_PROFILE_MAIN_STILL = 0x3, + // main_10 profile with HDR SEI support. + CODEC_HEVC_PROFILE_MAIN10_HDR10 = 0x1000, + CODEC_HEVC_PROFILE_MAIN10_HDR10_PLUS = 0x2000, + CODEC_HEVC_PROFILE_MAX = 0x7FFFFFFF +}; + +/** + * @brief Enumerates the extended HEVC level. + */ +enum CodecHevcLevel { + CODEC_HEVC_LEVEL_INVALID = 0x0, + CODEC_HEVC_MAIN_TIER_LEVEL1 = 0x1, + CODEC_HEVC_HIGH_TIER_LEVEL1 = 0x2, + CODEC_HEVC_MAIN_TIER_LEVEL2 = 0x4, + CODEC_HEVC_HIGH_TIER_LEVEL2 = 0x8, + CODEC_HEVC_MAIN_TIER_LEVEL21 = 0x10, + CODEC_HEVC_HIGH_TIER_LEVEL21 = 0x20, + CODEC_HEVC_MAIN_TIER_LEVEL3 = 0x40, + CODEC_HEVC_HIGH_TIER_LEVEL3 = 0x80, + CODEC_HEVC_MAIN_TIER_LEVEL31 = 0x100, + CODEC_HEVC_HIGH_TIER_LEVEL31 = 0x200, + CODEC_HEVC_MAIN_TIER_LEVEL4 = 0x400, + CODEC_HEVC_HIGH_TIER_LEVEL4 = 0x800, + CODEC_HEVC_MAIN_TIER_LEVEL41 = 0x1000, + CODEC_HEVC_HIGH_TIER_LEVEL41 = 0x2000, + CODEC_HEVC_MAIN_TIER_LEVEL5 = 0x4000, + CODEC_HEVC_HIGH_TIER_LEVEL5 = 0x8000, + CODEC_HEVC_MAIN_TIER_LEVEL51 = 0x10000, + CODEC_HEVC_HIGH_TIER_LEVEL51 = 0x20000, + CODEC_HEVC_MAIN_TIER_LEVEL52 = 0x40000, + CODEC_HEVC_HIGH_TIER_LEVEL52 = 0x80000, + CODEC_HEVC_MAIN_TIER_LEVEL6 = 0x100000, + CODEC_HEVC_HIGH_TIER_LEVEL6 = 0x200000, + CODEC_HEVC_MAIN_TIER_LEVEL61 = 0x400000, + CODEC_HEVC_HIGH_TIER_LEVEL61 = 0x800000, + CODEC_HEVC_MAIN_TIER_LEVEL62 = 0x1000000, + CODEC_HEVC_HIGH_TIER_LEVEL62 = 0x2000000, + CODEC_HEVC_HIGH_TIER_MAX = 0x7FFFFFFF +}; + +/** + * @brief Enumerates the extended codec color format. + */ +enum CodecColorFormatExt { + CODEC_COLOR_FORMAT_RGBA8888 = OMX_COLOR_FormatVendorStartUnused + 100, +}; + +/** + * @brief Enumerates the buffer types. + */ +enum CodecBufferType { + /** Invalid buffer type. */ + CODEC_BUFFER_TYPE_INVALID = 0, + /** Virtual address type. */ + CODEC_BUFFER_TYPE_VIRTUAL_ADDR = 0x1, + /** Shared memory. */ + CODEC_BUFFER_TYPE_AVSHARE_MEM_FD = 0x2, + /** Handle. */ + CODEC_BUFFER_TYPE_HANDLE = 0x4, + /** Dynamic handle. */ + CODEC_BUFFER_TYPE_DYNAMIC_HANDLE = 0x8, +}; + +/** + * @brief Defines the SupportBuffer. + */ +struct SupportBufferType { + unsigned int size; /** Size of the structure */ + union OMX_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned int bufferTypes; /** Supported buffer types */ +}; + +/** + * @brief Define the UseBuffer. + */ +struct UseBufferType { + unsigned int size; /** Size of the structure */ + union OMX_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned int bufferType; /** Buffer type */ +}; + +/** + * @brief Defines the BufferHandleUsage. + */ +struct GetBufferHandleUsageParams { + unsigned int size; /** Size of the structure */ + union OMX_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned long usage; /** Usage */ +}; + +/** + * @brief Defines the CodecVideoPortFormatParam. + */ +struct CodecVideoPortFormatParam { + unsigned int size; /** Size of the structure */ + union OMX_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned int codecColorIndex; /** Color format index */ + unsigned int codecColorFormat; /** Color format defined in Display */ + unsigned int codecCompressFormat; /** See */ + unsigned int framerate; /** Q16 format */ +}; + +/** + * @brief Defines the ControlRateConstantQuality. + */ +struct ControlRateConstantQuality { + unsigned int size; /** Size of the structure */ + union OMX_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned int qualityValue; /** Control rate constant quality */ +}; + +/** + * @brief Defines the PassthroughParam. + */ +struct PassthroughParam { + int32_t key; /**< Parameter type index */ + btye val; /**< Pointer to the parameter value */ + int size; /**< Parameter value size */ +}; + +/** + * @brief Enumerates the extended codec indexes. + */ +enum OmxIndexCodecExType { + /** Extended BufferType index */ + OMX_IndexExtBufferTypeStartUnused = OMX_IndexKhronosExtensions + 0x00a00000, + /** SupportBuffer */ + OMX_IndexParamSupportBufferType, + /** UseBuffer */ + OMX_IndexParamUseBufferType, + /** GetBufferHandleUsage */ + OMX_IndexParamGetBufferHandleUsage, + /** CodecVideoPortFormatParam */ + OMX_IndexCodecVideoPortFormat, + /** ControlRateConstantQuality */ + OMX_IndexParamControlRateConstantQuality, + /** PassthroughParam */ + OMX_IndexParamPassthrough, + /** OMX_IndexParamVideoHevc */ + OMX_IndexParamVideoHevc, + /** range/primary/transfer/matrix */ + OMX_IndexColorAspects, +}; + +/** + * @brief Enumerates the Other extended codec indexes. + */ +enum OmxIndexCodecOtherExtType { + /** Extended Config AutoFramerate Conversion */ + OMX_IndexCodecExtConfigAutoFramerateConversion = OMX_IndexOtherStartUnused + 0x1, + /** Extended Config Priority */ + OMX_IndexCodecExtConfigPriority, + /** Extended Config OperatingRate index */ + OMX_IndexCodecExtConfigOperatingRate, +}; + +enum OmxIndexCodecVendorExtType { + /** Extended Channel Attributes index */ + OMX_IndexCodecExtChannelAttributes = OMX_IndexVendorStartUnused + 0x1, + /** CodecEnableNativeBufferParams */ + OMX_IndexCodecExtEnableNativeBuffer, +}; + +/** + * @brief Structure for controlling HEVC video encoding + */ +struct CodecVideoParamHevc { + unsigned int size; /** Size of the structure */ + union OMX_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + enum CodecHevcProfile profile; /** Hevc profile. For details, see {@link CodecHevcProfile}. */ + enum CodecHevcLevel level; /** Hevc level. For details, see {@link CodecHevcLevel}. */ + unsigned int keyFrameInterval; /** Distance between consecutive I-frames (including one of the I frams). + 0 means interval is unspecified and can be freely chosen by the codec. + 1 means a stream of only I frams. other means the real value. */ +}; + +/** + * @brief Defines the CodecEnableNativeBufferParams. + */ +struct CodecEnableNativeBufferParams { + unsigned int size; /** Size of the structure */ + union OMX_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + boolean enable; /** Enable NativeBuffer */ +}; + +enum RangeType { + RANGE_UNSPECIFIED, + RANGE_FULL, + RANGE_LIMITED, + RANGE_MAX = 0xff, +}; + +enum Primaries { + PRIMARIES_UNSPECIFIED, + PRIMARIES_BT709, //Rec. ITU-R BT.709-6 + PRIMARIES_BT470_6M, //Rec. ITU-R BT.470-6 System M + PRIMARIES_BT601_625, //Rec. ITU-R BT.601-7 625 or Rec. ITU-R BT.470-6 System B,G + PRIMARIES_BT601_525, //Rec. ITU-R BT.601-7 525 or SMPTE ST 170 or SMPTE ST 240 + PRIMARIES_GENERICFILM, //Generic Film + PRIMARIES_BT2020, //Rec. ITU-R BT.2020-2 or Rec. ITU-R BT.2100-2 + PRIMARIES_MAX = 0xff, +}; + +enum Transfer { + TRANSFER_UNSPECIFIED, + TRANSFER_LINEAR, //Linear transfer characteristics + TRANSFER_SRGB, //IEC 61966-2-1 sRGB + TRANSFER_SMPTE170, //SMPTE ST 170 or Rec. ITU-R BT.709-6 or BT.601-7 or BT.2020-2 + TRANSFER_GAMMA22, //Rec. ITU-R BT.470-6 System M + TRANSFER_GAMMA28, //Rec. ITU-R BT.470-6 System B,G + TRANSFER_PQ, //Rec. ITU-R BT.2100-2 perceptual quantization (PQ) system + TRANSFER_HLG, //Rec. ITU-R BT.2100-2 hybrid log gamma (HLG) system + TRANSFER_SMPTE240 = 0x40, //SMPTE ST 240 + TRANSFER_XVYCC, //IEC 61966-2-4 + TRANSFER_BT1361, //Rec. ITU-R BT.1361-0 extended colour gamut system + TRANSFER_ST428, //SMPTE ST 428-1 + TRANSFER_MAX = 0xff, +}; + +enum MatrixCoeffs { + MATRIX_UNSPECIFED, + MATRIX_BT709, //Rec. ITU-R BT.709-6 + MATRIX_FCC, //United States Federal Communications Commission + MATRIX_BT601, //Rec. ITU-R BT.601-7 or Rec. ITU-R BT.470-6 System B,G + MATRIX_SMPTE240, //SMPTE ST 240 + MATRIX_BT2020, //Rec. ITU-R BT.2100-2 (non-constant luminance) + MATRIX_BT2020CONSTANT, //Rec. ITU-R BT.2100-2 (constant luminance) + MATRIX_MAX = 0xff, +}; + +struct ColorAspects { + enum RangeType range; + enum Primaries primaries; + enum Transfer transfer; + enum MatrixCoeffs matrixCoeffs; +}; + +/** + * @brief Structure for controlling color space + */ +struct CodecVideoColorspace { + unsigned int size; /** Size of the structure */ + union OMX_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned int requestingDataSpace; + unsigned int dataSpaceChanged; + unsigned int pixeFormat; + unsigned int dataSpace; + struct ColorAspects aspects; +}; + diff --git a/codec/v1_0/OmxExt.idl b/codec/v1_0/OmxExt.idl deleted file mode 100644 index 27585e11..00000000 --- a/codec/v1_0/OmxExt.idl +++ /dev/null @@ -1,317 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ - - package ohos.hdi.codec.v1_0; - - enum OMX_COLOR_FORAMTTYPE { - OMX_COLOR_FormatVendorStartUnused = 0x7F000000; - } - - enum OMX_INDEXTYPE { - OMX_IndexKhronosExtensions = 0x6F000000; - OMX_IndexOtherStartUnused = 0x08000000; - OMX_IndexVendorStartUnused = 0x7F000000; - } - - /** - * @brief Defines the OMX_VERSIONTYPE. - */ - struct NversionPara { - unsigned char nVersionMajor; /**< Major version accessor element */ - unsigned char nVersionMinor; /**< Minor version accessor element */ - unsigned char nRevision; /**< Revision version accessor element */ - unsigned char nStep; /**< Step version accessor element */ - }; - - union OMX_VERSIONTYPE { - struct NversionPara s; - int nVersion; /**< 32 bit value to make accessing the - version easily done in a single word - size copy/compare operation */ - }; - - /** - * @brief Enumerates the extended codec codingtyps. - */ - enum CodecVideoExType { - CODEC_OMX_VIDEO_CodingVP9 = 10, /** VP9 Index in Codec HDI */ - CODEC_OMX_VIDEO_CodingHEVC = 11, /** HEVC Index in Codec HDI */ - }; - - /** - * @brief Enumerates the extended HEVC profile. - */ - enum CodecHevcProfile { - CODEC_HEVC_PROFILE_INVALID = 0x0, - CODEC_HEVC_PROFILE_MAIN = 0x1, - CODEC_HEVC_PROFILE_MAIN10 = 0x2, - CODEC_HEVC_PROFILE_MAIN_STILL = 0x3, - // main_10 profile with HDR SEI support. - CODEC_HEVC_PROFILE_MAIN10_HDR10 = 0x1000, - CODEC_HEVC_PROFILE_MAIN10_HDR10_PLUS = 0x2000, - CODEC_HEVC_PROFILE_MAX = 0x7FFFFFFF - }; - - /** - * @brief Enumerates the extended HEVC level. - */ -enum CodecHevcLevel { - CODEC_HEVC_LEVEL_INVALID = 0x0, - CODEC_HEVC_MAIN_TIER_LEVEL1 = 0x1, - CODEC_HEVC_HIGH_TIER_LEVEL1 = 0x2, - CODEC_HEVC_MAIN_TIER_LEVEL2 = 0x4, - CODEC_HEVC_HIGH_TIER_LEVEL2 = 0x8, - CODEC_HEVC_MAIN_TIER_LEVEL21 = 0x10, - CODEC_HEVC_HIGH_TIER_LEVEL21 = 0x20, - CODEC_HEVC_MAIN_TIER_LEVEL3 = 0x40, - CODEC_HEVC_HIGH_TIER_LEVEL3 = 0x80, - CODEC_HEVC_MAIN_TIER_LEVEL31 = 0x100, - CODEC_HEVC_HIGH_TIER_LEVEL31 = 0x200, - CODEC_HEVC_MAIN_TIER_LEVEL4 = 0x400, - CODEC_HEVC_HIGH_TIER_LEVEL4 = 0x800, - CODEC_HEVC_MAIN_TIER_LEVEL41 = 0x1000, - CODEC_HEVC_HIGH_TIER_LEVEL41 = 0x2000, - CODEC_HEVC_MAIN_TIER_LEVEL5 = 0x4000, - CODEC_HEVC_HIGH_TIER_LEVEL5 = 0x8000, - CODEC_HEVC_MAIN_TIER_LEVEL51 = 0x10000, - CODEC_HEVC_HIGH_TIER_LEVEL51 = 0x20000, - CODEC_HEVC_MAIN_TIER_LEVEL52 = 0x40000, - CODEC_HEVC_HIGH_TIER_LEVEL52 = 0x80000, - CODEC_HEVC_MAIN_TIER_LEVEL6 = 0x100000, - CODEC_HEVC_HIGH_TIER_LEVEL6 = 0x200000, - CODEC_HEVC_MAIN_TIER_LEVEL61 = 0x400000, - CODEC_HEVC_HIGH_TIER_LEVEL61 = 0x800000, - CODEC_HEVC_MAIN_TIER_LEVEL62 = 0x1000000, - CODEC_HEVC_HIGH_TIER_LEVEL62 = 0x2000000, - CODEC_HEVC_HIGH_TIER_MAX = 0x7FFFFFFF - }; - - /** - * @brief Enumerates the extended codec color format. - */ -enum CodecColorFormatExt { - CODEC_COLOR_FORMAT_RGBA8888 = OMX_COLOR_FormatVendorStartUnused + 100, - }; - - /** - * @brief Enumerates the buffer types. - */ -enum CodecBufferType { - /** Invalid buffer type. */ - CODEC_BUFFER_TYPE_INVALID = 0, - /** Virtual address type. */ - CODEC_BUFFER_TYPE_VIRTUAL_ADDR = 0x1, - /** Shared memory. */ - CODEC_BUFFER_TYPE_AVSHARE_MEM_FD = 0x2, - /** Handle. */ - CODEC_BUFFER_TYPE_HANDLE = 0x4, - /** Dynamic handle. */ - CODEC_BUFFER_TYPE_DYNAMIC_HANDLE = 0x8, - }; - - /** - * @brief Defines the SupportBuffer. - */ -struct SupportBufferType { - unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ - unsigned int portIndex; /** Port index */ - unsigned int bufferTypes; /** Supported buffer types */ - }; - - /** - * @brief Define the UseBuffer. - */ -struct UseBufferType { - unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ - unsigned int portIndex; /** Port index */ - unsigned int bufferType; /** Buffer type */ - }; - - /** - * @brief Defines the BufferHandleUsage. - */ - struct GetBufferHandleUsageParams { - unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ - unsigned int portIndex; /** Port index */ - unsigned long usage; /** Usage */ - }; - - /** - * @brief Defines the CodecVideoPortFormatParam. - */ - struct CodecVideoPortFormatParam { - unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ - unsigned int portIndex; /** Port index */ - unsigned int codecColorIndex; /** Color format index */ - unsigned int codecColorFormat; /** Color format defined in Display */ - unsigned int codecCompressFormat; /** See */ - unsigned int framerate; /** Q16 format */ - }; - - /** - * @brief Defines the ControlRateConstantQuality. - */ - struct ControlRateConstantQuality { - unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ - unsigned int portIndex; /** Port index */ - unsigned int qualityValue; /** Control rate constant quality */ - }; - - /** - * @brief Defines the PassthroughParam. - */ - struct PassthroughParam { - int32_t key; /**< Parameter type index */ - btye val; /**< Pointer to the parameter value */ - int size; /**< Parameter value size */ - }; - /** - * @brief Enumerates the extended codec indexes. - */ - enum OmxIndexCodecExType { - /** Extended BufferType index */ - OMX_IndexExtBufferTypeStartUnused = OMX_IndexKhronosExtensions + 0x00a00000, - /** SupportBuffer */ - OMX_IndexParamSupportBufferType, - /** UseBuffer */ - OMX_IndexParamUseBufferType, - /** GetBufferHandleUsage */ - OMX_IndexParamGetBufferHandleUsage, - /** CodecVideoPortFormatParam */ - OMX_IndexCodecVideoPortFormat, - /** ControlRateConstantQuality */ - OMX_IndexParamControlRateConstantQuality, - /** PassthroughParam */ - OMX_IndexParamPassthrough, - /** OMX_IndexParamVideoHevc */ - OMX_IndexParamVideoHevc, - /** range/primary/transfer/matrix */ - OMX_IndexColorAspects, - }; - - /** - * @brief Enumerates the Other extended codec indexes. - */ - enum OmxIndexCodecOtherExtType { - /** Extended Config AutoFramerate Conversion */ - OMX_IndexCodecExtConfigAutoFramerateConversion = OMX_IndexOtherStartUnused + 0x1, - /** Extended Config Priority */ - OMX_IndexCodecExtConfigPriority, - /** Extended Config OperatingRate index */ - OMX_IndexCodecExtConfigOperatingRate, - }; - - enum OmxIndexCodecVendorExtType { - /** Extended Channel Attributes index */ - OMX_IndexCodecExtChannelAttributes = OMX_IndexVendorStartUnused + 0x1, - /** CodecEnableNativeBufferParams */ - OMX_IndexCodecExtEnableNativeBuffer, - }; - - /** - * @brief Structure for controlling HEVC video encoding - */ - struct CodecVideoParamHevc { - unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ - unsigned int portIndex; /** Port index */ - enum CodecHevcProfile profile; /** Hevc profile. For details, see {@link CodecHevcProfile}. */ - enum CodecHevcLevel level; /** Hevc level. For details, see {@link CodecHevcLevel}. */ - unsigned int keyFrameInterval; /** Distance between consecutive I-frames (including one of the I frams). - 0 means interval is unspecified and can be freely chosen by the codec. - 1 means a stream of only I frams. other means the real value. */ - }; - - /** - * @brief Defines the CodecEnableNativeBufferParams. - */ - struct CodecEnableNativeBufferParams { - unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ - unsigned int portIndex; /** Port index */ - boolean enable; /** Enable NativeBuffer */ - }; - - enum RangeType { - RANGE_UNSPECIFIED, - RANGE_FULL, - RANGE_LIMITED, - RANGE_MAX = 0xff, - }; - - enum Primaries { - PRIMARIES_UNSPECIFIED, - PRIMARIES_BT709, //Rec. ITU-R BT.709-6 - PRIMARIES_BT470_6M, //Rec. ITU-R BT.470-6 System M - PRIMARIES_BT601_625, //Rec. ITU-R BT.601-7 625 or Rec. ITU-R BT.470-6 System B,G - PRIMARIES_BT601_525, //Rec. ITU-R BT.601-7 525 or SMPTE ST 170 or SMPTE ST 240 - PRIMARIES_GENERICFILM, //Generic Film - PRIMARIES_BT2020, //Rec. ITU-R BT.2020-2 or Rec. ITU-R BT.2100-2 - PRIMARIES_MAX = 0xff, - }; - - enum Transfer { - TRANSFER_UNSPECIFIED, - TRANSFER_LINEAR, //Linear transfer characteristics - TRANSFER_SRGB, //IEC 61966-2-1 sRGB - TRANSFER_SMPTE170, //SMPTE ST 170 or Rec. ITU-R BT.709-6 or BT.601-7 or BT.2020-2 - TRANSFER_GAMMA22, //Rec. ITU-R BT.470-6 System M - TRANSFER_GAMMA28, //Rec. ITU-R BT.470-6 System B,G - TRANSFER_PQ, //Rec. ITU-R BT.2100-2 perceptual quantization (PQ) system - TRANSFER_HLG, //Rec. ITU-R BT.2100-2 hybrid log gamma (HLG) system - TRANSFER_SMPTE240 = 0x40, //SMPTE ST 240 - TRANSFER_XVYCC, //IEC 61966-2-4 - TRANSFER_BT1361, //Rec. ITU-R BT.1361-0 extended colour gamut system - TRANSFER_ST428, //SMPTE ST 428-1 - TRANSFER_MAX = 0xff, - }; - - enum MatrixCoeffs { - MATRIX_UNSPECIFED, - MATRIX_BT709, //Rec. ITU-R BT.709-6 - MATRIX_FCC, //United States Federal Communications Commission - MATRIX_BT601, //Rec. ITU-R BT.601-7 or Rec. ITU-R BT.470-6 System B,G - MATRIX_SMPTE240, //SMPTE ST 240 - MATRIX_BT2020, //Rec. ITU-R BT.2100-2 (non-constant luminance) - MATRIX_BT2020CONSTANT, //Rec. ITU-R BT.2100-2 (constant luminance) - MATRIX_MAX = 0xff, - }; - - struct ColorAspects { - enum RangeType range; - enum Primaries primaries; - enum Transfer transfer; - enum MatrixCoeffs matrixCoeffs; - }; - - /** - * @brief Structure for controlling color space - */ - struct CodecVideoColorspace { - unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ - unsigned int portIndex; /** Port index */ - unsigned int requestingDataSpace; - unsigned int dataSpaceChanged; - unsigned int pixeFormat; - unsigned int dataSpace; - struct ColorAspects aspects; - }; - diff --git a/codec/v1_0/omxExt.idl b/codec/v1_0/omxExt.idl deleted file mode 100644 index 9e06f3c8..00000000 --- a/codec/v1_0/omxExt.idl +++ /dev/null @@ -1,317 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ - - package ohos.hdi.codec.v1_0; - - enum OMX_COLOR_FORAMTTYPE { - OMX_COLOR_FormatVendorStartUnused = 0x7F000000; - } - - enum OMX_INDEXTYPE { - OMX_IndexKhronosExtensions = 0x6F000000; - OMX_IndexOtherStartUnused = 0x08000000; - OMX_IndexVendorStartUnused = 0x7F000000; - } - - /** - * @brief Defines the OMX_VERSIONTYPE. - */ - struct NversionPara { - unsigned char nVersionMajor; /**< Major version accessor element */ - unsigned char nVersionMinor; /**< Minor version accessor element */ - unsigned char nRevision; /**< Revision version accessor element */ - unsigned char nStep; /**< Step version accessor element */ - }; - - union OMX_VERSIONTYPE { - struct NversionPara s; - int nVersion; /**< 32 bit value to make accessing the - version easily done in a single word - size copy/compare operation */ - }; - - /** - * @brief Enumerates the extended codec codingtyps. - */ - enum CodecVideoExType { - CODEC_OMX_VIDEO_CodingVP9 = 10, /** VP9 Index in Codec HDI */ - CODEC_OMX_VIDEO_CodingHEVC = 11, /** HEVC Index in Codec HDI */ - }; - - /** - * @brief Enumerates the extended HEVC profile. - */ - enum CodecHevcProfile { - CODEC_HEVC_PROFILE_INVALID = 0x0, - CODEC_HEVC_PROFILE_MAIN = 0x1, - CODEC_HEVC_PROFILE_MAIN10 = 0x2, - CODEC_HEVC_PROFILE_MAIN_STILL = 0x3, - // main_10 profile with HDR SEI support. - CODEC_HEVC_PROFILE_MAIN10_HDR10 = 0x1000, - CODEC_HEVC_PROFILE_MAIN10_HDR10_PLUS = 0x2000, - CODEC_HEVC_PROFILE_MAX = 0x7FFFFFFF - }; - - /** - * @brief Enumerates the extended HEVC level. - */ -enum CodecHevcLevel { - CODEC_HEVC_LEVEL_INVALID = 0x0, - CODEC_HEVC_MAIN_TIER_LEVEL1 = 0x1, - CODEC_HEVC_HIGH_TIER_LEVEL1 = 0x2, - CODEC_HEVC_MAIN_TIER_LEVEL2 = 0x4, - CODEC_HEVC_HIGH_TIER_LEVEL2 = 0x8, - CODEC_HEVC_MAIN_TIER_LEVEL21 = 0x10, - CODEC_HEVC_HIGH_TIER_LEVEL21 = 0x20, - CODEC_HEVC_MAIN_TIER_LEVEL3 = 0x40, - CODEC_HEVC_HIGH_TIER_LEVEL3 = 0x80, - CODEC_HEVC_MAIN_TIER_LEVEL31 = 0x100, - CODEC_HEVC_HIGH_TIER_LEVEL31 = 0x200, - CODEC_HEVC_MAIN_TIER_LEVEL4 = 0x400, - CODEC_HEVC_HIGH_TIER_LEVEL4 = 0x800, - CODEC_HEVC_MAIN_TIER_LEVEL41 = 0x1000, - CODEC_HEVC_HIGH_TIER_LEVEL41 = 0x2000, - CODEC_HEVC_MAIN_TIER_LEVEL5 = 0x4000, - CODEC_HEVC_HIGH_TIER_LEVEL5 = 0x8000, - CODEC_HEVC_MAIN_TIER_LEVEL51 = 0x10000, - CODEC_HEVC_HIGH_TIER_LEVEL51 = 0x20000, - CODEC_HEVC_MAIN_TIER_LEVEL52 = 0x40000, - CODEC_HEVC_HIGH_TIER_LEVEL52 = 0x80000, - CODEC_HEVC_MAIN_TIER_LEVEL6 = 0x100000, - CODEC_HEVC_HIGH_TIER_LEVEL6 = 0x200000, - CODEC_HEVC_MAIN_TIER_LEVEL61 = 0x400000, - CODEC_HEVC_HIGH_TIER_LEVEL61 = 0x800000, - CODEC_HEVC_MAIN_TIER_LEVEL62 = 0x1000000, - CODEC_HEVC_HIGH_TIER_LEVEL62 = 0x2000000, - CODEC_HEVC_HIGH_TIER_MAX = 0x7FFFFFFF - }; - - /** - * @brief Enumerates the extended codec color format. - */ -enum CodecColorFormatExt { - CODEC_COLOR_FORMAT_RGBA8888 = OMX_COLOR_FormatVendorStartUnused + 100, - }; - - /** - * @brief Enumerates the buffer types. - */ -enum CodecBufferType { - /** Invalid buffer type. */ - CODEC_BUFFER_TYPE_INVALID = 0, - /** Virtual address type. */ - CODEC_BUFFER_TYPE_VIRTUAL_ADDR = 0x1, - /** Shared memory. */ - CODEC_BUFFER_TYPE_AVSHARE_MEM_FD = 0x2, - /** Handle. */ - CODEC_BUFFER_TYPE_HANDLE = 0x4, - /** Dynamic handle. */ - CODEC_BUFFER_TYPE_DYNAMIC_HANDLE = 0x8, - }; - - /** - * @brief Defines the SupportBuffer. - */ -struct SupportBufferType { - unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ - unsigned int portIndex; /** Port index */ - unsigned int bufferTypes; /** Supported buffer types */ - }; - - /** - * @brief Define the UseBuffer. - */ -struct UseBufferType { - unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ - unsigned int portIndex; /** Port index */ - unsigned int bufferType; /** Buffer type */ - }; - - /** - * @brief Defines the BufferHandleUsage. - */ - struct GetBufferHandleUsageParams { - unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ - unsigned int portIndex; /** Port index */ - unsigned long usage; /** Usage */ - }; - - /** - * @brief Defines the CodecVideoPortFormatParam. - */ - struct CodecVideoPortFormatParam { - unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ - unsigned int portIndex; /** Port index */ - unsigned int codecColorIndex; /** Color format index */ - unsigned int codecColorFormat; /** Color format defined in Display */ - unsigned int codecCompressFormat; /** See */ - unsigned int framerate; /** Q16 format */ - }; - - /** - * @brief Defines the ControlRateConstantQuality. - */ - struct ControlRateConstantQuality { - unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ - unsigned int portIndex; /** Port index */ - unsigned int qualityValue; /** Control rate constant quality */ - }; - - /** - * @brief Defines the PassthroughParam. - */ - struct PassthroughParam { - int32_t key; /**< Parameter type index */ - btye val; /**< Pointer to the parameter value */ - int size; /**< Parameter value size */ - }; - /** - * @brief Enumerates the extended codec indexes. - */ - enum OmxIndexCodecExType { - /** Extended BufferType index */ - OMX_IndexExtBufferTypeStartUnused = OMX_IndexKhronosExtensions + 0x00a00000, - /** SupportBuffer */ - OMX_IndexParamSupportBufferType, - /** UseBuffer */ - OMX_IndexParamUseBufferType, - /** GetBufferHandleUsage */ - OMX_IndexParamGetBufferHandleUsage, - /** CodecVideoPortFormatParam */ - OMX_IndexCodecVideoPortFormat, - /** ControlRateConstantQuality */ - OMX_IndexParamControlRateConstantQuality, - /** PassthroughParam */ - OMX_IndexParamPassthrough, - /** OMX_IndexParamVideoHevc */ - OMX_IndexParamVideoHevc, - /** range/primary/transfer/matrix */ - OMX_IndexColorAspects, - }; - - /** - * @brief Enumerates the Other extended codec indexes. - */ - enum OmxIndexCodecOtherExtType { - /** Extended Config AutoFramerate Conversion */ - OMX_IndexCodecExtConfigAutoFramerateConversion = OMX_IndexOtherStartUnused + 0x1, - /** Extended Config Priority */ - OMX_IndexCodecExtConfigPriority, - /** Extended Config OperatingRate index */ - OMX_IndexCodecExtConfigOperatingRate, - }; - - enum OmxIndexCodecVendorExtType { - /** Extended Channel Attributes index */ - OMX_IndexCodecExtChannelAttributes = OMX_IndexVendorStartUnused + 0x1, - /** CodecEnableNativeBufferParams */ - OMX_IndexCodecExtEnableNativeBuffer, - }; - - /** - * @brief Structure for controlling HEVC video encoding - */ - struct CodecVideoParamHevc { - unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ - unsigned int portIndex; /** Port index */ - enum CodecHevcProfile profile; /** Hevc profile. For details, see {@link CodecHevcProfile}. */ - enum CodecHevcLevel level; /** Hevc level. For details, see {@link CodecHevcLevel}. */ - unsigned int keyFrameInterval; /** Distance between consecutive I-frames (including one of the I frams). - 0 means interval is unspecified and can be freely chosen by the codec. - 1 means a stream of only I frams. other means the real value. */ - }; - - /** - * @brief Defines the CodecEnableNativeBufferParams. - */ - struct CodecEnableNativeBufferParams { - unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ - unsigned int portIndex; /** Port index */ - boolean enable; /** Enable NativeBuffer */ - }; - - enum RangeType { - RANGE_UNSPECIFIED, - RANGE_FULL, - RANGE_LIMITED, - RANGE_MAX = 0xff, - }; - - enum Primaries { - PRIMARIES_UNSPECIFIED, - PRIMARIES_BT709, //Rec. ITU-R BT.709-6 - PRIMARIES_BT470_6M, //Rec. ITU-R BT.470-6 System M - PRIMARIES_BT601_625, //Rec. ITU-R BT.601-7 625 or Rec. ITU-R BT.470-6 System B,G - PRIMARIES_BT601_525, //Rec. ITU-R BT.601-7 525 or SMPTE ST 170 or SMPTE ST 240 - PRIMARIES_GENERICFILM, //Generic Film - PRIMARIES_BT2020, //Rec. ITU-R BT.2020-2 or Rec. ITU-R BT.2100-2 - PRIMARIES_MAX = 0xff, - }; - - enum Transfer { - TRANSFER_UNSPECIFIED, - TRANSFER_LINEAR, //Linear transfer characteristics - TRANSFER_SRGB, //IEC 61966-2-1 sRGB - TRANSFER_SMPTE170, //SMPTE ST 170 or Rec. ITU-R BT.709-6 or BT.601-7 or BT.2020-2 - TRANSFER_GAMMA22, //Rec. ITU-R BT.470-6 System M - TRANSFER_GAMMA28, //Rec. ITU-R BT.470-6 System B,G - TRANSFER_PQ, //Rec. ITU-R BT.2100-2 perceptual quantization (PQ) system - TRANSFER_HLG, //Rec. ITU-R BT.2100-2 hybrid log gamma (HLG) system - TRANSFER_SMPTE240 = 0x40, //SMPTE ST 240 - TRANSFER_XVYCC, //IEC 61966-2-4 - TRANSFER_BT1361, //Rec. ITU-R BT.1361-0 extended colour gamut system - TRANSFER_ST428, //SMPTE ST 428-1 - TRANSFER_MAX = 0xff, - }; - - enum MatrixCoeffs { - MATRIX_UNSPECIFED, - MATRIX_BT709, //Rec. ITU-R BT.709-6 - MATRIX_FCC, //United States Federal Communications Commission - MATRIX_BT601, //Rec. ITU-R BT.601-7 or Rec. ITU-R BT.470-6 System B,G - MATRIX_SMPTE240, //SMPTE ST 240 - MATRIX_BT2020, //Rec. ITU-R BT.2100-2 (non-constant luminance) - MATRIX_BT2020CONSTANT, //Rec. ITU-R BT.2100-2 (constant luminance) - MATRIX_MAX = 0xff, - }; - - struct ColorAspects { - enum RangeType range; - enum Primaries primaries; - enum Transfer transfer; - enum MatrixCoeffs matrixCoeffs; - }; - - /** - * @brief Structure for controlling color space - */ - struct CodecVideoColorspace { - unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ - unsigned int portIndex; /** Port index */ - unsigned int requestingDataSpace; - unsigned int dataSpaceChanged; - unsigned int pixeFormat; - unsigned int dataSpace; - struct ColorAspects aspects; - }; - -- Gitee From f7b56a4d68d8e1a6e50a601b18a279e06e3f5a80 Mon Sep 17 00:00:00 2001 From: lishigao Date: Mon, 9 Oct 2023 01:18:57 +0000 Subject: [PATCH 06/28] fix Signed-off-by: lishigao --- codec/v1_0/CodedcExtTypes.idl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/codec/v1_0/CodedcExtTypes.idl b/codec/v1_0/CodedcExtTypes.idl index 3e6a7ff5..847ef7ca 100644 --- a/codec/v1_0/CodedcExtTypes.idl +++ b/codec/v1_0/CodedcExtTypes.idl @@ -16,13 +16,13 @@ package ohos.hdi.codec.v1_0; enum OMX_COLOR_FORAMTTYPE { - OMX_COLOR_FormatVendorStartUnused = 0x7F000000; + OMX_COLOR_FormatVendorStartUnused = 0x7F000000, }; enum OMX_INDEXTYPE { - OMX_IndexKhronosExtensions = 0x6F000000; - OMX_IndexOtherStartUnused = 0x08000000; - OMX_IndexVendorStartUnused = 0x7F000000; + OMX_IndexKhronosExtensions = 0x6F000000, + OMX_IndexOtherStartUnused = 0x08000000, + OMX_IndexVendorStartUnused = 0x7F000000, }; /** -- Gitee From eaf571b1be86890029e442a4e00aca9a5b8e7ce8 Mon Sep 17 00:00:00 2001 From: lishigao Date: Mon, 9 Oct 2023 01:46:59 +0000 Subject: [PATCH 07/28] 2fix Signed-off-by: lishigao --- codec/v1_0/CodedcExtTypes.idl | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/codec/v1_0/CodedcExtTypes.idl b/codec/v1_0/CodedcExtTypes.idl index 847ef7ca..926be251 100644 --- a/codec/v1_0/CodedcExtTypes.idl +++ b/codec/v1_0/CodedcExtTypes.idl @@ -15,14 +15,8 @@ package ohos.hdi.codec.v1_0; -enum OMX_COLOR_FORAMTTYPE { - OMX_COLOR_FormatVendorStartUnused = 0x7F000000, -}; - enum OMX_INDEXTYPE { OMX_IndexKhronosExtensions = 0x6F000000, - OMX_IndexOtherStartUnused = 0x08000000, - OMX_IndexVendorStartUnused = 0x7F000000, }; /** @@ -101,9 +95,6 @@ enum CodecHevcLevel { /** * @brief Enumerates the extended codec color format. */ -enum CodecColorFormatExt { - CODEC_COLOR_FORMAT_RGBA8888 = OMX_COLOR_FormatVendorStartUnused + 100, -}; /** * @brief Enumerates the buffer types. @@ -207,25 +198,6 @@ enum OmxIndexCodecExType { OMX_IndexColorAspects, }; -/** - * @brief Enumerates the Other extended codec indexes. - */ -enum OmxIndexCodecOtherExtType { - /** Extended Config AutoFramerate Conversion */ - OMX_IndexCodecExtConfigAutoFramerateConversion = OMX_IndexOtherStartUnused + 0x1, - /** Extended Config Priority */ - OMX_IndexCodecExtConfigPriority, - /** Extended Config OperatingRate index */ - OMX_IndexCodecExtConfigOperatingRate, -}; - -enum OmxIndexCodecVendorExtType { - /** Extended Channel Attributes index */ - OMX_IndexCodecExtChannelAttributes = OMX_IndexVendorStartUnused + 0x1, - /** CodecEnableNativeBufferParams */ - OMX_IndexCodecExtEnableNativeBuffer, -}; - /** * @brief Structure for controlling HEVC video encoding */ -- Gitee From 81e20340a9905dbe173dbf1ed4671e5c6645788f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=AF=97=E9=AB=98?= Date: Mon, 9 Oct 2023 06:55:59 +0000 Subject: [PATCH 08/28] rename codec/v1_0/CodedcExtTypes.idl to codec/v1_0/CodecExtTypes.idl. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李诗高 --- codec/v1_0/{CodedcExtTypes.idl => CodecExtTypes.idl} | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) rename codec/v1_0/{CodedcExtTypes.idl => CodecExtTypes.idl} (98%) diff --git a/codec/v1_0/CodedcExtTypes.idl b/codec/v1_0/CodecExtTypes.idl similarity index 98% rename from codec/v1_0/CodedcExtTypes.idl rename to codec/v1_0/CodecExtTypes.idl index 926be251..b8d20a7a 100644 --- a/codec/v1_0/CodedcExtTypes.idl +++ b/codec/v1_0/CodecExtTypes.idl @@ -15,10 +15,6 @@ package ohos.hdi.codec.v1_0; -enum OMX_INDEXTYPE { - OMX_IndexKhronosExtensions = 0x6F000000, -}; - /** * @brief Defines the OMX_VERSIONTYPE. */ @@ -178,8 +174,8 @@ struct PassthroughParam { * @brief Enumerates the extended codec indexes. */ enum OmxIndexCodecExType { - /** Extended BufferType index */ - OMX_IndexExtBufferTypeStartUnused = OMX_IndexKhronosExtensions + 0x00a00000, + /** Extended BufferType index, value = OMX_IndexKhronosExtensions + 0x00a00000 */ + OMX_IndexExtBufferTypeStartUnused = 0x6F000000 + 0x00a00000, /** SupportBuffer */ OMX_IndexParamSupportBufferType, /** UseBuffer */ -- Gitee From 0a2ebd96bbefcbdf7f263b2299322554e8217a32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=AF=97=E9=AB=98?= Date: Mon, 9 Oct 2023 06:58:13 +0000 Subject: [PATCH 09/28] update codec/v1_0/CodecExtTypes.idl. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李诗高 --- codec/v1_0/CodecExtTypes.idl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codec/v1_0/CodecExtTypes.idl b/codec/v1_0/CodecExtTypes.idl index b8d20a7a..01f68af6 100644 --- a/codec/v1_0/CodecExtTypes.idl +++ b/codec/v1_0/CodecExtTypes.idl @@ -165,8 +165,8 @@ struct ControlRateConstantQuality { * @brief Defines the PassthroughParam. */ struct PassthroughParam { - int32_t key; /**< Parameter type index */ - btye val; /**< Pointer to the parameter value */ + unsigned int key; /**< Parameter type index */ + byte val; /**< Pointer to the parameter value */ int size; /**< Parameter value size */ }; -- Gitee From 53256c96c5a370f677b002e0fcc1b258ba9c17a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=AF=97=E9=AB=98?= Date: Mon, 9 Oct 2023 06:59:45 +0000 Subject: [PATCH 10/28] update codec/v1_0/CodecExtTypes.idl. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李诗高 --- codec/v1_0/CodecExtTypes.idl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/codec/v1_0/CodecExtTypes.idl b/codec/v1_0/CodecExtTypes.idl index 01f68af6..cb5abd8e 100644 --- a/codec/v1_0/CodecExtTypes.idl +++ b/codec/v1_0/CodecExtTypes.idl @@ -282,5 +282,4 @@ struct CodecVideoColorspace { unsigned int pixeFormat; unsigned int dataSpace; struct ColorAspects aspects; -}; - +}; \ No newline at end of file -- Gitee From 8efaa1e63d2bf34ec126b054aebaa96d19737dce Mon Sep 17 00:00:00 2001 From: lishigao Date: Mon, 9 Oct 2023 07:32:54 +0000 Subject: [PATCH 11/28] 3fix Signed-off-by: lishigao --- codec/v1_0/CodecExtTypes.idl | 42 ++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/codec/v1_0/CodecExtTypes.idl b/codec/v1_0/CodecExtTypes.idl index cb5abd8e..4ca16b8d 100644 --- a/codec/v1_0/CodecExtTypes.idl +++ b/codec/v1_0/CodecExtTypes.idl @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + package ohos.hdi.codec.v1_0; /** @@ -39,7 +39,7 @@ enum CodecVideoExType { CODEC_OMX_VIDEO_CodingVP9 = 10, /** VP9 Index in Codec HDI */ CODEC_OMX_VIDEO_CodingHEVC = 11, /** HEVC Index in Codec HDI */ }; - + /** * @brief Enumerates the extended HEVC profile. */ @@ -53,7 +53,7 @@ enum CodecHevcProfile { CODEC_HEVC_PROFILE_MAIN10_HDR10_PLUS = 0x2000, CODEC_HEVC_PROFILE_MAX = 0x7FFFFFFF }; - + /** * @brief Enumerates the extended HEVC level. */ @@ -87,11 +87,7 @@ enum CodecHevcLevel { CODEC_HEVC_HIGH_TIER_LEVEL62 = 0x2000000, CODEC_HEVC_HIGH_TIER_MAX = 0x7FFFFFFF }; - -/** - * @brief Enumerates the extended codec color format. - */ - + /** * @brief Enumerates the buffer types. */ @@ -107,7 +103,7 @@ enum CodecBufferType { /** Dynamic handle. */ CODEC_BUFFER_TYPE_DYNAMIC_HANDLE = 0x8, }; - + /** * @brief Defines the SupportBuffer. */ @@ -117,7 +113,7 @@ struct SupportBufferType { unsigned int portIndex; /** Port index */ unsigned int bufferTypes; /** Supported buffer types */ }; - + /** * @brief Define the UseBuffer. */ @@ -127,7 +123,7 @@ struct UseBufferType { unsigned int portIndex; /** Port index */ unsigned int bufferType; /** Buffer type */ }; - + /** * @brief Defines the BufferHandleUsage. */ @@ -137,7 +133,7 @@ struct GetBufferHandleUsageParams { unsigned int portIndex; /** Port index */ unsigned long usage; /** Usage */ }; - + /** * @brief Defines the CodecVideoPortFormatParam. */ @@ -150,7 +146,7 @@ struct CodecVideoPortFormatParam { unsigned int codecCompressFormat; /** See */ unsigned int framerate; /** Q16 format */ }; - + /** * @brief Defines the ControlRateConstantQuality. */ @@ -165,8 +161,8 @@ struct ControlRateConstantQuality { * @brief Defines the PassthroughParam. */ struct PassthroughParam { - unsigned int key; /**< Parameter type index */ - byte val; /**< Pointer to the parameter value */ + int key; /**< Parameter type index */ + long val; /**< Pointer to the parameter value */ int size; /**< Parameter value size */ }; @@ -193,7 +189,7 @@ enum OmxIndexCodecExType { /** range/primary/transfer/matrix */ OMX_IndexColorAspects, }; - + /** * @brief Structure for controlling HEVC video encoding */ @@ -207,7 +203,7 @@ struct CodecVideoParamHevc { 0 means interval is unspecified and can be freely chosen by the codec. 1 means a stream of only I frams. other means the real value. */ }; - + /** * @brief Defines the CodecEnableNativeBufferParams. */ @@ -217,14 +213,14 @@ struct CodecEnableNativeBufferParams { unsigned int portIndex; /** Port index */ boolean enable; /** Enable NativeBuffer */ }; - + enum RangeType { RANGE_UNSPECIFIED, RANGE_FULL, RANGE_LIMITED, RANGE_MAX = 0xff, }; - + enum Primaries { PRIMARIES_UNSPECIFIED, PRIMARIES_BT709, //Rec. ITU-R BT.709-6 @@ -235,7 +231,7 @@ enum Primaries { PRIMARIES_BT2020, //Rec. ITU-R BT.2020-2 or Rec. ITU-R BT.2100-2 PRIMARIES_MAX = 0xff, }; - + enum Transfer { TRANSFER_UNSPECIFIED, TRANSFER_LINEAR, //Linear transfer characteristics @@ -251,7 +247,7 @@ enum Transfer { TRANSFER_ST428, //SMPTE ST 428-1 TRANSFER_MAX = 0xff, }; - + enum MatrixCoeffs { MATRIX_UNSPECIFED, MATRIX_BT709, //Rec. ITU-R BT.709-6 @@ -262,14 +258,14 @@ enum MatrixCoeffs { MATRIX_BT2020CONSTANT, //Rec. ITU-R BT.2100-2 (constant luminance) MATRIX_MAX = 0xff, }; - + struct ColorAspects { enum RangeType range; enum Primaries primaries; enum Transfer transfer; enum MatrixCoeffs matrixCoeffs; }; - + /** * @brief Structure for controlling color space */ -- Gitee From 12bdbf4b73701eae036be361bb136011442f00ed Mon Sep 17 00:00:00 2001 From: lishigao Date: Mon, 9 Oct 2023 08:41:18 +0000 Subject: [PATCH 12/28] 4fix Signed-off-by: lishigao --- codec/v1_0/CodecExtTypes.idl | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/codec/v1_0/CodecExtTypes.idl b/codec/v1_0/CodecExtTypes.idl index 4ca16b8d..0885b4a1 100644 --- a/codec/v1_0/CodecExtTypes.idl +++ b/codec/v1_0/CodecExtTypes.idl @@ -157,15 +157,6 @@ struct ControlRateConstantQuality { unsigned int qualityValue; /** Control rate constant quality */ }; -/** - * @brief Defines the PassthroughParam. - */ -struct PassthroughParam { - int key; /**< Parameter type index */ - long val; /**< Pointer to the parameter value */ - int size; /**< Parameter value size */ -}; - /** * @brief Enumerates the extended codec indexes. */ @@ -182,8 +173,6 @@ enum OmxIndexCodecExType { OMX_IndexCodecVideoPortFormat, /** ControlRateConstantQuality */ OMX_IndexParamControlRateConstantQuality, - /** PassthroughParam */ - OMX_IndexParamPassthrough, /** OMX_IndexParamVideoHevc */ OMX_IndexParamVideoHevc, /** range/primary/transfer/matrix */ @@ -204,16 +193,6 @@ struct CodecVideoParamHevc { 1 means a stream of only I frams. other means the real value. */ }; -/** - * @brief Defines the CodecEnableNativeBufferParams. - */ -struct CodecEnableNativeBufferParams { - unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ - unsigned int portIndex; /** Port index */ - boolean enable; /** Enable NativeBuffer */ -}; - enum RangeType { RANGE_UNSPECIFIED, RANGE_FULL, -- Gitee From fade02668d23329c9fd4fb8af3e4fef4f999d80b Mon Sep 17 00:00:00 2001 From: lishigao Date: Wed, 11 Oct 2023 02:53:42 +0000 Subject: [PATCH 13/28] idlv2_0 push Signed-off-by: lishigao --- codec/bundle.json | 26 ++ codec/v1_0/BUILD.gn | 1 - codec/v2_0/BUILD.gn | 35 ++ codec/{v1_0 => v2_0}/CodecExtTypes.idl | 0 codec/v2_0/CodecTypes.idl | 392 ++++++++++++++++++++++ codec/v2_0/ICodecCallback.idl | 132 ++++++++ codec/v2_0/ICodecComponent.idl | 447 +++++++++++++++++++++++++ codec/v2_0/ICodecComponentManager.idl | 137 ++++++++ 8 files changed, 1169 insertions(+), 1 deletion(-) create mode 100644 codec/v2_0/BUILD.gn rename codec/{v1_0 => v2_0}/CodecExtTypes.idl (100%) create mode 100644 codec/v2_0/CodecTypes.idl create mode 100644 codec/v2_0/ICodecCallback.idl create mode 100644 codec/v2_0/ICodecComponent.idl create mode 100644 codec/v2_0/ICodecComponentManager.idl diff --git a/codec/bundle.json b/codec/bundle.json index 4af10caa..04b39248 100644 --- a/codec/bundle.json +++ b/codec/bundle.json @@ -28,6 +28,7 @@ "build": { "sub_component": [ "//drivers/interface/codec/v1_0:codec_idl_target", + "//drivers/interface/codec/v2_0:codec_idl_target", "//drivers/interface/codec/image/v1_0:image_idl_target" ], "test": [ @@ -57,6 +58,30 @@ "header_base": "//drivers/interface/codec" } }, + { + "name": "//drivers/interface/codec/v2_0:libcodec_proxy_2.0", + "header": { + "header_files": [ + ], + "header_base": "//drivers/interface/codec" + } + }, + { + "name": "//drivers/interface/codec/v2_0:codec_idl_headers", + "header": { + "header_files": [ + ], + "header_base": "//drivers/interface/codec" + } + }, + { + "name": "//drivers/interface/codec/v2_0:libcodec_stub_2.0", + "header": { + "header_files": [ + ], + "header_base": "//drivers/interface/codec" + } + }, { "name": "//drivers/interface/codec/image/v1_0:libimage_proxy_1.0", "header": { @@ -81,6 +106,7 @@ "header_base": "//drivers/interface/codec" } } + ] } } diff --git a/codec/v1_0/BUILD.gn b/codec/v1_0/BUILD.gn index 9e154e7a..6de4ce09 100644 --- a/codec/v1_0/BUILD.gn +++ b/codec/v1_0/BUILD.gn @@ -26,7 +26,6 @@ if (defined(ohos_lite)) { "ICodecCallback.idl", "ICodecComponent.idl", "ICodecComponentManager.idl", - "CodecExtTypes.idl" ] language = "cpp" subsystem_name = "hdf" diff --git a/codec/v2_0/BUILD.gn b/codec/v2_0/BUILD.gn new file mode 100644 index 00000000..b7a949a4 --- /dev/null +++ b/codec/v2_0/BUILD.gn @@ -0,0 +1,35 @@ +# 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 +# +# 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("../../../hdf_core/adapter/uhdf2/hdi.gni") +if (defined(ohos_lite)) { + group("libcodec_proxy_2.0") { + deps = [] + public_configs = [] + } +} else { + hdi("codec") { + module_name = "codec_service" + + sources = [ + "CodecTypes.idl", + "ICodecCallback.idl", + "ICodecComponent.idl", + "ICodecComponentManager.idl", + "CodecExtTypes.idl" + ] + language = "cpp" + subsystem_name = "hdf" + part_name = "drivers_interface_codec" + } +} diff --git a/codec/v1_0/CodecExtTypes.idl b/codec/v2_0/CodecExtTypes.idl similarity index 100% rename from codec/v1_0/CodecExtTypes.idl rename to codec/v2_0/CodecExtTypes.idl diff --git a/codec/v2_0/CodecTypes.idl b/codec/v2_0/CodecTypes.idl new file mode 100644 index 00000000..d8b15183 --- /dev/null +++ b/codec/v2_0/CodecTypes.idl @@ -0,0 +1,392 @@ +/* + * Copyright (c) 2022 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 Codec module. + * + * The Codec module provides APIs for initializing the custom data and audio and video codecs, + * setting codec parameters, and controlling and transferring data. + * + * @since 3.2 + * @version 1.0 + */ + +/** + * @file CodecTypes.idl + * + * @brief Defines custom data types used in the Codec module APIs, + * including the codec types, audio and video parameters, and buffers. + * + * + * @since 3.2 + * @version 1.0 + */ + +/** + * @brief Defines the path for the package of the Codec module APIs. + * + * @since 3.2 + * @version 1.0 + */ +package ohos.hdi.codec.v1_0; + +/** + * @brief Enumerates the codec types. + */ +enum CodecType { + VIDEO_DECODER, /**< Video decoder. */ + VIDEO_ENCODER, /**< Video encoder. */ + AUDIO_DECODER, /**< Audio decoder. */ + AUDIO_ENCODER, /**< Audio encoder. */ + INVALID_TYPE, /**< Invalid type. */ +}; + +/** + * @brief Enumerates the types of audio and video that can be encoded or decoded. + */ +enum AvCodecRole { + MEDIA_ROLETYPE_IMAGE_JPEG = 0, /**< JPEG image. */ + MEDIA_ROLETYPE_VIDEO_AVC, /**< H.264 video. */ + MEDIA_ROLETYPE_VIDEO_HEVC, /**< H.265 video. */ + MEDIA_ROLETYPE_AUDIO_FIRST = 0x10000, /**< Audio. */ + MEDIA_ROLETYPE_AUDIO_AAC = 0x10000, /**< Advanced Audio Coding (AAC). */ + MEDIA_ROLETYPE_AUDIO_G711A, /**< G.711 a-law audio. */ + MEDIA_ROLETYPE_AUDIO_G711U, /**< G.711 μ-law audio. */ + MEDIA_ROLETYPE_AUDIO_G726, /**< G.726 audio. */ + MEDIA_ROLETYPE_AUDIO_PCM, /**< PCM audio. */ + MEDIA_ROLETYPE_AUDIO_MP3, /**< MP3. */ + MEDIA_ROLETYPE_INVALID, /**< Invalid type. */ +}; + +/** + * @brief Enumerates the codec profiles. + */ +enum Profile { + INVALID_PROFILE = 0, /**< Invalid profile. */ + AAC_LC_PROFILE = 0x1000, /**< AAC low complexity profile. */ + AAC_MAIN_PROFILE, /**< AAC main profile. */ + AAC_HE_V1_PROFILE, /**< Profile combining AAC high efficiency and spectral band replication (SBR), + also known as HE-AAC, AAC+, or aacPlus v1. */ + AAC_HE_V2_PROFILE, /**< HE-AAC combined with SBR and Parametric Stereo (PS), + also known as AAC++ or aacPlus v2. */ + AAC_LD_PROFILE, /**< AAC low delay profile. */ + AAC_ELD_PROFILE, /**< AAC enhanced low delay profile. */ + AVC_BASELINE_PROFILE = 0x2000, /**< H.264 baseline profile. */ + AVC_MAIN_PROFILE, /**< H.264 main profile. */ + AVC_HIGH_PROFILE, /**< H.264 high profile. */ + HEVC_MAIN_PROFILE = 0x3000, /**< H.265 main profile. */ + HEVC_MAIN_10_PROFILE, /**< H.265 10-bit main profile. */ +}; + +/** + * @brief Enumerates the playback capabilities. + */ +enum CodecCapsMask { + CODEC_CAP_ADAPTIVE_PLAYBACK = 0x1, /**< Adaptive playback. */ + CODEC_CAP_SECURE_PLAYBACK = 0x2, /**< Secure playback. */ + CODEC_CAP_TUNNEL_PLAYBACK = 0x4, /**< Tunnel playback. */ + CODEC_CAP_MULTI_PLANE = 0x10000, /**< Multi-plane (video image plane and audio channel plane) capability. */ +}; + +/** + * @brief Enumerates the audio sampling rates. + */ +enum AudioSampleRate { + AUD_SAMPLE_RATE_8000 = 8000, /**< 8000 */ + AUD_SAMPLE_RATE_12000 = 12000, /**< 12000 */ + AUD_SAMPLE_RATE_11025 = 11025, /**< 11025 */ + AUD_SAMPLE_RATE_16000 = 16000, /**< 16000 */ + AUD_SAMPLE_RATE_22050 = 22050, /**< 22050 */ + AUD_SAMPLE_RATE_24000 = 24000, /**< 24000 */ + AUD_SAMPLE_RATE_32000 = 32000, /**< 32000 */ + AUD_SAMPLE_RATE_44100 = 44100, /**< 44100 */ + AUD_SAMPLE_RATE_48000 = 48000, /**< 48000 */ + AUD_SAMPLE_RATE_64000 = 64000, /**< 64000 */ + AUD_SAMPLE_RATE_96000 = 96000, /**< 96000 */ + AUD_SAMPLE_RATE_INVALID, /**< Invalid sampling rate */ +}; + +/** + * @brief Enumerates the audio sampling formats. + * + * For the planar sampling format, the data of each channel is independently stored in data. + * For the packed sampling format, only the first data is used, and the data of each channel is interleaved. + */ +enum CodecAudioSampleFormat { + AUDIO_SAMPLE_FMT_U8 = 0, /**< Unsigned 8-bit integer, packed. */ + AUDIO_SAMPLE_FMT_S16, /**< Signed 16-bit integer, packed. */ + AUDIO_SAMPLE_FMT_S32, /**< Signed 32-bit integer, packed. */ + AUDIO_SAMPLE_FMT_FLOAT, /**< Float, packed. */ + AUDIO_SAMPLE_FMT_DOUBLE, /**< Double, packed. */ + AUDIO_SAMPLE_FMT_U8P, /**< Unsigned 8-bit integer, planar. */ + AUDIO_SAMPLE_FMT_S16P, /**< Signed 16-bit integer, planar. */ + AUDIO_SAMPLE_FMT_S32P, /**< Signed 32-bit integer, planar. */ + AUDIO_SAMPLE_FMT_FLOATP, /**< Float, planar. */ + AUDIO_SAMPLE_FMT_DOUBLEP, /**< Double, planar. */ + AUDIO_SAMPLE_FMT_INVALID, /**< Invalid sampling format. */ +}; + +/** + * @brief Enumerates the codec processing modes. + */ +enum CodecProcessMode { + PROCESS_BLOCKING_INPUT_BUFFER = 0x1, /**< Input buffer in sync mode. */ + PROCESS_BLOCKING_OUTPUT_BUFFER = 0x2, /**< Output buffer in sync mode. */ + PROCESS_BLOCKING_CONTROL_FLOW = 0x4, /**< Control flow in sync mode. */ + PROCESS_NONBLOCKING_INPUT_BUFFER = 0x100, /**< Input buffer in async mode. */ + PROCESS_NONBLOCKING_OUTPUT_BUFFER = 0x200, /**< Output buffer in async mode. */ + PROCESS_NONBLOCKING_CONTROL_FLOW = 0x400, /**< Control flow in asynchronous mode. */ +}; + +/** + * @brief Enumerates the shared memory types. + */ +enum ShareMemTypes { + READ_WRITE_TYPE = 0x1, /**< Shared memory that is readable and writable. */ + READ_ONLY_TYPE = 0x2, /**< Shared memory that is read-only. */ +}; + +/** + * @brief Enumerates the bit rate modes. + */ +enum BitRateMode { + BIT_RATE_MODE_INVALID, /**< Invalid value. */ + BIT_RATE_MODE_VBR, /**< Variable bit rate. */ + BIT_RATE_MODE_CBR, /**< Constant bit rate. */ + BIT_RATE_MODE_CQ, /**< Constant quality. */ + BIT_RATE_MODE_VCBR, /**< Constrained variable bit rate. */ + BIT_RATE_MODE_ABR, /**< Average bit rate. */ +}; + +/** + * @brief Enumerates the component states. + */ +enum CodecEventType { + CODEC_EVENT_CMD_COMPLETE, /**< The component has completed a command. */ + CODEC_EVENT_ERROR, /**< The component has detected an error. */ + CODEC_EVENT_MARK, /**< The component has detected the buffer mark. */ + CODEC_EVENT_PORT_SETTINGS_CHANGED, /**< The component has reported port setting changes. */ + CODEC_EVENT_BUFFER_FLAG, /**< The component has detected an EOS. */ + CODEC_EVENT_RESOURCES_ACQUIRED, /**< The component has been granted resources and is automatically + starting the state change from CODEC_STATE_WAIT_FOR_RESOURCES + to CODEC_STATE_IDLE. */ + CODEC_EVENT_COMPONENT_RESUMED, /**< The component is resumed due to reacquisition of resources. */ + CODEC_EVENT_DYNAMIC_RESOURCES_AVAILABLE, /**< The component has acquired previously unavailable + dynamic resources. */ + CODEC_EVENT_PORT_FORMAT_DETECTED, /**< The component has detected a supported format. */ + CODEC_EVENT_KHRONOS_EXTENSIONS = 0x6F000000, /**< Reserved region for introducing Khronos standard extensions. */ + CODEC_EVENT_VENDOR_START_UNUSED = 0x7F000000, /**< Reserved region for introducing vendor extensions. */ + CODEC_EVENT_MAX = 0x7FFFFFFF, /**< Maximum value. */ +}; + +/** + * @brief Enumerates the cmd parameters of the SendCommand API in ICodecComponent. + */ +enum CodecCommandType +{ + CODEC_COMMAND_STATE_SET, /**< Change the component state. */ + CODEC_COMMAND_FLUSH, /**< Flush the data queue of a component. */ + CODEC_COMMAND_PORT_DISABLE, /**< Disable a port on a component. */ + CODEC_COMMAND_PORT_ENABLE, /**< Enable a port on a component. */ + CODEC_COMMAND_MARK_BUFFER, /**< Mark a component/buffer for observation. */ + CODEC_COMMAND_KHRONOS_EXTENSIONS = 0x6F000000, /**< Reserved region for introducing Khronos standard extensions. */ + CODEC_COMMAND_VENDOR_START_UNUSED = 0x7F000000, /**< Reserved region for introducing vendor extensions. */ + CODEC_COMMAND_MAX = 0x7FFFFFFF, /**< Maximum value. */ +}; + +/** + * @brief Enuerates the component states. + */ +enum CodecStateType +{ + CODEC_STATE_INVALID, /**< The component has detected that its internal data structures are + corrupted so that the state cannot be correctly determined. */ + CODEC_STATE_LOADED, /**< The component has been loaded but has not completed + initialization. Only ICodecComponent.SetParameter + and ICodecComponent.GetParameter can be called for a + component in this state. */ + CODEC_STATE_IDLE, /**< The component initialization is complete, and the component is + ready to start. */ + CODEC_STATE_EXECUTING, /**< The component has accepted the start command and is processing + data (if the data is available). */ + CODEC_STATE_PAUSE, /**< The component has received the pause command. */ + CODEC_STATE_WAIT_FOR_RESOURCES, /**< The component is waiting for resources, either after preemption + or before it acquires the requested resources. */ + CODEC_STATE_KHRONOS_EXTENSIONS = 0x6F000000, /**< Reserved region for introducing Khronos standard extensions. */ + CODEC_STATE_VENDOR_START_UNUSED = 0x7F000000, /**< Reserved region for introducing vendor extensions. */ + CODEC_STATE_MAX = 0x7FFFFFFF, /**< Maximum value. */ +}; +/** + * @brief Enuerates the port supplier preferences when establishing a tunnel between two ports. + */ +enum CodecBufferSupplierType +{ + CODEC_BUFFER_SUPPLY_UNSPECIFIED = 0, /**< The port that provides the buffers is not specified. */ + CODEC_BUFFER_SUPPLY_INPUT, /**< The input port provides the buffers. */ + CODEC_BUFFER_SUPPLY_OUTPUT, /**< The output port provides the buffers. */ + CODEC_BUFFER_SUPPLY_KHRONOS_EXTENSIONS = 0x6F000000, /**< Reserved region for introducing Khronos + standard extensions. */ + CODEC_BUFFER_SUPPLY_VENDOR_START_UNUSED = 0x7F000000, /**< Reserved region for introducing vendor extensions. */ + CODEC_BUFFER_SUPPLY_MAX = 0x7FFFFFFF, /**< Maximum value. */ +}; + +/** + * @brief Defines the alignment structure. + */ +struct Alignment { + int widthAlignment; /**< Alignment value of the width. */ + int heightAlignment; /**< Alignment value of the height. */ +}; + +/** + * @brief Defines a rectangle. + */ +struct Rect { + int width; /**< Width of the rectangle. */ + int height; /**< Height of the rectangle. */ +}; + +/** + * @brief Defines a value range. + */ +struct RangeValue { + int min; /**< Minimum value. */ + int max; /**< Maximum value. */ +}; + +/** + * @brief Defines the video encoding and decoding capabilities. + */ +struct CodecVideoPortCap { + struct Rect minSize; /**< Minimum resolution supported. */ + struct Rect maxSize; /**< Maximum resolution supported. */ + struct Alignment whAlignment; /**< Alignment values of the width and height. */ + struct RangeValue blockCount; /**< Value range for the number of blocks supported. */ + struct RangeValue blocksPerSecond; /**< Value range for the number of blocks processed per second. */ + struct Rect blockSize; /**< Block size supported. */ + int[] supportPixFmts; /**< Supported pixel formats. For details, see PixeFormat defined by + display_type.h in {@link Display}. */ + enum BitRateMode[] bitRatemode; /**< Transmission rate modes, which can be constant or variable. + For details, see {@link BitRateMode}. */ + struct RangeValue frameRate; /**< Frame rate range. */ + int[] measuredFrameRate; /**< Frame rate measured. */ +}; +/** + * @brief Defines the audio encoding and decoding capabilities. + */ +struct CodecAudioPortCap { + int[] sampleFormats; /**< Supported audio sampling formats. For details, see {@link AudioSampleFormat}. */ + int[] sampleRate; /**< Supported audio sampling rates. For details, see {@link AudioSampleRate}. */ + int[] channelLayouts; /**< Supported channel layouts, which include single channel, balanced channel, + and 3D stereo channel. */ + int[] channelCount; /**< Supported number of audio channels. */ +}; + +/** + * @brief Defines the audio and video encoding and decoding capabilities. + */ +struct PortCap { + struct CodecVideoPortCap video; /**< Video encoding and decoding capabilities. */ + struct CodecAudioPortCap audio; /**< Audio encoding and decoding capabilities. */ +}; + +/** + * @brief Defines the version type of a component. + */ +struct CodecVerType { + unsigned char majorVersion; /**< Major version accessor element. */ + unsigned char minorVersion; /**< Minor version accessor element. */ + unsigned char revision; /**< Revision version accessor element. */ + unsigned char step; /**< Step version accessor element. */ +}; + +/** + * @brief Defines the component version information. + */ +union CodecVersionType { + struct CodecVerType version; /**< Component version. */ + unsigned int nVersion; /**< 32-bit value to make accessing the version easily done in a single + word size copy or compare operation. */ +}; + +/** + * @brief Defines the codec capabilities. + */ +struct CodecCompCapability { + enum AvCodecRole role; /**< Media type. */ + enum CodecType type; /**< Codec type. */ + String compName; /**< Name of the codec component. */ + int[] supportProfiles; /**< Supported profiles. For details, see {@link Profile}. */ + int maxInst; /**< Maximum instance. */ + boolean isSoftwareCodec; /**< Whether it is a software codec. */ + int processModeMask; /**< Codec processing mode mask. For details, + see {@link CodecProcessMode}. */ + unsigned int capsMask; /**< Mask of the codec playback capabilities. For details, + see {@link CodecCapsMask}. */ + struct RangeValue bitRate; /**< Supported bit rate range. */ + struct PortCap port; /**< Supported audio and video encoding/decoding capabilities. */ + boolean canSwapWidthHeight; /**< Whether width and height verification is supported. */ +}; + +/** + * @brief Defines the codec buffer information. + */ +struct OmxCodecBuffer { + unsigned int bufferId; /**< Buffer ID. */ + unsigned int size; /**< Size of the structure. */ + union CodecVersionType version; /**< Component version. */ + unsigned int bufferType; /**< Buffer type. For details, see {@link CodecBufferType}. */ + NativeBuffer bufferhandle; /**< Buffer handle used for encoding or decoding. For details, + see {@link NativeBuffer}. */ + FileDescriptor fd; /**< Anonymous shared memory file descriptor. */ + unsigned int allocLen; /**< Size of the buffer allocated. */ + unsigned int filledLen; /**< Size of the buffer filled. */ + unsigned int offset; /**< Offset to the start position of the valid data in the buffer. */ + FileDescriptor fenceFd; /**< Fence file descriptor. */ + enum ShareMemTypes type; /**< Shared memory type. */ + long pts; /**< Timestamp of the first logical sample in the buffer. */ + unsigned int flag; /**< Buffer specific flag. */ +}; + +/** + * @brief Defines the structure that is used to pass data from an output port to an input port. + */ +struct CodecTunnelSetupType { + unsigned int tunnelFlags; /**< Bit flags for tunneling. */ + enum CodecBufferSupplierType supplier; /**< Supplier preference. */ +}; + +/** + * @brief Defines the component information. + */ +struct CompVerInfo { + String compName; /**< Component name. */ + unsigned char[] compUUID; /**< UUID of the component. */ + union CodecVersionType compVersion; /**< OMX component version. */ + union CodecVersionType specVersion; /**< Version of the specifications on which the component is built. */ +}; + +/** + * @brief Defines the event information to report. + */ +struct EventInfo { + long appData; /**< Upper-layer instance passed in when the callback is invoked. */ + unsigned int data1; /**< Error type, which can be portIndex or other data. */ + unsigned int data2; /**< Data 2 carried in the reported event. */ + byte[] eventData; /**< Data carried in the reported event. */ +}; diff --git a/codec/v2_0/ICodecCallback.idl b/codec/v2_0/ICodecCallback.idl new file mode 100644 index 00000000..de6d0473 --- /dev/null +++ b/codec/v2_0/ICodecCallback.idl @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2022 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 Codec module. + * + * The Codec module provides APIs for initializing the custom data and audio and video codecs, + * setting codec parameters, and controlling and transferring data. + * + * @since 3.2 + * @version 1.0 + */ + +/** + * @file ICodecCallback.idl + * + * @brief Defines the callbacks used to report codec events and processing results of the input and output buffers. + * + * + * + * @since 3.2 + * @version 1.0 + */ + +/** + * @brief Defines the path for the package of the Codec module APIs. + * + * @since 3.2 + * @version 1.0 + */ +package ohos.hdi.codec.v1_0; + +import ohos.hdi.codec.v1_0.CodecTypes; + +/** + * @brief Defines the callbacks of the Codec module. + * + * The following callbacks are provided: + * - Callback used to report component error events, command completion events, and port setting events. + * For details, see {@link EventHandler}. + * - Callback invoked when the input port has data processed in the buffer. For details, see {@link EmptyBufferDone}. + * - Callback invoked when the output port has data filled into the buffer. For details, see {@link FillBufferDone}. + * The callbacks are registered by using: + * - {@link CreateComponent} when a component is created. + * - {@link SetCallbacks} when the component is in the OMX_StateLoaded state. + */ + + +[callback] interface ICodecCallback { + + /** + * @brief Reports an event, such as an error, a command completion event, and port setting changes. + * + * - When event is CODEC_EVENT_CMD_COMPLETE and eventData is null, + * data2 indicates a state if data1 is CODEC_COMMAND_STATE_SET and indicates a port if + * data1 is any CodecCommandType other than CODEC_COMMAND_STATE_SET. + * - When event is CODEC_EVENT_ERROR, data1 indicates an error code and data2 + * and eventData are both 0. + * - When event is CODEC_EVENT_MARK, data1 and data2 are both 0 and + * eventData points to the mark. + * - When event is CODEC_EVENT_PORT_SETTINGS_CHANGED, data1 indicates a port and data2 + * and eventData are 0. + * - When event is CODEC_EVENT_BUFFER_FLAG, data1 indicates a port, data2 indicates a + * flag, and eventData is 0. + * - When event is CODEC_EVENT_RESOURCES_ACQUIRED or CODEC_EVENT_DYNAMIC_RESOURCES_AVAILABLE, + * data1, data2, and eventData are 0. + * + * @param event Indicates the type of the event to report. For details, see {@link CodecEventType}. + * @param info Indicates the pointer to the information to report. For details, see {@link EventInfo}. + * + * @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 OMX_ERRORTYPE defined by OpenMAX IL. + * + * @since 3.2 + */ + EventHandler([in] enum CodecEventType event, [in] struct EventInfo info); + + /** + * @brief Reports an event indicating that the encoding or decoding in the input buffer is complete. + * + * + * @param appData Indicates the application data. Generally, it is an upper-layer instance + * passed in for the callback. + * @param buffer Indicates information about the input buffer that was emptied. For details, + * see {@link OmxCodecBuffer}. + * + * @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 OMX_ERRORTYPE defined by OpenMAX IL. + * + * @since 3.2 + */ + EmptyBufferDone([in] long appData, [in] struct OmxCodecBuffer buffer); + + /** + * @brief Reports an event indicating that the output buffer is filled. + * + * + * @param appData Indicates the application data. Generally, it is an upper-layer instance + * passed in for the callback. + * @param buffer Indicates information about the buffer that was filled. For details, see {@link OmxCodecBuffer}. + * + * @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 OMX_ERRORTYPE defined by OpenMAX IL. + * + * @since 3.2 + */ + FillBufferDone([in] long appData, [in] struct OmxCodecBuffer buffer); +} diff --git a/codec/v2_0/ICodecComponent.idl b/codec/v2_0/ICodecComponent.idl new file mode 100644 index 00000000..a592efc6 --- /dev/null +++ b/codec/v2_0/ICodecComponent.idl @@ -0,0 +1,447 @@ +/* + * Copyright (c) 2022 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 Codec module. + * + * The Codec module provides APIs for initializing the custom data and audio and video codecs, + * setting codec parameters, and controlling and transferring data. + * + * @since 3.2 + * @version 1.0 + */ + +/** + * @file ICodecComponent.idl + * + * @brief Declares the APIs for codec components. + * + * You can use these APIs to obtain component information, send commands to components, + * set component parameters, and control and transfer buffer data. + * After creating a component, you can use these APIs to implement encoding and decoding. + * + * @since 3.2 + * @version 1.0 + */ + +/** + * @brief Defines the path for the package of the Codec module APIs. + * + * @since 3.2 + * @version 1.0 + */ +package ohos.hdi.codec.v1_0; + +import ohos.hdi.codec.v1_0.CodecTypes; +import ohos.hdi.codec.v1_0.ICodecCallback; + +/** + * @brief Defines the APIs for codec components. + * + * The APIs can be used to: + * - Obtain the component version. + * - Obtain and set component parameters. + * - Send a command to a component and obtain the component state. + * - Set callbacks. + * - Set or release the buffer used by a component. + * - Manage the input and output buffers for encoding and decoding. + * For details, see the description of the APIs. + */ + +interface ICodecComponent { + + /** + * @brief Obtains the version of this codec component. + * + * + * @param verInfo Indicates the pointer to the component version information. For details, see {@link CompVerInfo}. + * + * @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 OMX_ERRORTYPE defined by OpenMAX IL. + * + * @since 3.2 + */ + GetComponentVersion([out] struct CompVerInfo verInfo); + + /** + * @brief Sends a command to this component. + * + * If the command is used to set the component state, a callback will be invoked to return the result. + * There is no callback invoked for other commands. + * + * @param cmd Indicates the command to send. For details, see {@link CodecCommandType}. + * @param param Indicates the parameter carried in the command. + * - If cmd is CODEC_COMMAND_STATE_SET, param can be set to any value of {@link CodecStateType}. + * - If cmd is CODEC_COMMAND_FLUSH, CODEC_COMMAND_PORT_DISABLE, CODEC_COMMAND_PORT_ENABLE, + * or CODEC_COMMAND_MARK_BUFFER, param is the target port. + * @param cmdData Indicates the pointer to the OMX_MARKTYPE structure when cmd + * is CODEC_COMMAND_MARK_BUFFER. + * + * @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 OMX_ERRORTYPE defined by OpenMAX IL. + * + * @since 3.2 + */ + SendCommand([in] enum CodecCommandType cmd, [in] unsigned int param, [in] byte[] cmdData); + + /** + * @brief Obtains the parameter settings of this component. + * + * For the component in a state other than OMX_StateInvalid, you can use this API to obtain the + * component's parameter settings. For details about the component states, see {@link OMX_STATETYPE}. + * + * @param index Indicates the index of the structure to fill. For details, + * see OMX_INDEXTYPE defined by OMX IL. + * @param inParamStruct Indicates the pointer to the application allocated structure to be filled by the component. + * @param outParamStruct Indicates the pointer to the application allocated structure filled by the component. + * + * @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 OMX_ERRORTYPE defined by OpenMAX IL. + * + * @since 3.2 + */ + GetParameter([in] unsigned int index, [in] byte[] inParamStruct, [out] byte[] outParamStruct); + + /** + * @brief Sets parameters for this component, that is, sends an initialization + * parameter structure to the component. + * + * You can use this API to set component parameters when: + * - The component is in the OMX_StateLoaded state (the component has been loaded). + * - The component is in the OMX_StateWaitForResources state (the component is waiting for required resources). + * - The component or port is disabled. + * For details about the component states, see {@link OMX_STATETYPE}. + * + * @param index Indicates the index of the structure to set. For details, see OMX_INDEXTYPE defined by OMX IL. + * @param paramStruct Indicates the pointer to the application allocated structure used to set + * parameters for this component. + * + * @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 OMX_ERRORTYPE defined by OpenMAX IL. + * + * @since 3.2 + */ + SetParameter([in] unsigned int index, [in] byte[] paramStruct); + + /** + * @brief Obtains the configuration of this component. + * + * You can use this API to obtain the component configuration after a component is loaded. + * + * @param index Indicates the index of the structure to fill. For details, see {@link OMX_INDEXTYPE}. + * @param inCfgStruct Indicates the pointer to the application allocated structure to be filled by the component. + * @param outCfgStruct Indicates the pointer to the application allocated structure filled by the component. + * + * @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 OMX_ERRORTYPE defined by OpenMAX IL. + * + * @since 3.2 + */ + GetConfig([in] unsigned int index, [in] byte[] inCfgStruct, [out] byte[] outCfgStruct); + + /** + * @brief Sets the component configuration. + * + * You can use this API to set the component configuration after a component is loaded. + * + * @param index Indicates the index of the structure to set. For details, see {@link OMX_INDEXTYPE}. + * @param cfgStruct Indicates the pointer to the application allocated structure used to set the component. + * + * @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 OMX_ERRORTYPE defined by OpenMAX IL. + * + * @since 3.2 + */ + SetConfig([in] unsigned int index, [in] byte[] cfgStruct); + + /** + * @brief Obtains the extended index of this component based on a given string. + * + * The extended string can be converted into an OpenMAX IL structure index, which is used (as an input parameter) + * in {@link GetParameter} or {@link SetParameter}. + * + * @param paramName Indicates the string that can be converted into the structure index. + * @param indexType Indicates the structure index obtained. For details, see {@link OMX_INDEXTYPE}. + * + * @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 OMX_ERRORTYPE defined by OpenMAX IL. + * + * @since 3.2 + */ + GetExtensionIndex([in] String paramName, [out] unsigned int indexType); + + /** + * @brief Obtains the current state of this component. + * + * + * + * @param state Indicates the pointer to the state obtained. For details about the component + * states, see {@link CodecStateType}. + * + * @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 OMX_ERRORTYPE defined by OpenMAX IL. + * + * @since 3.2 + */ + GetState([out] enum CodecStateType state); + + /** + * @brief Sets up tunneling for this component. + * + * For a component in the OMX_StateLoaded state (the component is loaded), you can use this API + * to determine whether + * tunneling is possible and if yes, to set up the tunneling. + * For details about the component states, see {@link OMX_STATETYPE}. + * + * @param port Indicates the port on the component used for the setting. + * @param tunneledComp Indicates the handle of the tunnel component. + * @param tunneledPort Indicates the port on the component to be used for tunneling. + * @param inTunnelSetup Indicates the pointer to the tunnel setup structure {@link OMX_TUNNELSETUPTYPE} to set. + * @param outTunnelSetup Indicates the pointer to the tunnel setup structure {@link OMX_TUNNELSETUPTYPE} set. + * + * @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 OMX_ERRORTYPE defined by OpenMAX IL. + * + * @since 3.2 + */ + ComponentTunnelRequest([in] unsigned int port, [in] int tunneledComp, [in] unsigned int tunneledPort, [in] + struct CodecTunnelSetupType inTunnelSetup, [out] struct CodecTunnelSetupType outTunnelSetup); + + /** + * @brief Requests the component to use a buffer that is already allocated by another component. + * + * This API is used when: + * - The component is in the OMX_StateLoaded state (the component is loaded) and has received a request for + * changing the state to OMX_StateIdle. + * - The component is in the OMX_StateWaitForResources state, the required resources are available, and the + * component is ready to enter the OMX_StateIdle state. + * - The component is in the OMX_StateExecuting, OMX_StatePause, or OMX_StateIdle state on a disabled port. + * For details about the component states, see {@link OMX_STATETYPE}. + * + * @param portIndex Indicates the component port. + * @param inBuffer Indicates the pointer to the structure of the buffer to be used. For details, see {@link OmxCodecBuffer}. + * @param outBuffer Indicates the pointer to the structure of the buffer to be used. For details, see {@link OmxCodecBuffer}. + * + * @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 OMX_ERRORTYPE defined by OpenMAX IL. + * + * @since 3.2 + */ + UseBuffer([in] unsigned int portIndex, [in] struct OmxCodecBuffer inBuffer, [out] struct OmxCodecBuffer outBuffer); + + /** + * @brief Requests the component to allocate a new buffer. + * + * This API is used to request a new buffer from a component when: + * - The component is in the OMX_StateLoaded state and has received a request for changing the + * state to OMX_StateIdle. + * - The component is in the OMX_StateWaitForResources state, the required resources are available, + * and the component is ready to enter the OMX_StateIdle state. + * - The component is in the OMX_StateExecuting, OMX_StatePause, or OMX_StateIdle state on a disabled port. + * For details about the component states, see {@link OMX_STATETYPE}. + * + * @param portIndex Indicates the component port. + * @param inBuffer Indicates the pointer to the structure of the buffer to be allocated. For details about + * the structure, see {@link OmxCodecBuffer}. + * @param outBuffer Indicates the pointer to the structure of the buffer allocated. For details about the + * structure, see {@link OmxCodecBuffer}. + * + * @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 OMX_ERRORTYPE defined by OpenMAX IL. + * + * @since 3.2 + */ + AllocateBuffer([in] unsigned int portIndex, [in] struct OmxCodecBuffer inBuffer, + [out] struct OmxCodecBuffer outBuffer); + + /** + * @brief Releases a buffer. + * + * This API is used when: + * - The component is in the OMX_StateIdle state and has received a request for changing the + * state to OMX_StateLoaded. + * - The component is in the OMX_StateExecuting, OMX_StatePause, or OMX_StateIdle state on a disabled port. + * For details about the component states, see {@link OMX_STATETYPE}. + * - This API can be called at any time. However, if it is not called in any of the previous conditions, + * the component may report an OMX_ErrorPortUnpopulated event. + * + * @param portIndex Indicates the component port. + * @param buffer Indicates the pointer to the structure of the buffer to release. For details about the + * structure, see {@link OmxCodecBuffer}. + * + * @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 OMX_ERRORTYPE defined by OpenMAX IL. + * + * @since 3.2 + */ + FreeBuffer([in] unsigned int portIndex, [in] struct OmxCodecBuffer buffer); + + /** + * @brief Empties a buffer. + * + * This API can be called when the component is in the OMX_StateExecuting or OMX_StatePause state. For details + * about the component states, see {@link OMX_STATETYPE}. + * + * @param buffer Indicates the pointer to the structure of the buffer to empty. For details about the structure, + * see {@link OmxCodecBuffer}. + * + * @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 OMX_ERRORTYPE defined by OpenMAX IL. + * + * @since 3.2 + */ + EmptyThisBuffer([in] struct OmxCodecBuffer buffer); + + /** + * @brief Fills a buffer with the encoding and decoding output by this component. + * + * This API can be called when the component is in the OMX_StateExecuting or OMX_StatePause state. For details + * about the component states, see {@link OMX_STATETYPE}. + * + * @param buffer Indicates the pointer to the structure of the buffer to be filled. For details about the + * structure, see {@link OmxCodecBuffer}. + * + * @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 OMX_ERRORTYPE defined by OpenMAX IL. + * + * @since 3.2 + */ + FillThisBuffer([in] struct OmxCodecBuffer buffer); + + /** + * @brief Sets callbacks for this component. + * + * The callbacks will be invoked to report an event or report available input or output information when the + * component is in the OMX_StateLoaded state. For details about the component states, see {@link OMX_STATETYPE}. + * + * @param callbacks Indicates the pointer to the {@link ICodecCallback} object. + * @param appData Indicates the pointer to an application-defined value that will be returned by the callback. + * + * @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 OMX_ERRORTYPE defined by OpenMAX IL. + * + * @since 3.2 + */ + SetCallbacks([in] ICodecCallback callbacks, [in] long appData); + + /** + * @brief Deinitializes this component. + * + * This API will deinitialize and close a component in the OMX_StateLoaded state. For details about the + * component states, see {@link OMX_STATETYPE}. + * + * @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 OMX_ERRORTYPE defined by OpenMAX IL. + * + * @since 3.2 + */ + ComponentDeInit(); + + /** + * @brief Uses the image provided by EGL as a buffer on the specified port. + * + * This API is used when: + * - The component is in the OMX_StateLoaded state and has received a request for changing the + * state to OMX_StateIdle. + * - The component is in the OMX_StateWaitForResources state, the required resources are available, + * and the component is ready to enter the OMX_StateIdle state. + * - The component is in the OMX_StateExecuting, OMX_StatePause, or OMX_StateIdle state on a disabled port. + * For details about the component states, see {@link OMX_STATETYPE}. + * + * @param portIndex Indicates the component port. + * @param inBuffer Indicates the pointer to the {@link OmxCodecBuffer} structure. + * @param outBuffer Indicates the pointer to the {@link OmxCodecBuffer} structure. + * @param eglImage Indicates the pointer to the image allocated by EGL. + * + * @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 OMX_ERRORTYPE defined by OpenMAX IL. + * + * @since 3.2 + */ + UseEglImage([in] unsigned int portIndex, [in] struct OmxCodecBuffer inBuffer, [out] struct OmxCodecBuffer + outBuffer, [in] byte[] eglImage); + + /** + * @brief Obtains the component role based on the index. + * + * + * + * @param role Indicates the role name obtained. + * @param index Indicates the index of the role. A component supports multiple roles. + * + * @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 OMX_ERRORTYPE defined by OpenMAX IL. + * + * @since 3.2 + */ + ComponentRoleEnum([out] unsigned char[] role, [in] unsigned int index); +} \ No newline at end of file diff --git a/codec/v2_0/ICodecComponentManager.idl b/codec/v2_0/ICodecComponentManager.idl new file mode 100644 index 00000000..108a14c4 --- /dev/null +++ b/codec/v2_0/ICodecComponentManager.idl @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2022 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 Codec module. + * + * The Codec module provides APIs for initializing the custom data and audio and video codecs, + * setting codec parameters, and controlling and transferring data. + * + * @since 3.2 + * @version 1.0 + */ + +/** + * @file ICodecComponentManager.idl + * + * @brief Declares the APIs for managing Codec components. + * + * You can use the APIs to obtain the component encoding and decoding capabilities, and create or destroy components. + * + * @since 3.2 + * @version 1.0 + */ + +/** + * @brief Defines the path for the package of the Codec module APIs. + * + * @since 3.2 + * @version 1.0 + */ +package ohos.hdi.codec.v1_0; + +import ohos.hdi.codec.v1_0.CodecTypes; +import ohos.hdi.codec.v1_0.ICodecComponent; +import ohos.hdi.codec.v1_0.ICodecCallback; + +/** + * @brief Defines the APIs for managing the codec components. + * + * The APIs can be used to: + * - Obtain the number of codec components and codec capabilities. + * - Create or destroy a codec component. + */ + +interface ICodecComponentManager { + + /** + * @brief Obtains the number of codec components. + * + * Codec capabilities can be further obtained based on the number of codec components. + * + * @param count Indicates the number of codec components 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 OMX_ERRORTYPE defined by OpenMAX IL. + * + * @since 3.2 + */ + GetComponentNum([out] int count); + + /** + * @brief Obtains codec capabilities. + * + * You can use this API to obtain the encoding and decoding capabilities provided by the Codec module. + * For details, see {@link CodecCompCapability}. + * + * @param capList Indicates the codec capabilities {@link CodecCompCapability} obtained. + * @param count Indicates the number of codec components, which is obtained by {@link GetComponentNum}. + * + * @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 OMX_ERRORTYPE defined by OpenMAX IL. + * + * @since 3.2 + */ + GetComponentCapabilityList([out] struct CodecCompCapability[] capList, [in] int count); + + /** + * @brief Creates a codec component instance. + * + * + * + * @param component Indicates the pointer to the Codec component created. + * @param componentId Indicates the ID of the component created. + * @param compName Indicates the component name. + * @param appData Indicates the pointer to an application-defined value that will be returned by the callback. + * @param callbacks Indicates the pointer to the OMX_CALLBACKTYPE structure. For details, + * see {@link ICodecCallback}. + * + * @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 OMX_ERRORTYPE defined by OpenMAX IL. + * + * @since 3.2 + */ + CreateComponent([out] ICodecComponent component, [out] unsigned int componentId, [in] String compName, + [in] long appData, [in] ICodecCallback callbacks); + + /** + * @brief Destroys a codec component instance. + * + * + * + * @param componentId Indicates the ID of the codec component to destroy. + * + * @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 OMX_ERRORTYPE defined by OpenMAX IL. + * + * @since 3.2 + */ + DestroyComponent([in] unsigned int componentId); +} \ No newline at end of file -- Gitee From 9f8d30c2a4ff26d5a8a3b0d7787d7ec4893a327c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=AF=97=E9=AB=98?= Date: Tue, 17 Oct 2023 13:18:33 +0000 Subject: [PATCH 14/28] update codec/v2_0/CodecExtTypes.idl. modify explanatory note alignment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李诗高 --- codec/v2_0/CodecExtTypes.idl | 114 +++++++++++++++++------------------ 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/codec/v2_0/CodecExtTypes.idl b/codec/v2_0/CodecExtTypes.idl index 0885b4a1..82946707 100644 --- a/codec/v2_0/CodecExtTypes.idl +++ b/codec/v2_0/CodecExtTypes.idl @@ -19,15 +19,15 @@ package ohos.hdi.codec.v1_0; * @brief Defines the OMX_VERSIONTYPE. */ struct NversionPara { - unsigned char nVersionMajor; /**< Major version accessor element */ - unsigned char nVersionMinor; /**< Minor version accessor element */ - unsigned char nRevision; /**< Revision version accessor element */ - unsigned char nStep; /**< Step version accessor element */ + unsigned char nVersionMajor; /**< Major version accessor element */ + unsigned char nVersionMinor; /**< Minor version accessor element */ + unsigned char nRevision; /**< Revision version accessor element */ + unsigned char nStep; /**< Step version accessor element */ }; union OMX_VERSIONTYPE { struct NversionPara s; - int nVersion; /**< 32 bit value to make accessing the + int nVersion; /**< 32 bit value to make accessing the version easily done in a single word size copy/compare operation */ }; @@ -108,10 +108,10 @@ enum CodecBufferType { * @brief Defines the SupportBuffer. */ struct SupportBufferType { - unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ - unsigned int portIndex; /** Port index */ - unsigned int bufferTypes; /** Supported buffer types */ + unsigned int size; /** Size of the structure */ + union OMX_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned int bufferTypes; /** Supported buffer types */ }; /** @@ -119,7 +119,7 @@ struct SupportBufferType { */ struct UseBufferType { unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ + union OMX_VERSIONTYPE version; /** Component version */ unsigned int portIndex; /** Port index */ unsigned int bufferType; /** Buffer type */ }; @@ -129,32 +129,32 @@ struct UseBufferType { */ struct GetBufferHandleUsageParams { unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ + union OMX_VERSIONTYPE version; /** Component version */ unsigned int portIndex; /** Port index */ - unsigned long usage; /** Usage */ + unsigned long usage; /** Usage */ }; /** * @brief Defines the CodecVideoPortFormatParam. */ struct CodecVideoPortFormatParam { - unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ - unsigned int portIndex; /** Port index */ - unsigned int codecColorIndex; /** Color format index */ - unsigned int codecColorFormat; /** Color format defined in Display */ - unsigned int codecCompressFormat; /** See */ - unsigned int framerate; /** Q16 format */ + unsigned int size; /** Size of the structure */ + union OMX_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned int codecColorIndex; /** Color format index */ + unsigned int codecColorFormat; /** Color format defined in Display */ + unsigned int codecCompressFormat; /** See */ + unsigned int framerate; /** Q16 format */ }; /** * @brief Defines the ControlRateConstantQuality. */ struct ControlRateConstantQuality { - unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ - unsigned int portIndex; /** Port index */ - unsigned int qualityValue; /** Control rate constant quality */ + unsigned int size; /** Size of the structure */ + union OMX_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned int qualityValue; /** Control rate constant quality */ }; /** @@ -183,14 +183,14 @@ enum OmxIndexCodecExType { * @brief Structure for controlling HEVC video encoding */ struct CodecVideoParamHevc { - unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ - unsigned int portIndex; /** Port index */ - enum CodecHevcProfile profile; /** Hevc profile. For details, see {@link CodecHevcProfile}. */ - enum CodecHevcLevel level; /** Hevc level. For details, see {@link CodecHevcLevel}. */ - unsigned int keyFrameInterval; /** Distance between consecutive I-frames (including one of the I frams). - 0 means interval is unspecified and can be freely chosen by the codec. - 1 means a stream of only I frams. other means the real value. */ + unsigned int size; /** Size of the structure */ + union OMX_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ + enum CodecHevcProfile profile; /** Hevc profile. For details, see {@link CodecHevcProfile}. */ + enum CodecHevcLevel level; /** Hevc level. For details, see {@link CodecHevcLevel}. */ + unsigned int keyFrameInterval; /** Distance between consecutive I-frames (including one of the I frams). + 0 means interval is unspecified and can be freely chosen by the codec. + 1 means a stream of only I frams. other means the real value. */ }; enum RangeType { @@ -202,39 +202,39 @@ enum RangeType { enum Primaries { PRIMARIES_UNSPECIFIED, - PRIMARIES_BT709, //Rec. ITU-R BT.709-6 - PRIMARIES_BT470_6M, //Rec. ITU-R BT.470-6 System M - PRIMARIES_BT601_625, //Rec. ITU-R BT.601-7 625 or Rec. ITU-R BT.470-6 System B,G - PRIMARIES_BT601_525, //Rec. ITU-R BT.601-7 525 or SMPTE ST 170 or SMPTE ST 240 - PRIMARIES_GENERICFILM, //Generic Film - PRIMARIES_BT2020, //Rec. ITU-R BT.2020-2 or Rec. ITU-R BT.2100-2 + PRIMARIES_BT709, //Rec. ITU-R BT.709-6 + PRIMARIES_BT470_6M, //Rec. ITU-R BT.470-6 System M + PRIMARIES_BT601_625, //Rec. ITU-R BT.601-7 625 or Rec. ITU-R BT.470-6 System B,G + PRIMARIES_BT601_525, //Rec. ITU-R BT.601-7 525 or SMPTE ST 170 or SMPTE ST 240 + PRIMARIES_GENERICFILM, //Generic Film + PRIMARIES_BT2020, //Rec. ITU-R BT.2020-2 or Rec. ITU-R BT.2100-2 PRIMARIES_MAX = 0xff, }; enum Transfer { TRANSFER_UNSPECIFIED, - TRANSFER_LINEAR, //Linear transfer characteristics - TRANSFER_SRGB, //IEC 61966-2-1 sRGB - TRANSFER_SMPTE170, //SMPTE ST 170 or Rec. ITU-R BT.709-6 or BT.601-7 or BT.2020-2 - TRANSFER_GAMMA22, //Rec. ITU-R BT.470-6 System M - TRANSFER_GAMMA28, //Rec. ITU-R BT.470-6 System B,G - TRANSFER_PQ, //Rec. ITU-R BT.2100-2 perceptual quantization (PQ) system - TRANSFER_HLG, //Rec. ITU-R BT.2100-2 hybrid log gamma (HLG) system - TRANSFER_SMPTE240 = 0x40, //SMPTE ST 240 - TRANSFER_XVYCC, //IEC 61966-2-4 - TRANSFER_BT1361, //Rec. ITU-R BT.1361-0 extended colour gamut system - TRANSFER_ST428, //SMPTE ST 428-1 + TRANSFER_LINEAR, //Linear transfer characteristics + TRANSFER_SRGB, //IEC 61966-2-1 sRGB + TRANSFER_SMPTE170, //SMPTE ST 170 or Rec. ITU-R BT.709-6 or BT.601-7 or BT.2020-2 + TRANSFER_GAMMA22, //Rec. ITU-R BT.470-6 System M + TRANSFER_GAMMA28, //Rec. ITU-R BT.470-6 System B,G + TRANSFER_PQ, //Rec. ITU-R BT.2100-2 perceptual quantization (PQ) system + TRANSFER_HLG, //Rec. ITU-R BT.2100-2 hybrid log gamma (HLG) system + TRANSFER_SMPTE240 = 0x40, //SMPTE ST 240 + TRANSFER_XVYCC, //IEC 61966-2-4 + TRANSFER_BT1361, //Rec. ITU-R BT.1361-0 extended colour gamut system + TRANSFER_ST428, //SMPTE ST 428-1 TRANSFER_MAX = 0xff, }; enum MatrixCoeffs { MATRIX_UNSPECIFED, - MATRIX_BT709, //Rec. ITU-R BT.709-6 - MATRIX_FCC, //United States Federal Communications Commission - MATRIX_BT601, //Rec. ITU-R BT.601-7 or Rec. ITU-R BT.470-6 System B,G - MATRIX_SMPTE240, //SMPTE ST 240 - MATRIX_BT2020, //Rec. ITU-R BT.2100-2 (non-constant luminance) - MATRIX_BT2020CONSTANT, //Rec. ITU-R BT.2100-2 (constant luminance) + MATRIX_BT709, //Rec. ITU-R BT.709-6 + MATRIX_FCC, //United States Federal Communications Commission + MATRIX_BT601, //Rec. ITU-R BT.601-7 or Rec. ITU-R BT.470-6 System B,G + MATRIX_SMPTE240, //SMPTE ST 240 + MATRIX_BT2020, //Rec. ITU-R BT.2100-2 (non-constant luminance) + MATRIX_BT2020CONSTANT, //Rec. ITU-R BT.2100-2 (constant luminance) MATRIX_MAX = 0xff, }; @@ -249,9 +249,9 @@ struct ColorAspects { * @brief Structure for controlling color space */ struct CodecVideoColorspace { - unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ - unsigned int portIndex; /** Port index */ + unsigned int size; /** Size of the structure */ + union OMX_VERSIONTYPE version; /** Component version */ + unsigned int portIndex; /** Port index */ unsigned int requestingDataSpace; unsigned int dataSpaceChanged; unsigned int pixeFormat; -- Gitee From ca833e6c16d52e7135244c137aab79202c5cc487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=AF=97=E9=AB=98?= Date: Tue, 17 Oct 2023 13:19:30 +0000 Subject: [PATCH 15/28] update codec/v2_0/CodecExtTypes.idl. modify explanatory note alignment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李诗高 --- codec/v2_0/CodecExtTypes.idl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codec/v2_0/CodecExtTypes.idl b/codec/v2_0/CodecExtTypes.idl index 82946707..a31571b4 100644 --- a/codec/v2_0/CodecExtTypes.idl +++ b/codec/v2_0/CodecExtTypes.idl @@ -36,8 +36,8 @@ union OMX_VERSIONTYPE { * @brief Enumerates the extended codec codingtyps. */ enum CodecVideoExType { - CODEC_OMX_VIDEO_CodingVP9 = 10, /** VP9 Index in Codec HDI */ - CODEC_OMX_VIDEO_CodingHEVC = 11, /** HEVC Index in Codec HDI */ + CODEC_OMX_VIDEO_CodingVP9 = 10, /** VP9 Index in Codec HDI */ + CODEC_OMX_VIDEO_CodingHEVC = 11, /** HEVC Index in Codec HDI */ }; /** -- Gitee From 8552b302cb5a4e54e00229d8b3b889e8b1c34e51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=AF=97=E9=AB=98?= Date: Tue, 17 Oct 2023 13:30:48 +0000 Subject: [PATCH 16/28] update codec/v2_0/CodecExtTypes.idl. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李诗高 --- codec/v2_0/CodecExtTypes.idl | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/codec/v2_0/CodecExtTypes.idl b/codec/v2_0/CodecExtTypes.idl index a31571b4..9e39ad87 100644 --- a/codec/v2_0/CodecExtTypes.idl +++ b/codec/v2_0/CodecExtTypes.idl @@ -15,22 +15,7 @@ package ohos.hdi.codec.v1_0; -/** - * @brief Defines the OMX_VERSIONTYPE. - */ -struct NversionPara { - unsigned char nVersionMajor; /**< Major version accessor element */ - unsigned char nVersionMinor; /**< Minor version accessor element */ - unsigned char nRevision; /**< Revision version accessor element */ - unsigned char nStep; /**< Step version accessor element */ -}; - -union OMX_VERSIONTYPE { - struct NversionPara s; - int nVersion; /**< 32 bit value to make accessing the - version easily done in a single word - size copy/compare operation */ -}; +import ohos.hdi.codec.v1_0.CodecTypes; /** * @brief Enumerates the extended codec codingtyps. @@ -109,7 +94,7 @@ enum CodecBufferType { */ struct SupportBufferType { unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ + union CodecVersiCodeconType version; /** Component version */ unsigned int portIndex; /** Port index */ unsigned int bufferTypes; /** Supported buffer types */ }; @@ -119,7 +104,7 @@ struct SupportBufferType { */ struct UseBufferType { unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ + union CodecVersiCodeconType version; /** Component version */ unsigned int portIndex; /** Port index */ unsigned int bufferType; /** Buffer type */ }; @@ -129,7 +114,7 @@ struct UseBufferType { */ struct GetBufferHandleUsageParams { unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ + union CodecVersiCodeconType version; /** Component version */ unsigned int portIndex; /** Port index */ unsigned long usage; /** Usage */ }; @@ -139,7 +124,7 @@ struct GetBufferHandleUsageParams { */ struct CodecVideoPortFormatParam { unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ + union CodecVersiCodeconType version; /** Component version */ unsigned int portIndex; /** Port index */ unsigned int codecColorIndex; /** Color format index */ unsigned int codecColorFormat; /** Color format defined in Display */ @@ -152,7 +137,7 @@ struct CodecVideoPortFormatParam { */ struct ControlRateConstantQuality { unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ + union CodecVersiCodeconType version; /** Component version */ unsigned int portIndex; /** Port index */ unsigned int qualityValue; /** Control rate constant quality */ }; @@ -184,7 +169,7 @@ enum OmxIndexCodecExType { */ struct CodecVideoParamHevc { unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ + union CodecVersiCodeconType version; /** Component version */ unsigned int portIndex; /** Port index */ enum CodecHevcProfile profile; /** Hevc profile. For details, see {@link CodecHevcProfile}. */ enum CodecHevcLevel level; /** Hevc level. For details, see {@link CodecHevcLevel}. */ @@ -249,9 +234,9 @@ struct ColorAspects { * @brief Structure for controlling color space */ struct CodecVideoColorspace { - unsigned int size; /** Size of the structure */ - union OMX_VERSIONTYPE version; /** Component version */ - unsigned int portIndex; /** Port index */ + unsigned int size; /** Size of the structure */ + union CodecVersiCodeconType version; /** Component version */ + unsigned int portIndex; /** Port index */ unsigned int requestingDataSpace; unsigned int dataSpaceChanged; unsigned int pixeFormat; -- Gitee From b1d389020bf401a6efd86efd3d2139c0f2ebfbe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=AF=97=E9=AB=98?= Date: Tue, 17 Oct 2023 14:02:26 +0000 Subject: [PATCH 17/28] update codec/v2_0/CodecExtTypes.idl. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李诗高 --- codec/v2_0/CodecExtTypes.idl | 78 ++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/codec/v2_0/CodecExtTypes.idl b/codec/v2_0/CodecExtTypes.idl index 9e39ad87..716951cb 100644 --- a/codec/v2_0/CodecExtTypes.idl +++ b/codec/v2_0/CodecExtTypes.idl @@ -93,89 +93,89 @@ enum CodecBufferType { * @brief Defines the SupportBuffer. */ struct SupportBufferType { - unsigned int size; /** Size of the structure */ + unsigned int size; /** Size of the structure */ union CodecVersiCodeconType version; /** Component version */ - unsigned int portIndex; /** Port index */ - unsigned int bufferTypes; /** Supported buffer types */ + unsigned int portIndex; /** Port index */ + unsigned int bufferTypes; /** Supported buffer types */ }; /** * @brief Define the UseBuffer. */ struct UseBufferType { - unsigned int size; /** Size of the structure */ - union CodecVersiCodeconType version; /** Component version */ - unsigned int portIndex; /** Port index */ - unsigned int bufferType; /** Buffer type */ + unsigned int size; /** Size of the structure */ + union CodecVersiCodeconType version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned int bufferType; /** Buffer type */ }; /** * @brief Defines the BufferHandleUsage. */ struct GetBufferHandleUsageParams { - unsigned int size; /** Size of the structure */ - union CodecVersiCodeconType version; /** Component version */ - unsigned int portIndex; /** Port index */ - unsigned long usage; /** Usage */ + unsigned int size; /** Size of the structure */ + union CodecVersiCodeconType version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned long usage; /** Usage */ }; /** * @brief Defines the CodecVideoPortFormatParam. */ struct CodecVideoPortFormatParam { - unsigned int size; /** Size of the structure */ - union CodecVersiCodeconType version; /** Component version */ - unsigned int portIndex; /** Port index */ - unsigned int codecColorIndex; /** Color format index */ - unsigned int codecColorFormat; /** Color format defined in Display */ - unsigned int codecCompressFormat; /** See */ - unsigned int framerate; /** Q16 format */ + unsigned int size; /** Size of the structure */ + union CodecVersiCodeconType version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned int codecColorIndex; /** Color format index */ + unsigned int codecColorFormat; /** Color format defined in Display */ + unsigned int codecCompressFormat; /** See */ + unsigned int framerate; /** Q16 format */ }; /** * @brief Defines the ControlRateConstantQuality. */ struct ControlRateConstantQuality { - unsigned int size; /** Size of the structure */ + unsigned int size; /** Size of the structure */ union CodecVersiCodeconType version; /** Component version */ - unsigned int portIndex; /** Port index */ - unsigned int qualityValue; /** Control rate constant quality */ + unsigned int portIndex; /** Port index */ + unsigned int qualityValue; /** Control rate constant quality */ }; /** * @brief Enumerates the extended codec indexes. */ -enum OmxIndexCodecExType { - /** Extended BufferType index, value = OMX_IndexKhronosExtensions + 0x00a00000 */ - OMX_IndexExtBufferTypeStartUnused = 0x6F000000 + 0x00a00000, +enum CodecIndexExType { + /** Extended BufferType index, value = Codec_IndexExtBufferTypeStartUnused + 0x00a00000 */ + Codec_IndexExtBufferTypeStartUnused = 0x6F000000 + 0x00a00000, /** SupportBuffer */ - OMX_IndexParamSupportBufferType, + Codec_IndexParamSupportBufferType, /** UseBuffer */ - OMX_IndexParamUseBufferType, + Codec_IndexParamUseBufferType, /** GetBufferHandleUsage */ - OMX_IndexParamGetBufferHandleUsage, + Codec_IndexParamGetBufferHandleUsage, /** CodecVideoPortFormatParam */ - OMX_IndexCodecVideoPortFormat, + Codec_IndexCodecVideoPortFormat, /** ControlRateConstantQuality */ - OMX_IndexParamControlRateConstantQuality, - /** OMX_IndexParamVideoHevc */ - OMX_IndexParamVideoHevc, + Codec_IndexParamControlRateConstantQuality, + /** Codec_IndexParamVideoHevc */ + Codec_IndexParamVideoHevc, /** range/primary/transfer/matrix */ - OMX_IndexColorAspects, + Codec_IndexColorAspects, }; /** * @brief Structure for controlling HEVC video encoding */ struct CodecVideoParamHevc { - unsigned int size; /** Size of the structure */ + unsigned int size; /** Size of the structure */ union CodecVersiCodeconType version; /** Component version */ - unsigned int portIndex; /** Port index */ - enum CodecHevcProfile profile; /** Hevc profile. For details, see {@link CodecHevcProfile}. */ - enum CodecHevcLevel level; /** Hevc level. For details, see {@link CodecHevcLevel}. */ - unsigned int keyFrameInterval; /** Distance between consecutive I-frames (including one of the I frams). - 0 means interval is unspecified and can be freely chosen by the codec. - 1 means a stream of only I frams. other means the real value. */ + unsigned int portIndex; /** Port index */ + enum CodecHevcProfile profile; /** Hevc profile. For details, see {@link CodecHevcProfile}. */ + enum CodecHevcLevel level; /** Hevc level. For details, see {@link CodecHevcLevel}. */ + unsigned int keyFrameInterval; /** Distance between consecutive I-frames (including one of the I frams). + 0 means interval is unspecified and can be freely chosen by the codec. + 1 means a stream of only I frams. other means the real value. */ }; enum RangeType { -- Gitee From a03db68139e09e550bf515dbfc48a7328ed98b6c Mon Sep 17 00:00:00 2001 From: lishigao Date: Thu, 19 Oct 2023 06:52:43 +0000 Subject: [PATCH 18/28] add Signed-off-by: lishigao --- codec/v2_0/CodecExtTypes.idl | 2 ++ codec/v2_0/CodecTypes.idl | 1 + 2 files changed, 3 insertions(+) diff --git a/codec/v2_0/CodecExtTypes.idl b/codec/v2_0/CodecExtTypes.idl index 716951cb..15105707 100644 --- a/codec/v2_0/CodecExtTypes.idl +++ b/codec/v2_0/CodecExtTypes.idl @@ -87,6 +87,8 @@ enum CodecBufferType { CODEC_BUFFER_TYPE_HANDLE = 0x4, /** Dynamic handle. */ CODEC_BUFFER_TYPE_DYNAMIC_HANDLE = 0x8, + /** DMA memory. */ + CODEC_BUFFER_TYPE_DMA_MEM_FD, }; /** diff --git a/codec/v2_0/CodecTypes.idl b/codec/v2_0/CodecTypes.idl index d8b15183..37a619db 100644 --- a/codec/v2_0/CodecTypes.idl +++ b/codec/v2_0/CodecTypes.idl @@ -361,6 +361,7 @@ struct OmxCodecBuffer { enum ShareMemTypes type; /**< Shared memory type. */ long pts; /**< Timestamp of the first logical sample in the buffer. */ unsigned int flag; /**< Buffer specific flag. */ + unsigned char[] alongParam; /**< Along frame parameter. */ }; /** -- Gitee From 6e23ee7b4329989b5ac55351d40fc991b92af544 Mon Sep 17 00:00:00 2001 From: yh Date: Mon, 23 Oct 2023 14:26:31 +0800 Subject: [PATCH 19/28] idl add Signed-off-by: yh --- codec/v2_0/CodecExtTypes.idl | 8 ++-- codec/v2_0/CodecTypes.idl | 16 ++++---- codec/v2_0/ICodecCallback.idl | 24 ++++++------ codec/v2_0/ICodecComponent.idl | 56 +++++++++++++-------------- codec/v2_0/ICodecComponentManager.idl | 30 +++++++------- 5 files changed, 67 insertions(+), 67 deletions(-) diff --git a/codec/v2_0/CodecExtTypes.idl b/codec/v2_0/CodecExtTypes.idl index 15105707..6fdde7a4 100644 --- a/codec/v2_0/CodecExtTypes.idl +++ b/codec/v2_0/CodecExtTypes.idl @@ -13,16 +13,16 @@ * limitations under the License. */ -package ohos.hdi.codec.v1_0; +package ohos.hdi.codec.v2_0; -import ohos.hdi.codec.v1_0.CodecTypes; +import ohos.hdi.codec.v2_0.CodecTypes; /** * @brief Enumerates the extended codec codingtyps. */ enum CodecVideoExType { - CODEC_OMX_VIDEO_CodingVP9 = 10, /** VP9 Index in Codec HDI */ - CODEC_OMX_VIDEO_CodingHEVC = 11, /** HEVC Index in Codec HDI */ + CODEC_VIDEO_CodingVP9 = 10, /** VP9 Index in Codec HDI */ + CODEC_VIDEO_CodingHEVC = 11, /** HEVC Index in Codec HDI */ }; /** diff --git a/codec/v2_0/CodecTypes.idl b/codec/v2_0/CodecTypes.idl index 37a619db..6b0ea607 100644 --- a/codec/v2_0/CodecTypes.idl +++ b/codec/v2_0/CodecTypes.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 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 @@ -22,8 +22,8 @@ * The Codec module provides APIs for initializing the custom data and audio and video codecs, * setting codec parameters, and controlling and transferring data. * - * @since 3.2 - * @version 1.0 + * @since 4.1 + * @version 2.0 */ /** @@ -33,17 +33,17 @@ * including the codec types, audio and video parameters, and buffers. * * - * @since 3.2 - * @version 1.0 + * @since 4.1 + * @version 2.0 */ /** * @brief Defines the path for the package of the Codec module APIs. * - * @since 3.2 - * @version 1.0 + * @since 4.1 + * @version 2.0 */ -package ohos.hdi.codec.v1_0; +package ohos.hdi.codec.v2_0; /** * @brief Enumerates the codec types. diff --git a/codec/v2_0/ICodecCallback.idl b/codec/v2_0/ICodecCallback.idl index de6d0473..c3c0c0d9 100644 --- a/codec/v2_0/ICodecCallback.idl +++ b/codec/v2_0/ICodecCallback.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 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 @@ -22,8 +22,8 @@ * The Codec module provides APIs for initializing the custom data and audio and video codecs, * setting codec parameters, and controlling and transferring data. * - * @since 3.2 - * @version 1.0 + * @since 4.1 + * @version 2.0 */ /** @@ -33,19 +33,19 @@ * * * - * @since 3.2 - * @version 1.0 + * @since 4.1 + * @version 2.0 */ /** * @brief Defines the path for the package of the Codec module APIs. * - * @since 3.2 - * @version 1.0 + * @since 4.1 + * @version 2.0 */ -package ohos.hdi.codec.v1_0; +package ohos.hdi.codec.v2_0; -import ohos.hdi.codec.v1_0.CodecTypes; +import ohos.hdi.codec.v2_0.CodecTypes; /** * @brief Defines the callbacks of the Codec module. @@ -89,7 +89,7 @@ import ohos.hdi.codec.v1_0.CodecTypes; * @return Returns other values if the underlying layer returns a failure. For details about the error codes, * see OMX_ERRORTYPE defined by OpenMAX IL. * - * @since 3.2 + * @since 4.1 */ EventHandler([in] enum CodecEventType event, [in] struct EventInfo info); @@ -108,7 +108,7 @@ import ohos.hdi.codec.v1_0.CodecTypes; * @return Returns other values if the underlying layer returns a failure. For details about the * error codes, see OMX_ERRORTYPE defined by OpenMAX IL. * - * @since 3.2 + * @since 4.1 */ EmptyBufferDone([in] long appData, [in] struct OmxCodecBuffer buffer); @@ -126,7 +126,7 @@ import ohos.hdi.codec.v1_0.CodecTypes; * @return Returns other values if the underlying layer returns a failure. For details about the error codes, * see OMX_ERRORTYPE defined by OpenMAX IL. * - * @since 3.2 + * @since 4.1 */ FillBufferDone([in] long appData, [in] struct OmxCodecBuffer buffer); } diff --git a/codec/v2_0/ICodecComponent.idl b/codec/v2_0/ICodecComponent.idl index a592efc6..b3c24904 100644 --- a/codec/v2_0/ICodecComponent.idl +++ b/codec/v2_0/ICodecComponent.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 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 @@ -22,8 +22,8 @@ * The Codec module provides APIs for initializing the custom data and audio and video codecs, * setting codec parameters, and controlling and transferring data. * - * @since 3.2 - * @version 1.0 + * @since 4.1 + * @version 2.0 */ /** @@ -35,20 +35,20 @@ * set component parameters, and control and transfer buffer data. * After creating a component, you can use these APIs to implement encoding and decoding. * - * @since 3.2 - * @version 1.0 + * @since 4.1 + * @version 2.0 */ /** * @brief Defines the path for the package of the Codec module APIs. * - * @since 3.2 - * @version 1.0 + * @since 4.1 + * @version 2.0 */ -package ohos.hdi.codec.v1_0; +package ohos.hdi.codec.v2.0; -import ohos.hdi.codec.v1_0.CodecTypes; -import ohos.hdi.codec.v1_0.ICodecCallback; +import ohos.hdi.codec.v2_0.CodecTypes; +import ohos.hdi.codec.v2_0.ICodecCallback; /** * @brief Defines the APIs for codec components. @@ -77,7 +77,7 @@ interface ICodecComponent { * @return Returns other values if the underlying layer returns a failure. For details about the error codes, * see OMX_ERRORTYPE defined by OpenMAX IL. * - * @since 3.2 + * @since 4.1 */ GetComponentVersion([out] struct CompVerInfo verInfo); @@ -101,7 +101,7 @@ interface ICodecComponent { * @return Returns other values if the underlying layer returns a failure. For details about the error codes, * see OMX_ERRORTYPE defined by OpenMAX IL. * - * @since 3.2 + * @since 4.1 */ SendCommand([in] enum CodecCommandType cmd, [in] unsigned int param, [in] byte[] cmdData); @@ -122,7 +122,7 @@ interface ICodecComponent { * @return Returns other values if the underlying layer returns a failure. For details about * the error codes, see OMX_ERRORTYPE defined by OpenMAX IL. * - * @since 3.2 + * @since 4.1 */ GetParameter([in] unsigned int index, [in] byte[] inParamStruct, [out] byte[] outParamStruct); @@ -146,7 +146,7 @@ interface ICodecComponent { * @return Returns other values if the underlying layer returns a failure. For details about the error codes, * see OMX_ERRORTYPE defined by OpenMAX IL. * - * @since 3.2 + * @since 4.1 */ SetParameter([in] unsigned int index, [in] byte[] paramStruct); @@ -165,7 +165,7 @@ interface ICodecComponent { * @return Returns other values if the underlying layer returns a failure. For details about the error codes, * see OMX_ERRORTYPE defined by OpenMAX IL. * - * @since 3.2 + * @since 4.1 */ GetConfig([in] unsigned int index, [in] byte[] inCfgStruct, [out] byte[] outCfgStruct); @@ -183,7 +183,7 @@ interface ICodecComponent { * @return Returns other values if the underlying layer returns a failure. For details about the error codes, * see OMX_ERRORTYPE defined by OpenMAX IL. * - * @since 3.2 + * @since 4.1 */ SetConfig([in] unsigned int index, [in] byte[] cfgStruct); @@ -202,7 +202,7 @@ interface ICodecComponent { * @return Returns other values if the underlying layer returns a failure. For details about the error codes, * see OMX_ERRORTYPE defined by OpenMAX IL. * - * @since 3.2 + * @since 4.1 */ GetExtensionIndex([in] String paramName, [out] unsigned int indexType); @@ -220,7 +220,7 @@ interface ICodecComponent { * @return Returns other values if the underlying layer returns a failure. For details about the error codes, * see OMX_ERRORTYPE defined by OpenMAX IL. * - * @since 3.2 + * @since 4.1 */ GetState([out] enum CodecStateType state); @@ -244,7 +244,7 @@ interface ICodecComponent { * @return Returns other values if the underlying layer returns a failure. For details about the error codes, * see OMX_ERRORTYPE defined by OpenMAX IL. * - * @since 3.2 + * @since 4.1 */ ComponentTunnelRequest([in] unsigned int port, [in] int tunneledComp, [in] unsigned int tunneledPort, [in] struct CodecTunnelSetupType inTunnelSetup, [out] struct CodecTunnelSetupType outTunnelSetup); @@ -270,7 +270,7 @@ interface ICodecComponent { * @return Returns other values if the underlying layer returns a failure. For details about the error codes, * see OMX_ERRORTYPE defined by OpenMAX IL. * - * @since 3.2 + * @since 4.1 */ UseBuffer([in] unsigned int portIndex, [in] struct OmxCodecBuffer inBuffer, [out] struct OmxCodecBuffer outBuffer); @@ -297,7 +297,7 @@ interface ICodecComponent { * @return Returns other values if the underlying layer returns a failure. For details about the error codes, * see OMX_ERRORTYPE defined by OpenMAX IL. * - * @since 3.2 + * @since 4.1 */ AllocateBuffer([in] unsigned int portIndex, [in] struct OmxCodecBuffer inBuffer, [out] struct OmxCodecBuffer outBuffer); @@ -323,7 +323,7 @@ interface ICodecComponent { * @return Returns other values if the underlying layer returns a failure. For details about the error codes, * see OMX_ERRORTYPE defined by OpenMAX IL. * - * @since 3.2 + * @since 4.1 */ FreeBuffer([in] unsigned int portIndex, [in] struct OmxCodecBuffer buffer); @@ -342,7 +342,7 @@ interface ICodecComponent { * @return Returns other values if the underlying layer returns a failure. For details about the error codes, * see OMX_ERRORTYPE defined by OpenMAX IL. * - * @since 3.2 + * @since 4.1 */ EmptyThisBuffer([in] struct OmxCodecBuffer buffer); @@ -361,7 +361,7 @@ interface ICodecComponent { * @return Returns other values if the underlying layer returns a failure. For details about the error codes, * see OMX_ERRORTYPE defined by OpenMAX IL. * - * @since 3.2 + * @since 4.1 */ FillThisBuffer([in] struct OmxCodecBuffer buffer); @@ -380,7 +380,7 @@ interface ICodecComponent { * @return Returns other values if the underlying layer returns a failure. For details about the error codes, * see OMX_ERRORTYPE defined by OpenMAX IL. * - * @since 3.2 + */ SetCallbacks([in] ICodecCallback callbacks, [in] long appData); @@ -396,7 +396,7 @@ interface ICodecComponent { * @return Returns other values if the underlying layer returns a failure. For details about the error codes, * see OMX_ERRORTYPE defined by OpenMAX IL. * - * @since 3.2 + * @since 4.1 */ ComponentDeInit(); @@ -422,7 +422,7 @@ interface ICodecComponent { * @return Returns other values if the underlying layer returns a failure. For details about the error codes, * see OMX_ERRORTYPE defined by OpenMAX IL. * - * @since 3.2 + * @since 4.1 */ UseEglImage([in] unsigned int portIndex, [in] struct OmxCodecBuffer inBuffer, [out] struct OmxCodecBuffer outBuffer, [in] byte[] eglImage); @@ -441,7 +441,7 @@ interface ICodecComponent { * @return Returns other values if the underlying layer returns a failure. For details about the error * codes, see OMX_ERRORTYPE defined by OpenMAX IL. * - * @since 3.2 + * @since 4.1 */ ComponentRoleEnum([out] unsigned char[] role, [in] unsigned int index); } \ No newline at end of file diff --git a/codec/v2_0/ICodecComponentManager.idl b/codec/v2_0/ICodecComponentManager.idl index 108a14c4..ca670d52 100644 --- a/codec/v2_0/ICodecComponentManager.idl +++ b/codec/v2_0/ICodecComponentManager.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 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 @@ -22,8 +22,8 @@ * The Codec module provides APIs for initializing the custom data and audio and video codecs, * setting codec parameters, and controlling and transferring data. * - * @since 3.2 - * @version 1.0 + * @since 4.1 + * @version 2.0 */ /** @@ -33,21 +33,21 @@ * * You can use the APIs to obtain the component encoding and decoding capabilities, and create or destroy components. * - * @since 3.2 - * @version 1.0 + * @since 4.1 + * @version 2.0 */ /** * @brief Defines the path for the package of the Codec module APIs. * - * @since 3.2 - * @version 1.0 + * @since 4.1 + * @version 2.0 */ -package ohos.hdi.codec.v1_0; +package ohos.hdi.codec.v2_0; -import ohos.hdi.codec.v1_0.CodecTypes; -import ohos.hdi.codec.v1_0.ICodecComponent; -import ohos.hdi.codec.v1_0.ICodecCallback; +import ohos.hdi.codec.v2_0.CodecTypes; +import ohos.hdi.codec.v2_0.ICodecComponent; +import ohos.hdi.codec.v2_0.ICodecCallback; /** * @brief Defines the APIs for managing the codec components. @@ -72,7 +72,7 @@ interface ICodecComponentManager { * @return Returns other values if the underlying layer returns a failure. For details about the * error codes, see OMX_ERRORTYPE defined by OpenMAX IL. * - * @since 3.2 + * @since 4.1 */ GetComponentNum([out] int count); @@ -91,7 +91,7 @@ interface ICodecComponentManager { * @return Returns other values if the underlying layer returns a failure. For details about the error codes, * see OMX_ERRORTYPE defined by OpenMAX IL. * - * @since 3.2 + * @since 4.1 */ GetComponentCapabilityList([out] struct CodecCompCapability[] capList, [in] int count); @@ -113,7 +113,7 @@ interface ICodecComponentManager { * @return Returns other values if the underlying layer returns a failure. For details about the error codes, * see OMX_ERRORTYPE defined by OpenMAX IL. * - * @since 3.2 + * @since 4.1 */ CreateComponent([out] ICodecComponent component, [out] unsigned int componentId, [in] String compName, [in] long appData, [in] ICodecCallback callbacks); @@ -131,7 +131,7 @@ interface ICodecComponentManager { * @return Returns other values if the underlying layer returns a failure. For details about the * error codes, see OMX_ERRORTYPE defined by OpenMAX IL. * - * @since 3.2 + * @since 4.1 */ DestroyComponent([in] unsigned int componentId); } \ No newline at end of file -- Gitee From ea487d5d7b3dbeb179ac64e26da4f0bf99961761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=AF=97=E9=AB=98?= Date: Tue, 24 Oct 2023 02:23:45 +0000 Subject: [PATCH 20/28] update codec/bundle.json. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李诗高 --- codec/bundle.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codec/bundle.json b/codec/bundle.json index 04b39248..48260172 100644 --- a/codec/bundle.json +++ b/codec/bundle.json @@ -11,9 +11,9 @@ "scripts": {}, "component": { "name": "drivers_interface_codec", - "subsystem": "hdf", + "subsystem": "drivers", "syscap": [], - "adapted_system_type": ["standard"], + "adapted_system_type": ["small,standard"], "rom": "675KB", "ram": "7400KB", "deps": { -- Gitee From e0d5b2ad5724c40d8e70bb9cb18097e6e8f0b206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=AF=97=E9=AB=98?= Date: Tue, 24 Oct 2023 05:54:28 +0000 Subject: [PATCH 21/28] update codec/v2_0/ICodecComponent.idl. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李诗高 --- codec/v2_0/ICodecComponent.idl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codec/v2_0/ICodecComponent.idl b/codec/v2_0/ICodecComponent.idl index b3c24904..0abeac2e 100644 --- a/codec/v2_0/ICodecComponent.idl +++ b/codec/v2_0/ICodecComponent.idl @@ -427,7 +427,7 @@ interface ICodecComponent { UseEglImage([in] unsigned int portIndex, [in] struct OmxCodecBuffer inBuffer, [out] struct OmxCodecBuffer outBuffer, [in] byte[] eglImage); - /** + /** * @brief Obtains the component role based on the index. * * -- Gitee From f804c1cbf66663cc1e5109bfbbd22b81e1e6aeff Mon Sep 17 00:00:00 2001 From: lishigao Date: Tue, 24 Oct 2023 07:31:11 +0000 Subject: [PATCH 22/28] 11 Signed-off-by: lishigao --- codec/bundle.json | 4 ++-- codec/v2_0/BUILD.gn | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/codec/bundle.json b/codec/bundle.json index 48260172..04b39248 100644 --- a/codec/bundle.json +++ b/codec/bundle.json @@ -11,9 +11,9 @@ "scripts": {}, "component": { "name": "drivers_interface_codec", - "subsystem": "drivers", + "subsystem": "hdf", "syscap": [], - "adapted_system_type": ["small,standard"], + "adapted_system_type": ["standard"], "rom": "675KB", "ram": "7400KB", "deps": { diff --git a/codec/v2_0/BUILD.gn b/codec/v2_0/BUILD.gn index b7a949a4..4c6f9f59 100644 --- a/codec/v2_0/BUILD.gn +++ b/codec/v2_0/BUILD.gn @@ -22,11 +22,11 @@ if (defined(ohos_lite)) { module_name = "codec_service" sources = [ + "CodecExtTypes.idl", "CodecTypes.idl", "ICodecCallback.idl", "ICodecComponent.idl", "ICodecComponentManager.idl", - "CodecExtTypes.idl" ] language = "cpp" subsystem_name = "hdf" -- Gitee From 21850584ee3bfe7ac4feb518d337d3c02befd0e6 Mon Sep 17 00:00:00 2001 From: lishigao Date: Tue, 24 Oct 2023 09:20:02 +0000 Subject: [PATCH 23/28] 12 Signed-off-by: lishigao --- codec/bundle.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codec/bundle.json b/codec/bundle.json index 04b39248..0755fc27 100644 --- a/codec/bundle.json +++ b/codec/bundle.json @@ -13,7 +13,7 @@ "name": "drivers_interface_codec", "subsystem": "hdf", "syscap": [], - "adapted_system_type": ["standard"], + "adapted_system_type": ["small,standard"], "rom": "675KB", "ram": "7400KB", "deps": { -- Gitee From c6da884a1aa848ef528d4ef90504ff388eb38ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=AF=97=E9=AB=98?= Date: Tue, 24 Oct 2023 12:20:46 +0000 Subject: [PATCH 24/28] update codec/bundle.json. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李诗高 --- codec/bundle.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codec/bundle.json b/codec/bundle.json index 0755fc27..04b39248 100644 --- a/codec/bundle.json +++ b/codec/bundle.json @@ -13,7 +13,7 @@ "name": "drivers_interface_codec", "subsystem": "hdf", "syscap": [], - "adapted_system_type": ["small,standard"], + "adapted_system_type": ["standard"], "rom": "675KB", "ram": "7400KB", "deps": { -- Gitee From 67f5c1960ff9dd83a123468d05e19291bd1f8a99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=AF=97=E9=AB=98?= Date: Wed, 25 Oct 2023 02:37:40 +0000 Subject: [PATCH 25/28] update codec/bundle.json. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李诗高 --- codec/bundle.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codec/bundle.json b/codec/bundle.json index 04b39248..0e21f344 100644 --- a/codec/bundle.json +++ b/codec/bundle.json @@ -13,7 +13,7 @@ "name": "drivers_interface_codec", "subsystem": "hdf", "syscap": [], - "adapted_system_type": ["standard"], + "adapted_system_type": ["small,standard"], "rom": "675KB", "ram": "7400KB", "deps": { -- Gitee From dbc50268acaafc3d597157193c78e4be0aed1236 Mon Sep 17 00:00:00 2001 From: lishigao Date: Wed, 25 Oct 2023 06:07:07 +0000 Subject: [PATCH 26/28] CodecVersiCodeconType to CodecVersionType Signed-off-by: lishigao --- codec/v2_0/CodecExtTypes.idl | 68 ++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/codec/v2_0/CodecExtTypes.idl b/codec/v2_0/CodecExtTypes.idl index 6fdde7a4..f35a7728 100644 --- a/codec/v2_0/CodecExtTypes.idl +++ b/codec/v2_0/CodecExtTypes.idl @@ -95,53 +95,53 @@ enum CodecBufferType { * @brief Defines the SupportBuffer. */ struct SupportBufferType { - unsigned int size; /** Size of the structure */ - union CodecVersiCodeconType version; /** Component version */ - unsigned int portIndex; /** Port index */ - unsigned int bufferTypes; /** Supported buffer types */ + unsigned int size; /** Size of the structure */ + union CodecVersionType version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned int bufferTypes; /** Supported buffer types */ }; /** * @brief Define the UseBuffer. */ struct UseBufferType { - unsigned int size; /** Size of the structure */ - union CodecVersiCodeconType version; /** Component version */ - unsigned int portIndex; /** Port index */ - unsigned int bufferType; /** Buffer type */ + unsigned int size; /** Size of the structure */ + union CodecVersionType version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned int bufferType; /** Buffer type */ }; /** * @brief Defines the BufferHandleUsage. */ struct GetBufferHandleUsageParams { - unsigned int size; /** Size of the structure */ - union CodecVersiCodeconType version; /** Component version */ - unsigned int portIndex; /** Port index */ - unsigned long usage; /** Usage */ + unsigned int size; /** Size of the structure */ + union CodecVersionType version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned long usage; /** Usage */ }; /** * @brief Defines the CodecVideoPortFormatParam. */ struct CodecVideoPortFormatParam { - unsigned int size; /** Size of the structure */ - union CodecVersiCodeconType version; /** Component version */ - unsigned int portIndex; /** Port index */ - unsigned int codecColorIndex; /** Color format index */ - unsigned int codecColorFormat; /** Color format defined in Display */ - unsigned int codecCompressFormat; /** See */ - unsigned int framerate; /** Q16 format */ + unsigned int size; /** Size of the structure */ + union CodecVersionType version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned int codecColorIndex; /** Color format index */ + unsigned int codecColorFormat; /** Color format defined in Display */ + unsigned int codecCompressFormat; /** See */ + unsigned int framerate; /** Q16 format */ }; /** * @brief Defines the ControlRateConstantQuality. */ struct ControlRateConstantQuality { - unsigned int size; /** Size of the structure */ - union CodecVersiCodeconType version; /** Component version */ - unsigned int portIndex; /** Port index */ - unsigned int qualityValue; /** Control rate constant quality */ + unsigned int size; /** Size of the structure */ + union CodecVersionType version; /** Component version */ + unsigned int portIndex; /** Port index */ + unsigned int qualityValue; /** Control rate constant quality */ }; /** @@ -170,14 +170,14 @@ enum CodecIndexExType { * @brief Structure for controlling HEVC video encoding */ struct CodecVideoParamHevc { - unsigned int size; /** Size of the structure */ - union CodecVersiCodeconType version; /** Component version */ - unsigned int portIndex; /** Port index */ - enum CodecHevcProfile profile; /** Hevc profile. For details, see {@link CodecHevcProfile}. */ - enum CodecHevcLevel level; /** Hevc level. For details, see {@link CodecHevcLevel}. */ - unsigned int keyFrameInterval; /** Distance between consecutive I-frames (including one of the I frams). - 0 means interval is unspecified and can be freely chosen by the codec. - 1 means a stream of only I frams. other means the real value. */ + unsigned int size; /** Size of the structure */ + union CodecVersionType version; /** Component version */ + unsigned int portIndex; /** Port index */ + enum CodecHevcProfile profile; /** Hevc profile. For details, see {@link CodecHevcProfile}. */ + enum CodecHevcLevel level; /** Hevc level. For details, see {@link CodecHevcLevel}. */ + unsigned int keyFrameInterval; /** Distance between consecutive I-frames (including one of the I frams). + 0 means interval is unspecified and can be freely chosen by the codec. + 1 means a stream of only I frams. other means the real value. */ }; enum RangeType { @@ -236,9 +236,9 @@ struct ColorAspects { * @brief Structure for controlling color space */ struct CodecVideoColorspace { - unsigned int size; /** Size of the structure */ - union CodecVersiCodeconType version; /** Component version */ - unsigned int portIndex; /** Port index */ + unsigned int size; /** Size of the structure */ + union CodecVersionType version; /** Component version */ + unsigned int portIndex; /** Port index */ unsigned int requestingDataSpace; unsigned int dataSpaceChanged; unsigned int pixeFormat; -- Gitee From de80587858c08fdb9f3134d73435c762a8e92135 Mon Sep 17 00:00:00 2001 From: lishigao Date: Wed, 25 Oct 2023 07:54:09 +0000 Subject: [PATCH 27/28] 14 Signed-off-by: lishigao --- codec/bundle.json | 1 - codec/v2_0/BUILD.gn | 4 ++-- codec/v2_0/CodecExtTypes.idl | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/codec/bundle.json b/codec/bundle.json index 0e21f344..f35e4c51 100644 --- a/codec/bundle.json +++ b/codec/bundle.json @@ -106,7 +106,6 @@ "header_base": "//drivers/interface/codec" } } - ] } } diff --git a/codec/v2_0/BUILD.gn b/codec/v2_0/BUILD.gn index 4c6f9f59..8a8af59e 100644 --- a/codec/v2_0/BUILD.gn +++ b/codec/v2_0/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2023 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 @@ -22,11 +22,11 @@ if (defined(ohos_lite)) { module_name = "codec_service" sources = [ - "CodecExtTypes.idl", "CodecTypes.idl", "ICodecCallback.idl", "ICodecComponent.idl", "ICodecComponentManager.idl", + "CodecExtTypes.idl", ] language = "cpp" subsystem_name = "hdf" diff --git a/codec/v2_0/CodecExtTypes.idl b/codec/v2_0/CodecExtTypes.idl index f35a7728..85cbdfa4 100644 --- a/codec/v2_0/CodecExtTypes.idl +++ b/codec/v2_0/CodecExtTypes.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 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 -- Gitee From 1bdb5223c7432e25ef25932e215c33e253102601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=AF=97=E9=AB=98?= Date: Thu, 26 Oct 2023 10:48:38 +0000 Subject: [PATCH 28/28] update codec/v2_0/BUILD.gn. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李诗高 --- codec/v2_0/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codec/v2_0/BUILD.gn b/codec/v2_0/BUILD.gn index 8a8af59e..d2112592 100644 --- a/codec/v2_0/BUILD.gn +++ b/codec/v2_0/BUILD.gn @@ -22,11 +22,11 @@ if (defined(ohos_lite)) { module_name = "codec_service" sources = [ + "CodecExtTypes.idl", "CodecTypes.idl", "ICodecCallback.idl", "ICodecComponent.idl", "ICodecComponentManager.idl", - "CodecExtTypes.idl", ] language = "cpp" subsystem_name = "hdf" -- Gitee