1794c9f46Sopenharmony_ci/* 2794c9f46Sopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd. 3794c9f46Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4794c9f46Sopenharmony_ci * you may not use this file except in compliance with the License. 5794c9f46Sopenharmony_ci * You may obtain a copy of the License at 6794c9f46Sopenharmony_ci * 7794c9f46Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8794c9f46Sopenharmony_ci * 9794c9f46Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10794c9f46Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11794c9f46Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12794c9f46Sopenharmony_ci * See the License for the specific language governing permissions and 13794c9f46Sopenharmony_ci * limitations under the License. 14794c9f46Sopenharmony_ci */ 15794c9f46Sopenharmony_ci 16794c9f46Sopenharmony_ci#ifndef OHOS_HISTREAMER_ABILITY_PARSER_H 17794c9f46Sopenharmony_ci#define OHOS_HISTREAMER_ABILITY_PARSER_H 18794c9f46Sopenharmony_ci 19794c9f46Sopenharmony_ci#include <cstdint> 20794c9f46Sopenharmony_ci#include <string> 21794c9f46Sopenharmony_ci#include <vector> 22794c9f46Sopenharmony_ci 23794c9f46Sopenharmony_ci#include "cJSON.h" 24794c9f46Sopenharmony_ci 25794c9f46Sopenharmony_ci#ifndef API_EXPORT 26794c9f46Sopenharmony_ci#define API_EXPORT __attribute__((visibility("default"))) 27794c9f46Sopenharmony_ci#endif 28794c9f46Sopenharmony_ci 29794c9f46Sopenharmony_cinamespace OHOS { 30794c9f46Sopenharmony_cinamespace DistributedHardware { 31794c9f46Sopenharmony_ci 32794c9f46Sopenharmony_ci/** 33794c9f46Sopenharmony_ci * @enum Audio AAC Profile。 34794c9f46Sopenharmony_ci * 35794c9f46Sopenharmony_ci * AAC mode type. Note that the term profile is used with the MPEG-2 36794c9f46Sopenharmony_ci * standard and the term object type and profile is used with MPEG-4 37794c9f46Sopenharmony_ci * 38794c9f46Sopenharmony_ci * @since 1.0 39794c9f46Sopenharmony_ci * @version 1.0 40794c9f46Sopenharmony_ci */ 41794c9f46Sopenharmony_cienum struct AudioAacProfile : uint8_t { 42794c9f46Sopenharmony_ci NONE = 0, ///< Null, not used 43794c9f46Sopenharmony_ci MAIN = 1, ///< AAC Main object 44794c9f46Sopenharmony_ci LC, ///< AAC Low Complexity object (AAC profile) 45794c9f46Sopenharmony_ci SSR, ///< AAC Scalable Sample Rate object 46794c9f46Sopenharmony_ci LTP, ///< AAC Long Term Prediction object 47794c9f46Sopenharmony_ci HE, ///< AAC High Efficiency (object type SBR, HE-AAC profile) 48794c9f46Sopenharmony_ci SCALABLE, ///< AAC Scalable object 49794c9f46Sopenharmony_ci ERLC = 17, ///< ER AAC Low Complexity object (Error Resilient AAC-LC) 50794c9f46Sopenharmony_ci ER_SCALABLE = 20, ///< ER AAC scalable object 51794c9f46Sopenharmony_ci LD = 23, ///< AAC Low Delay object (Error Resilient) 52794c9f46Sopenharmony_ci HE_PS = 29, ///< AAC High Efficiency with Parametric Stereo coding (HE-AAC v2, object type PS) 53794c9f46Sopenharmony_ci ELD = 39, ///< AAC Enhanced Low Delay. NOTE: Pending Khronos standardization 54794c9f46Sopenharmony_ci XHE = 42, ///< extended High Efficiency AAC. NOTE: Pending Khronos standardization 55794c9f46Sopenharmony_ci}; 56794c9f46Sopenharmony_ci 57794c9f46Sopenharmony_ci/** 58794c9f46Sopenharmony_ci * @enum Audio AAC Stream Format 59794c9f46Sopenharmony_ci * 60794c9f46Sopenharmony_ci * @since 1.0 61794c9f46Sopenharmony_ci * @version 1.0 62794c9f46Sopenharmony_ci */ 63794c9f46Sopenharmony_cienum struct AudioAacStreamFormat : uint8_t { 64794c9f46Sopenharmony_ci MP2ADTS = 0, ///< AAC Audio Data Transport Stream 2 format 65794c9f46Sopenharmony_ci MP4ADTS, ///< AAC Audio Data Transport Stream 4 format 66794c9f46Sopenharmony_ci MP4LOAS, ///< AAC Low Overhead Audio Stream format 67794c9f46Sopenharmony_ci MP4LATM, ///< AAC Low overhead Audio Transport Multiplex 68794c9f46Sopenharmony_ci ADIF, ///< AAC Audio Data Interchange Format 69794c9f46Sopenharmony_ci MP4FF, ///< AAC inside MPEG-4/ISO File Format 70794c9f46Sopenharmony_ci RAW, ///< AAC Raw Format 71794c9f46Sopenharmony_ci}; 72794c9f46Sopenharmony_ci 73794c9f46Sopenharmony_ci/** 74794c9f46Sopenharmony_ci * @enum Audio Channel Masks 75794c9f46Sopenharmony_ci * 76794c9f46Sopenharmony_ci * A 64-bit integer with bits set for each channel. 77794c9f46Sopenharmony_ci * 78794c9f46Sopenharmony_ci * @since 1.0 79794c9f46Sopenharmony_ci * @version 1.0 80794c9f46Sopenharmony_ci */ 81794c9f46Sopenharmony_cienum AudioChannelMasks : uint64_t { 82794c9f46Sopenharmony_ci FRONT_LEFT = 1ULL << 0U, 83794c9f46Sopenharmony_ci FRONT_RIGHT = 1ULL << 1U, 84794c9f46Sopenharmony_ci FRONT_CENTER = 1ULL << 2U, 85794c9f46Sopenharmony_ci LOW_FREQUENCY = 1ULL << 3U, 86794c9f46Sopenharmony_ci BACK_LEFT = 1ULL << 4U, 87794c9f46Sopenharmony_ci BACK_RIGHT = 1ULL << 5U, 88794c9f46Sopenharmony_ci FRONT_LEFT_OF_CENTER = 1ULL << 6U, 89794c9f46Sopenharmony_ci FRONT_RIGHT_OF_CENTER = 1ULL << 7U, 90794c9f46Sopenharmony_ci BACK_CENTER = 1ULL << 8U, 91794c9f46Sopenharmony_ci SIDE_LEFT = 1ULL << 9U, 92794c9f46Sopenharmony_ci SIDE_RIGHT = 1ULL << 10U, 93794c9f46Sopenharmony_ci TOP_CENTER = 1ULL << 11U, 94794c9f46Sopenharmony_ci TOP_FRONT_LEFT = 1ULL << 12U, 95794c9f46Sopenharmony_ci TOP_FRONT_CENTER = 1ULL << 13U, 96794c9f46Sopenharmony_ci TOP_FRONT_RIGHT = 1ULL << 14U, 97794c9f46Sopenharmony_ci TOP_BACK_LEFT = 1ULL << 15U, 98794c9f46Sopenharmony_ci TOP_BACK_CENTER = 1ULL << 16U, 99794c9f46Sopenharmony_ci TOP_BACK_RIGHT = 1ULL << 17U, 100794c9f46Sopenharmony_ci STEREO_LEFT = 1ULL << 29U, 101794c9f46Sopenharmony_ci STEREO_RIGHT = 1ULL << 30U, 102794c9f46Sopenharmony_ci WIDE_LEFT = 1ULL << 31U, 103794c9f46Sopenharmony_ci WIDE_RIGHT = 1ULL << 32U, 104794c9f46Sopenharmony_ci SURROUND_DIRECT_LEFT = 1ULL << 33U, 105794c9f46Sopenharmony_ci SURROUND_DIRECT_RIGHT = 1ULL << 34U, 106794c9f46Sopenharmony_ci LOW_FREQUENCY_2 = 1ULL << 35U, 107794c9f46Sopenharmony_ci TOP_SIDE_LEFT = 1ULL << 36U, 108794c9f46Sopenharmony_ci TOP_SIDE_RIGHT = 1ULL << 37U, 109794c9f46Sopenharmony_ci BOTTOM_FRONT_CENTER = 1ULL << 38U, 110794c9f46Sopenharmony_ci BOTTOM_FRONT_LEFT = 1ULL << 39U, 111794c9f46Sopenharmony_ci BOTTOM_FRONT_RIGHT = 1ULL << 40U, 112794c9f46Sopenharmony_ci}; 113794c9f46Sopenharmony_ci 114794c9f46Sopenharmony_ci/** 115794c9f46Sopenharmony_ci * @enum Audio Channel Layout 116794c9f46Sopenharmony_ci * 117794c9f46Sopenharmony_ci * Indicates that the channel order in which the user requests decoder output 118794c9f46Sopenharmony_ci * is the native codec channel order. 119794c9f46Sopenharmony_ci * 120794c9f46Sopenharmony_ci * @since 1.0 121794c9f46Sopenharmony_ci * @version 1.0 122794c9f46Sopenharmony_ci */ 123794c9f46Sopenharmony_cienum struct AudioChannelLayout : uint64_t { 124794c9f46Sopenharmony_ci UNKNOWN = 0, 125794c9f46Sopenharmony_ci MONO = (AudioChannelMasks::FRONT_CENTER), 126794c9f46Sopenharmony_ci STEREO = (AudioChannelMasks::FRONT_LEFT | AudioChannelMasks::FRONT_RIGHT), 127794c9f46Sopenharmony_ci CH_2POINT1 = (STEREO | AudioChannelMasks::LOW_FREQUENCY), 128794c9f46Sopenharmony_ci CH_2_1 = (STEREO | AudioChannelMasks::BACK_CENTER), 129794c9f46Sopenharmony_ci SURROUND = (STEREO | AudioChannelMasks::FRONT_CENTER), 130794c9f46Sopenharmony_ci CH_3POINT1 = (SURROUND | AudioChannelMasks::LOW_FREQUENCY), 131794c9f46Sopenharmony_ci CH_4POINT0 = (SURROUND | AudioChannelMasks::BACK_CENTER), 132794c9f46Sopenharmony_ci CH_4POINT1 = (CH_4POINT0 | AudioChannelMasks::LOW_FREQUENCY), 133794c9f46Sopenharmony_ci CH_2_2 = (STEREO | AudioChannelMasks::SIDE_LEFT | AudioChannelMasks::SIDE_RIGHT), 134794c9f46Sopenharmony_ci QUAD = (STEREO | AudioChannelMasks::BACK_LEFT | AudioChannelMasks::BACK_RIGHT), 135794c9f46Sopenharmony_ci CH_5POINT0 = (SURROUND | AudioChannelMasks::SIDE_LEFT | AudioChannelMasks::SIDE_RIGHT), 136794c9f46Sopenharmony_ci CH_5POINT1 = (CH_5POINT0 | AudioChannelMasks::LOW_FREQUENCY), 137794c9f46Sopenharmony_ci CH_5POINT0_BACK = (SURROUND | AudioChannelMasks::BACK_LEFT | AudioChannelMasks::BACK_RIGHT), 138794c9f46Sopenharmony_ci CH_5POINT1_BACK = (CH_5POINT0_BACK | AudioChannelMasks::LOW_FREQUENCY), 139794c9f46Sopenharmony_ci CH_6POINT0 = (CH_5POINT0 | AudioChannelMasks::BACK_CENTER), 140794c9f46Sopenharmony_ci CH_6POINT0_FRONT = (CH_2_2 | AudioChannelMasks::FRONT_LEFT_OF_CENTER | 141794c9f46Sopenharmony_ci AudioChannelMasks::FRONT_RIGHT_OF_CENTER), 142794c9f46Sopenharmony_ci HEXAGONAL = (CH_5POINT0_BACK | AudioChannelMasks::BACK_CENTER), 143794c9f46Sopenharmony_ci CH_6POINT1 = (CH_5POINT1 | AudioChannelMasks::BACK_CENTER), 144794c9f46Sopenharmony_ci CH_6POINT1_BACK = (CH_5POINT1_BACK | AudioChannelMasks::BACK_CENTER), 145794c9f46Sopenharmony_ci CH_6POINT1_FRONT = (CH_6POINT0_FRONT | AudioChannelMasks::LOW_FREQUENCY), 146794c9f46Sopenharmony_ci CH_7POINT0 = (CH_5POINT0 | AudioChannelMasks::BACK_LEFT | AudioChannelMasks::BACK_RIGHT), 147794c9f46Sopenharmony_ci CH_7POINT0_FRONT = (CH_5POINT0 | AudioChannelMasks::FRONT_LEFT_OF_CENTER | 148794c9f46Sopenharmony_ci AudioChannelMasks::FRONT_RIGHT_OF_CENTER), 149794c9f46Sopenharmony_ci CH_7POINT1 = (CH_5POINT1 | AudioChannelMasks::BACK_LEFT | AudioChannelMasks::BACK_RIGHT), 150794c9f46Sopenharmony_ci CH_7POINT1_WIDE = (CH_5POINT1 | AudioChannelMasks::FRONT_LEFT_OF_CENTER | 151794c9f46Sopenharmony_ci AudioChannelMasks::FRONT_RIGHT_OF_CENTER), 152794c9f46Sopenharmony_ci CH_7POINT1WIDE_BACK = (CH_5POINT1_BACK | AudioChannelMasks::FRONT_LEFT_OF_CENTER | 153794c9f46Sopenharmony_ci AudioChannelMasks::FRONT_RIGHT_OF_CENTER), 154794c9f46Sopenharmony_ci CH_3POINT1POINT2 = (CH_3POINT1 | AudioChannelMasks::TOP_FRONT_LEFT | AudioChannelMasks::TOP_FRONT_RIGHT), 155794c9f46Sopenharmony_ci CH_5POINT1POINT2 = (CH_5POINT1 | AudioChannelMasks::TOP_SIDE_LEFT | AudioChannelMasks::TOP_SIDE_RIGHT), 156794c9f46Sopenharmony_ci CH_5POINT1POINT4 = (CH_5POINT1 | AudioChannelMasks::TOP_FRONT_LEFT | AudioChannelMasks::TOP_FRONT_RIGHT | 157794c9f46Sopenharmony_ci AudioChannelMasks::TOP_BACK_LEFT | AudioChannelMasks::TOP_BACK_RIGHT), 158794c9f46Sopenharmony_ci CH_7POINT1POINT2 = (CH_7POINT1 | AudioChannelMasks::TOP_SIDE_LEFT | AudioChannelMasks::TOP_SIDE_RIGHT), 159794c9f46Sopenharmony_ci CH_7POINT1POINT4 = (CH_7POINT1 | AudioChannelMasks::TOP_FRONT_LEFT | AudioChannelMasks::TOP_FRONT_RIGHT | 160794c9f46Sopenharmony_ci AudioChannelMasks::TOP_BACK_LEFT | AudioChannelMasks::TOP_BACK_RIGHT), 161794c9f46Sopenharmony_ci CH_9POINT1POINT4 = (CH_7POINT1POINT4 | AudioChannelMasks::WIDE_LEFT | 162794c9f46Sopenharmony_ci AudioChannelMasks::WIDE_RIGHT), 163794c9f46Sopenharmony_ci CH_9POINT1POINT6 = (CH_9POINT1POINT4 | AudioChannelMasks::TOP_SIDE_LEFT | AudioChannelMasks::TOP_SIDE_RIGHT), 164794c9f46Sopenharmony_ci CH_10POINT2 = (AudioChannelMasks::FRONT_LEFT | AudioChannelMasks::FRONT_RIGHT | 165794c9f46Sopenharmony_ci AudioChannelMasks::FRONT_CENTER | AudioChannelMasks::TOP_FRONT_LEFT | 166794c9f46Sopenharmony_ci AudioChannelMasks::TOP_FRONT_RIGHT | AudioChannelMasks::BACK_LEFT | 167794c9f46Sopenharmony_ci AudioChannelMasks::BACK_RIGHT | AudioChannelMasks::BACK_CENTER | 168794c9f46Sopenharmony_ci AudioChannelMasks::SIDE_LEFT | AudioChannelMasks::SIDE_RIGHT | 169794c9f46Sopenharmony_ci AudioChannelMasks::WIDE_LEFT | AudioChannelMasks::WIDE_RIGHT), 170794c9f46Sopenharmony_ci CH_22POINT2 = (CH_7POINT1POINT4 | AudioChannelMasks::FRONT_LEFT_OF_CENTER | 171794c9f46Sopenharmony_ci AudioChannelMasks::FRONT_RIGHT_OF_CENTER | AudioChannelMasks::BACK_CENTER | 172794c9f46Sopenharmony_ci AudioChannelMasks::TOP_CENTER | AudioChannelMasks::TOP_FRONT_CENTER | 173794c9f46Sopenharmony_ci AudioChannelMasks::TOP_BACK_CENTER | AudioChannelMasks::TOP_SIDE_LEFT | 174794c9f46Sopenharmony_ci AudioChannelMasks::TOP_SIDE_RIGHT | AudioChannelMasks::BOTTOM_FRONT_LEFT | 175794c9f46Sopenharmony_ci AudioChannelMasks::BOTTOM_FRONT_RIGHT | AudioChannelMasks::BOTTOM_FRONT_CENTER | 176794c9f46Sopenharmony_ci AudioChannelMasks::LOW_FREQUENCY_2), 177794c9f46Sopenharmony_ci OCTAGONAL = (CH_5POINT0 | AudioChannelMasks::BACK_LEFT | AudioChannelMasks::BACK_CENTER | 178794c9f46Sopenharmony_ci AudioChannelMasks::BACK_RIGHT), 179794c9f46Sopenharmony_ci HEXADECAGONAL = (OCTAGONAL | AudioChannelMasks::WIDE_LEFT | AudioChannelMasks::WIDE_RIGHT | 180794c9f46Sopenharmony_ci AudioChannelMasks::TOP_BACK_LEFT | AudioChannelMasks::TOP_BACK_RIGHT | 181794c9f46Sopenharmony_ci AudioChannelMasks::TOP_BACK_CENTER | AudioChannelMasks::TOP_FRONT_CENTER | 182794c9f46Sopenharmony_ci AudioChannelMasks::TOP_FRONT_LEFT | AudioChannelMasks::TOP_FRONT_RIGHT), 183794c9f46Sopenharmony_ci STEREO_DOWNMIX = (AudioChannelMasks::STEREO_LEFT | AudioChannelMasks::STEREO_RIGHT), 184794c9f46Sopenharmony_ci}; 185794c9f46Sopenharmony_ci 186794c9f46Sopenharmony_ci/** 187794c9f46Sopenharmony_ci * @enum Audio sample formats 188794c9f46Sopenharmony_ci * 189794c9f46Sopenharmony_ci * 'S' is signed, 'U' is unsigned, and 'F' is a floating-point number. 190794c9f46Sopenharmony_ci * 'P' is planes, default is interleaved. 191794c9f46Sopenharmony_ci * 192794c9f46Sopenharmony_ci * @since 1.0 193794c9f46Sopenharmony_ci * @version 1.0 194794c9f46Sopenharmony_ci */ 195794c9f46Sopenharmony_cienum struct AudioSampleFormat : uint8_t { 196794c9f46Sopenharmony_ci NONE, 197794c9f46Sopenharmony_ci /* 8 bit */ 198794c9f46Sopenharmony_ci S8, U8, S8P, U8P, 199794c9f46Sopenharmony_ci /* 16 bit */ 200794c9f46Sopenharmony_ci S16, U16, S16P, U16P, 201794c9f46Sopenharmony_ci /* 24 bit */ 202794c9f46Sopenharmony_ci S24, U24, S24P, U24P, 203794c9f46Sopenharmony_ci /* 32 bit */ 204794c9f46Sopenharmony_ci S32, U32, S32P, U32P, 205794c9f46Sopenharmony_ci /* 64 bit */ 206794c9f46Sopenharmony_ci S64, U64, S64P, U64P, 207794c9f46Sopenharmony_ci /* float double */ 208794c9f46Sopenharmony_ci F32, F32P, F64, F64P, 209794c9f46Sopenharmony_ci}; 210794c9f46Sopenharmony_ci 211794c9f46Sopenharmony_ci/** 212794c9f46Sopenharmony_ci * @enum Video Pixel Format. 213794c9f46Sopenharmony_ci * 214794c9f46Sopenharmony_ci * @since 1.0 215794c9f46Sopenharmony_ci * @version 1.0 216794c9f46Sopenharmony_ci */ 217794c9f46Sopenharmony_cienum struct VideoPixelFormat : uint32_t { 218794c9f46Sopenharmony_ci UNKNOWN, 219794c9f46Sopenharmony_ci YUV410P, ///< planar YUV 4:1:0, 1 Cr & Cb sample per 4x4 Y samples 220794c9f46Sopenharmony_ci YUV411P, ///< planar YUV 4:1:1, 1 Cr & Cb sample per 4x1 Y samples 221794c9f46Sopenharmony_ci YUV420P, ///< planar YUV 4:2:0, 1 Cr & Cb sample per 2x2 Y samples 222794c9f46Sopenharmony_ci NV12, ///< semi-planar YUV 4:2:0, UVUV... 223794c9f46Sopenharmony_ci NV21, ///< semi-planar YUV 4:2:0, VUVU... 224794c9f46Sopenharmony_ci YUYV422, ///< packed YUV 4:2:2, Y0 Cb Y1 Cr 225794c9f46Sopenharmony_ci YUV422P, ///< planar YUV 4:2:2, 1 Cr & Cb sample per 2x1 Y samples 226794c9f46Sopenharmony_ci YUV444P, ///< planar YUV 4:4:4, 1 Cr & Cb sample per 1x1 Y samples 227794c9f46Sopenharmony_ci RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... 228794c9f46Sopenharmony_ci ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... 229794c9f46Sopenharmony_ci ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... 230794c9f46Sopenharmony_ci BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... 231794c9f46Sopenharmony_ci RGB24, ///< packed RGB 8:8:8, RGBRGB... 232794c9f46Sopenharmony_ci BGR24, ///< packed RGB 8:8:8, BGRBGR... 233794c9f46Sopenharmony_ci PAL8, ///< 8 bit with AV_PIX_FMT_RGB32 palette 234794c9f46Sopenharmony_ci GRAY8, ///< Y 235794c9f46Sopenharmony_ci MONOWHITE, ///< Y, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb 236794c9f46Sopenharmony_ci MONOBLACK, ///< Y, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb 237794c9f46Sopenharmony_ci YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG) 238794c9f46Sopenharmony_ci YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG) 239794c9f46Sopenharmony_ci YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG) 240794c9f46Sopenharmony_ci}; 241794c9f46Sopenharmony_ci 242794c9f46Sopenharmony_ci/** 243794c9f46Sopenharmony_ci * @enum Video Bit Stream format. 244794c9f46Sopenharmony_ci * 245794c9f46Sopenharmony_ci * @since 1.0 246794c9f46Sopenharmony_ci * @version 1.0 247794c9f46Sopenharmony_ci */ 248794c9f46Sopenharmony_cienum struct VideoBitStreamFormat : uint32_t { 249794c9f46Sopenharmony_ci UNKNOWN, 250794c9f46Sopenharmony_ci AVC1, // H264 bit stream format 251794c9f46Sopenharmony_ci HEVC, // H265 bit stream format 252794c9f46Sopenharmony_ci ANNEXB, // H264, H265 bit stream format 253794c9f46Sopenharmony_ci}; 254794c9f46Sopenharmony_ci 255794c9f46Sopenharmony_cistatic const std::string AUDIO_ENCODERS = "audioEncoders"; 256794c9f46Sopenharmony_cistatic const std::string AUDIO_DECODERS = "audioDecoders"; 257794c9f46Sopenharmony_cistatic const std::string VIDEO_ENCODERS = "videoEncoders"; 258794c9f46Sopenharmony_cistatic const std::string VIDEO_DECODERS = "videoDecoders"; 259794c9f46Sopenharmony_ci 260794c9f46Sopenharmony_ci/******************* AudioEncoder Begin *****************/ 261794c9f46Sopenharmony_cistruct AudioEncoderIn { 262794c9f46Sopenharmony_ci std::string mime; 263794c9f46Sopenharmony_ci std::vector<uint32_t> sample_rate; 264794c9f46Sopenharmony_ci}; 265794c9f46Sopenharmony_ci 266794c9f46Sopenharmony_cistruct AudioEncoderOut { 267794c9f46Sopenharmony_ci std::string mime; 268794c9f46Sopenharmony_ci uint32_t ad_mpeg_ver; 269794c9f46Sopenharmony_ci AudioAacProfile aac_profile; 270794c9f46Sopenharmony_ci AudioAacStreamFormat aac_stm_fmt; 271794c9f46Sopenharmony_ci}; 272794c9f46Sopenharmony_ci 273794c9f46Sopenharmony_cistruct AudioEncoder { 274794c9f46Sopenharmony_ci std::string name; 275794c9f46Sopenharmony_ci std::vector<AudioEncoderIn> ins; 276794c9f46Sopenharmony_ci std::vector<AudioEncoderOut> outs; 277794c9f46Sopenharmony_ci}; 278794c9f46Sopenharmony_ci 279794c9f46Sopenharmony_civoid FromJson(const cJSON *jsonObject, AudioEncoderIn &audioEncoderIn); 280794c9f46Sopenharmony_civoid FromJson(const cJSON *jsonObject, AudioEncoderOut &audioEncoderOut); 281794c9f46Sopenharmony_civoid FromJson(const cJSON *jsonObject, AudioEncoder &audioEncoder); 282794c9f46Sopenharmony_ci/******************* AudioEncoder End *******************/ 283794c9f46Sopenharmony_ci 284794c9f46Sopenharmony_ci/******************* AudioDecoder Begin *****************/ 285794c9f46Sopenharmony_cistruct AudioDecoderIn { 286794c9f46Sopenharmony_ci std::string mime; 287794c9f46Sopenharmony_ci std::vector<AudioChannelLayout> channel_layout; 288794c9f46Sopenharmony_ci}; 289794c9f46Sopenharmony_ci 290794c9f46Sopenharmony_cistruct AudioDecoderOut { 291794c9f46Sopenharmony_ci std::string mime; 292794c9f46Sopenharmony_ci std::vector<AudioSampleFormat> sample_fmt; 293794c9f46Sopenharmony_ci}; 294794c9f46Sopenharmony_ci 295794c9f46Sopenharmony_cistruct AudioDecoder { 296794c9f46Sopenharmony_ci std::string name; 297794c9f46Sopenharmony_ci std::vector<AudioDecoderIn> ins; 298794c9f46Sopenharmony_ci std::vector<AudioDecoderOut> outs; 299794c9f46Sopenharmony_ci}; 300794c9f46Sopenharmony_ci 301794c9f46Sopenharmony_civoid FromJson(const cJSON *jsonObject, AudioDecoderIn &audioDecoderIn); 302794c9f46Sopenharmony_civoid FromJson(const cJSON *jsonObject, AudioDecoderOut &audioDecoderOut); 303794c9f46Sopenharmony_civoid FromJson(const cJSON *jsonObject, AudioDecoder &audioDecoder); 304794c9f46Sopenharmony_ci/******************* AudioDecoder End *******************/ 305794c9f46Sopenharmony_ci 306794c9f46Sopenharmony_ci/******************* VideoEncoder Begin *****************/ 307794c9f46Sopenharmony_cistruct VideoEncoderIn { 308794c9f46Sopenharmony_ci std::string mime; 309794c9f46Sopenharmony_ci std::vector<VideoPixelFormat> pixel_fmt; 310794c9f46Sopenharmony_ci}; 311794c9f46Sopenharmony_ci 312794c9f46Sopenharmony_cistruct VideoEncoderOut { 313794c9f46Sopenharmony_ci std::string mime; 314794c9f46Sopenharmony_ci}; 315794c9f46Sopenharmony_ci 316794c9f46Sopenharmony_cistruct VideoEncoder { 317794c9f46Sopenharmony_ci std::string name; 318794c9f46Sopenharmony_ci std::vector<VideoEncoderIn> ins; 319794c9f46Sopenharmony_ci std::vector<VideoEncoderOut> outs; 320794c9f46Sopenharmony_ci}; 321794c9f46Sopenharmony_ci 322794c9f46Sopenharmony_civoid FromJson(const cJSON *jsonObject, VideoEncoderIn &videoEncoderIn); 323794c9f46Sopenharmony_civoid FromJson(const cJSON *jsonObject, VideoEncoderOut &videoEncoderOut); 324794c9f46Sopenharmony_civoid FromJson(const cJSON *jsonObject, VideoEncoder &videoEncoder); 325794c9f46Sopenharmony_ci/******************* VideoEncoder End *******************/ 326794c9f46Sopenharmony_ci 327794c9f46Sopenharmony_ci/******************* VideoDecoder Begin *****************/ 328794c9f46Sopenharmony_cistruct VideoDecoderIn { 329794c9f46Sopenharmony_ci std::string mime; 330794c9f46Sopenharmony_ci std::vector<VideoBitStreamFormat> vd_bit_stream_fmt; 331794c9f46Sopenharmony_ci}; 332794c9f46Sopenharmony_ci 333794c9f46Sopenharmony_cistruct VideoDecoderOut { 334794c9f46Sopenharmony_ci std::string mime; 335794c9f46Sopenharmony_ci std::vector<VideoPixelFormat> pixel_fmt; 336794c9f46Sopenharmony_ci}; 337794c9f46Sopenharmony_ci 338794c9f46Sopenharmony_cistruct VideoDecoder { 339794c9f46Sopenharmony_ci std::string name; 340794c9f46Sopenharmony_ci std::vector<VideoDecoderIn> ins; 341794c9f46Sopenharmony_ci std::vector<VideoDecoderOut> outs; 342794c9f46Sopenharmony_ci}; 343794c9f46Sopenharmony_ci 344794c9f46Sopenharmony_civoid FromJson(const cJSON *jsonObject, VideoDecoderIn &videoDecoderIn); 345794c9f46Sopenharmony_civoid FromJson(const cJSON *jsonObject, VideoDecoderOut &videoDecoderOut); 346794c9f46Sopenharmony_civoid FromJson(const cJSON *jsonObject, VideoDecoder &videoDecoder); 347794c9f46Sopenharmony_ci/******************* VideoDecoder End *******************/ 348794c9f46Sopenharmony_citemplate<typename T> 349794c9f46Sopenharmony_ciAPI_EXPORT void FromJson(const std::string &key, const cJSON *jsonObject, std::vector<T> &objs); 350794c9f46Sopenharmony_ci} 351794c9f46Sopenharmony_ci} 352794c9f46Sopenharmony_ci#endif