1 /* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 //#define LOG_NDEBUG 0 18 #define LOG_TAG "C2Config" 19 #include <utils/Log.h> 20 21 /** 22 * Define and initialize global config field descriptors in this cpp file 23 */ 24 #define __C2_GENERATE_GLOBAL_VARS__ 25 #include <C2Config.h> 26 27 DEFINE_C2_ENUM_VALUE_CUSTOM_HELPER(C2Config::profile_t, ({ 28 { "unused", C2Config::PROFILE_UNUSED }, 29 { "aac-lc", C2Config::PROFILE_AAC_LC }, 30 { "aac-main", C2Config::PROFILE_AAC_MAIN }, 31 { "aac-ssr", C2Config::PROFILE_AAC_SSR }, 32 { "aac-ltp", C2Config::PROFILE_AAC_LTP }, 33 { "aac-he", C2Config::PROFILE_AAC_HE }, 34 { "aac-scalable", C2Config::PROFILE_AAC_SCALABLE }, 35 { "aac-er-lc", C2Config::PROFILE_AAC_ER_LC }, 36 { "aac-er-scalable", C2Config::PROFILE_AAC_ER_SCALABLE }, 37 { "aac-ld", C2Config::PROFILE_AAC_LD }, 38 { "aac-he-ps", C2Config::PROFILE_AAC_HE_PS }, 39 { "aac-eld", C2Config::PROFILE_AAC_ELD }, 40 { "aac-xhe", C2Config::PROFILE_AAC_XHE }, 41 { "mp2v-simple", C2Config::PROFILE_MP2V_SIMPLE }, 42 { "mp2v-main", C2Config::PROFILE_MP2V_MAIN }, 43 { "mp2v-snr-scalable", C2Config::PROFILE_MP2V_SNR_SCALABLE }, 44 { "mp2v-spatially-scalable", C2Config::PROFILE_MP2V_SPATIALLY_SCALABLE }, 45 { "mp2v-high", C2Config::PROFILE_MP2V_HIGH }, 46 { "mp2v-422", C2Config::PROFILE_MP2V_422 }, 47 { "mp2v-multiview", C2Config::PROFILE_MP2V_MULTIVIEW }, 48 { "h263-baseline", C2Config::PROFILE_H263_BASELINE }, 49 { "h263-h320", C2Config::PROFILE_H263_H320 }, 50 { "h263-v1bc", C2Config::PROFILE_H263_V1BC }, 51 { "h263-iswv2", C2Config::PROFILE_H263_ISWV2 }, 52 { "h263-iswv3", C2Config::PROFILE_H263_ISWV3 }, 53 { "h263-high-compression", C2Config::PROFILE_H263_HIGH_COMPRESSION }, 54 { "h263-internet", C2Config::PROFILE_H263_INTERNET }, 55 { "h263-interlace", C2Config::PROFILE_H263_INTERLACE }, 56 { "h263-high-latency", C2Config::PROFILE_H263_HIGH_LATENCY }, 57 { "mp4v-simple", C2Config::PROFILE_MP4V_SIMPLE }, 58 { "mp4v-simple-scalable", C2Config::PROFILE_MP4V_SIMPLE_SCALABLE }, 59 { "mp4v-core", C2Config::PROFILE_MP4V_CORE }, 60 { "mp4v-main", C2Config::PROFILE_MP4V_MAIN }, 61 { "mp4v-nbit", C2Config::PROFILE_MP4V_NBIT }, 62 { "mp4v-arts", C2Config::PROFILE_MP4V_ARTS }, 63 { "mp4v-core-scalable", C2Config::PROFILE_MP4V_CORE_SCALABLE }, 64 { "mp4v-ace", C2Config::PROFILE_MP4V_ACE }, 65 { "mp4v-advanced-core", C2Config::PROFILE_MP4V_ADVANCED_CORE }, 66 { "mp4v-simple-studio", C2Config::PROFILE_MP4V_SIMPLE_STUDIO }, 67 { "mp4v-core-studio", C2Config::PROFILE_MP4V_CORE_STUDIO }, 68 { "mp4v-advanced-simple", C2Config::PROFILE_MP4V_ADVANCED_SIMPLE }, 69 { "mp4v-fgs", C2Config::PROFILE_MP4V_FGS }, 70 { "avc-baseline", C2Config::PROFILE_AVC_BASELINE }, 71 { "avc-constrained-baseline", C2Config::PROFILE_AVC_CONSTRAINED_BASELINE }, 72 { "avc-main", C2Config::PROFILE_AVC_MAIN }, 73 { "avc-extended", C2Config::PROFILE_AVC_EXTENDED }, 74 { "avc-high", C2Config::PROFILE_AVC_HIGH }, 75 { "avc-progressive-high", C2Config::PROFILE_AVC_PROGRESSIVE_HIGH }, 76 { "avc-constrained-high", C2Config::PROFILE_AVC_CONSTRAINED_HIGH }, 77 { "avc-high-10", C2Config::PROFILE_AVC_HIGH_10 }, 78 { "avc-progressive-high-10", C2Config::PROFILE_AVC_PROGRESSIVE_HIGH_10 }, 79 { "avc-high-422", C2Config::PROFILE_AVC_HIGH_422 }, 80 { "avc-high-444-predictive", C2Config::PROFILE_AVC_HIGH_444_PREDICTIVE }, 81 { "avc-high-10-intra", C2Config::PROFILE_AVC_HIGH_10_INTRA }, 82 { "avc-high-422-intra", C2Config::PROFILE_AVC_HIGH_422_INTRA }, 83 { "avc-high-444-intra", C2Config::PROFILE_AVC_HIGH_444_INTRA }, 84 { "avc-cavlc-444-intra", C2Config::PROFILE_AVC_CAVLC_444_INTRA }, 85 { "avc-scalable-baseline", C2Config::PROFILE_AVC_SCALABLE_BASELINE }, 86 { "avc-scalable-constrained-baseline", C2Config::PROFILE_AVC_SCALABLE_CONSTRAINED_BASELINE }, 87 { "avc-scalable-high", C2Config::PROFILE_AVC_SCALABLE_HIGH }, 88 { "avc-scalable-constrained-high", C2Config::PROFILE_AVC_SCALABLE_CONSTRAINED_HIGH }, 89 { "avc-scalable-high-intra", C2Config::PROFILE_AVC_SCALABLE_HIGH_INTRA }, 90 { "avc-multiview-high", C2Config::PROFILE_AVC_MULTIVIEW_HIGH }, 91 { "avc-stereo-high", C2Config::PROFILE_AVC_STEREO_HIGH }, 92 { "avc-mfc-high", C2Config::PROFILE_AVC_MFC_HIGH }, 93 { "avc-multiview-depth-high", C2Config::PROFILE_AVC_MULTIVIEW_DEPTH_HIGH }, 94 { "avc-mfc-depth-high", C2Config::PROFILE_AVC_MFC_DEPTH_HIGH }, 95 { "avc-enhanced-multiview-depth-high", C2Config::PROFILE_AVC_ENHANCED_MULTIVIEW_DEPTH_HIGH }, 96 { "hevc-main", C2Config::PROFILE_HEVC_MAIN }, 97 { "hevc-main-10", C2Config::PROFILE_HEVC_MAIN_10 }, 98 { "hevc-main-still", C2Config::PROFILE_HEVC_MAIN_STILL }, 99 { "hevc-mono", C2Config::PROFILE_HEVC_MONO }, 100 { "hevc-mono-12", C2Config::PROFILE_HEVC_MONO_12 }, 101 { "hevc-mono-16", C2Config::PROFILE_HEVC_MONO_16 }, 102 { "hevc-main-12", C2Config::PROFILE_HEVC_MAIN_12 }, 103 { "hevc-main-422-10", C2Config::PROFILE_HEVC_MAIN_422_10 }, 104 { "hevc-main-422-12", C2Config::PROFILE_HEVC_MAIN_422_12 }, 105 { "hevc-main-444", C2Config::PROFILE_HEVC_MAIN_444 }, 106 { "hevc-main-444-10", C2Config::PROFILE_HEVC_MAIN_444_10 }, 107 { "hevc-main-444-12", C2Config::PROFILE_HEVC_MAIN_444_12 }, 108 { "hevc-main-intra", C2Config::PROFILE_HEVC_MAIN_INTRA }, 109 { "hevc-main-10-intra", C2Config::PROFILE_HEVC_MAIN_10_INTRA }, 110 { "hevc-main-12-intra", C2Config::PROFILE_HEVC_MAIN_12_INTRA }, 111 { "hevc-main-422-10-intra", C2Config::PROFILE_HEVC_MAIN_422_10_INTRA }, 112 { "hevc-main-422-12-intra", C2Config::PROFILE_HEVC_MAIN_422_12_INTRA }, 113 { "hevc-main-444-intra", C2Config::PROFILE_HEVC_MAIN_444_INTRA }, 114 { "hevc-main-444-10-intra", C2Config::PROFILE_HEVC_MAIN_444_10_INTRA }, 115 { "hevc-main-444-12-intra", C2Config::PROFILE_HEVC_MAIN_444_12_INTRA }, 116 { "hevc-main-444-16-intra", C2Config::PROFILE_HEVC_MAIN_444_16_INTRA }, 117 { "hevc-main-444-still", C2Config::PROFILE_HEVC_MAIN_444_STILL }, 118 { "hevc-main-444-16-still", C2Config::PROFILE_HEVC_MAIN_444_16_STILL }, 119 { "hevc-high-444", C2Config::PROFILE_HEVC_HIGH_444 }, 120 { "hevc-high-444-10", C2Config::PROFILE_HEVC_HIGH_444_10 }, 121 { "hevc-high-444-14", C2Config::PROFILE_HEVC_HIGH_444_14 }, 122 { "hevc-high-444-16-intra", C2Config::PROFILE_HEVC_HIGH_444_16_INTRA }, 123 { "hevc-sx-main", C2Config::PROFILE_HEVC_SX_MAIN }, 124 { "hevc-sx-main-10", C2Config::PROFILE_HEVC_SX_MAIN_10 }, 125 { "hevc-sx-main-444", C2Config::PROFILE_HEVC_SX_MAIN_444 }, 126 { "hevc-sx-main-444-10", C2Config::PROFILE_HEVC_SX_MAIN_444_10 }, 127 { "hevc-sx-high-444", C2Config::PROFILE_HEVC_SX_HIGH_444 }, 128 { "hevc-sx-high-444-10", C2Config::PROFILE_HEVC_SX_HIGH_444_10 }, 129 { "hevc-sx-high-444-14", C2Config::PROFILE_HEVC_SX_HIGH_444_14 }, 130 { "hevc-multiview-main", C2Config::PROFILE_HEVC_MULTIVIEW_MAIN }, 131 { "hevc-scalable-main", C2Config::PROFILE_HEVC_SCALABLE_MAIN }, 132 { "hevc-scalable-main-10", C2Config::PROFILE_HEVC_SCALABLE_MAIN_10 }, 133 { "hevc-scalable-mono", C2Config::PROFILE_HEVC_SCALABLE_MONO }, 134 { "hevc-scalable-mono-12", C2Config::PROFILE_HEVC_SCALABLE_MONO_12 }, 135 { "hevc-scalable-mono-16", C2Config::PROFILE_HEVC_SCALABLE_MONO_16 }, 136 { "hevc-scalable-main-444", C2Config::PROFILE_HEVC_SCALABLE_MAIN_444 }, 137 { "hevc-3d-main", C2Config::PROFILE_HEVC_3D_MAIN }, 138 { "vp9-0", C2Config::PROFILE_VP9_0 }, 139 { "vp9-1", C2Config::PROFILE_VP9_1 }, 140 { "vp9-2", C2Config::PROFILE_VP9_2 }, 141 { "vp9-3", C2Config::PROFILE_VP9_3 }, 142 })) 143 144 DEFINE_C2_ENUM_VALUE_CUSTOM_HELPER(C2Config::level_t, ({ 145 { "unused", C2Config::LEVEL_UNUSED }, 146 { "mp2v-low", C2Config::LEVEL_MP2V_LOW }, 147 { "mp2v-main", C2Config::LEVEL_MP2V_MAIN }, 148 { "mp2v-high-1440", C2Config::LEVEL_MP2V_HIGH_1440 }, 149 { "mp2v-high", C2Config::LEVEL_MP2V_HIGH }, 150 { "mp2v-highp", C2Config::LEVEL_MP2V_HIGHP }, 151 { "h263-10", C2Config::LEVEL_H263_10 }, 152 { "h263-20", C2Config::LEVEL_H263_20 }, 153 { "h263-30", C2Config::LEVEL_H263_30 }, 154 { "h263-40", C2Config::LEVEL_H263_40 }, 155 { "h263-45", C2Config::LEVEL_H263_45 }, 156 { "h263-50", C2Config::LEVEL_H263_50 }, 157 { "h263-60", C2Config::LEVEL_H263_60 }, 158 { "h263-70", C2Config::LEVEL_H263_70 }, 159 { "mp4v-0", C2Config::LEVEL_MP4V_0 }, 160 { "mp4v-0b", C2Config::LEVEL_MP4V_0B }, 161 { "mp4v-1", C2Config::LEVEL_MP4V_1 }, 162 { "mp4v-2", C2Config::LEVEL_MP4V_2 }, 163 { "mp4v-3", C2Config::LEVEL_MP4V_3 }, 164 { "mp4v-3b", C2Config::LEVEL_MP4V_3B }, 165 { "mp4v-4", C2Config::LEVEL_MP4V_4 }, 166 { "mp4v-4a", C2Config::LEVEL_MP4V_4A }, 167 { "mp4v-5", C2Config::LEVEL_MP4V_5 }, 168 { "mp4v-6", C2Config::LEVEL_MP4V_6 }, 169 { "avc-1", C2Config::LEVEL_AVC_1 }, 170 { "avc-1b", C2Config::LEVEL_AVC_1B }, 171 { "avc-1.1", C2Config::LEVEL_AVC_1_1 }, 172 { "avc-1.2", C2Config::LEVEL_AVC_1_2 }, 173 { "avc-1.3", C2Config::LEVEL_AVC_1_3 }, 174 { "avc-2", C2Config::LEVEL_AVC_2 }, 175 { "avc-2.1", C2Config::LEVEL_AVC_2_1 }, 176 { "avc-2.2", C2Config::LEVEL_AVC_2_2 }, 177 { "avc-3", C2Config::LEVEL_AVC_3 }, 178 { "avc-3.1", C2Config::LEVEL_AVC_3_1 }, 179 { "avc-3.2", C2Config::LEVEL_AVC_3_2 }, 180 { "avc-4", C2Config::LEVEL_AVC_4 }, 181 { "avc-4.1", C2Config::LEVEL_AVC_4_1 }, 182 { "avc-4.2", C2Config::LEVEL_AVC_4_2 }, 183 { "avc-5", C2Config::LEVEL_AVC_5 }, 184 { "avc-5.1", C2Config::LEVEL_AVC_5_1 }, 185 { "avc-5.2", C2Config::LEVEL_AVC_5_2 }, 186 { "hevc-main-1", C2Config::LEVEL_HEVC_MAIN_1 }, 187 { "hevc-main-2", C2Config::LEVEL_HEVC_MAIN_2 }, 188 { "hevc-main-2.1", C2Config::LEVEL_HEVC_MAIN_2_1 }, 189 { "hevc-main-3", C2Config::LEVEL_HEVC_MAIN_3 }, 190 { "hevc-main-3.1", C2Config::LEVEL_HEVC_MAIN_3_1 }, 191 { "hevc-main-4", C2Config::LEVEL_HEVC_MAIN_4 }, 192 { "hevc-main-4.1", C2Config::LEVEL_HEVC_MAIN_4_1 }, 193 { "hevc-main-5", C2Config::LEVEL_HEVC_MAIN_5 }, 194 { "hevc-main-5.1", C2Config::LEVEL_HEVC_MAIN_5_1 }, 195 { "hevc-main-5.2", C2Config::LEVEL_HEVC_MAIN_5_2 }, 196 { "hevc-main-6", C2Config::LEVEL_HEVC_MAIN_6 }, 197 { "hevc-main-6.1", C2Config::LEVEL_HEVC_MAIN_6_1 }, 198 { "hevc-main-6.2", C2Config::LEVEL_HEVC_MAIN_6_2 }, 199 { "hevc-high-4", C2Config::LEVEL_HEVC_HIGH_4 }, 200 { "hevc-high-4.1", C2Config::LEVEL_HEVC_HIGH_4_1 }, 201 { "hevc-high-5", C2Config::LEVEL_HEVC_HIGH_5 }, 202 { "hevc-high-5.1", C2Config::LEVEL_HEVC_HIGH_5_1 }, 203 { "hevc-high-5.2", C2Config::LEVEL_HEVC_HIGH_5_2 }, 204 { "hevc-high-6", C2Config::LEVEL_HEVC_HIGH_6 }, 205 { "hevc-high-6.1", C2Config::LEVEL_HEVC_HIGH_6_1 }, 206 { "hevc-high-6.2", C2Config::LEVEL_HEVC_HIGH_6_2 }, 207 { "vp9-1", C2Config::LEVEL_VP9_1 }, 208 { "vp9-1.1", C2Config::LEVEL_VP9_1_1 }, 209 { "vp9-2", C2Config::LEVEL_VP9_2 }, 210 { "vp9-2.1", C2Config::LEVEL_VP9_2_1 }, 211 { "vp9-3", C2Config::LEVEL_VP9_3 }, 212 { "vp9-3.1", C2Config::LEVEL_VP9_3_1 }, 213 { "vp9-4", C2Config::LEVEL_VP9_4 }, 214 { "vp9-4.1", C2Config::LEVEL_VP9_4_1 }, 215 { "vp9-5", C2Config::LEVEL_VP9_5 }, 216 { "vp9-5.1", C2Config::LEVEL_VP9_5_1 }, 217 { "vp9-5.2", C2Config::LEVEL_VP9_5_2 }, 218 { "vp9-6", C2Config::LEVEL_VP9_6 }, 219 { "vp9-6.1", C2Config::LEVEL_VP9_6_1 }, 220 { "vp9-6.2", C2Config::LEVEL_VP9_6_2 }, 221 })) 222 223 DEFINE_C2_ENUM_VALUE_CUSTOM_HELPER(C2BufferData::type_t, ({ 224 { "invalid", C2BufferData::INVALID }, 225 { "linear", C2BufferData::LINEAR }, 226 { "linear-chunks", C2BufferData::LINEAR_CHUNKS }, 227 { "graphic", C2BufferData::GRAPHIC }, 228 { "graphic-chunks", C2BufferData::GRAPHIC_CHUNKS }, 229 })) 230 231 232