1 /* 2 * Copyright 2018 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 18 #ifndef MEDIA_CODEC_CONSTANTS_H_ 19 #define MEDIA_CODEC_CONSTANTS_H_ 20 21 namespace { 22 23 // from MediaCodecInfo.java 24 constexpr int32_t AVCProfileBaseline = 0x01; 25 constexpr int32_t AVCProfileMain = 0x02; 26 constexpr int32_t AVCProfileExtended = 0x04; 27 constexpr int32_t AVCProfileHigh = 0x08; 28 constexpr int32_t AVCProfileHigh10 = 0x10; 29 constexpr int32_t AVCProfileHigh422 = 0x20; 30 constexpr int32_t AVCProfileHigh444 = 0x40; 31 constexpr int32_t AVCProfileConstrainedBaseline = 0x10000; 32 constexpr int32_t AVCProfileConstrainedHigh = 0x80000; 33 34 constexpr int32_t AVCLevel1 = 0x01; 35 constexpr int32_t AVCLevel1b = 0x02; 36 constexpr int32_t AVCLevel11 = 0x04; 37 constexpr int32_t AVCLevel12 = 0x08; 38 constexpr int32_t AVCLevel13 = 0x10; 39 constexpr int32_t AVCLevel2 = 0x20; 40 constexpr int32_t AVCLevel21 = 0x40; 41 constexpr int32_t AVCLevel22 = 0x80; 42 constexpr int32_t AVCLevel3 = 0x100; 43 constexpr int32_t AVCLevel31 = 0x200; 44 constexpr int32_t AVCLevel32 = 0x400; 45 constexpr int32_t AVCLevel4 = 0x800; 46 constexpr int32_t AVCLevel41 = 0x1000; 47 constexpr int32_t AVCLevel42 = 0x2000; 48 constexpr int32_t AVCLevel5 = 0x4000; 49 constexpr int32_t AVCLevel51 = 0x8000; 50 constexpr int32_t AVCLevel52 = 0x10000; 51 52 constexpr int32_t H263ProfileBaseline = 0x01; 53 constexpr int32_t H263ProfileH320Coding = 0x02; 54 constexpr int32_t H263ProfileBackwardCompatible = 0x04; 55 constexpr int32_t H263ProfileISWV2 = 0x08; 56 constexpr int32_t H263ProfileISWV3 = 0x10; 57 constexpr int32_t H263ProfileHighCompression = 0x20; 58 constexpr int32_t H263ProfileInternet = 0x40; 59 constexpr int32_t H263ProfileInterlace = 0x80; 60 constexpr int32_t H263ProfileHighLatency = 0x100; 61 62 constexpr int32_t H263Level10 = 0x01; 63 constexpr int32_t H263Level20 = 0x02; 64 constexpr int32_t H263Level30 = 0x04; 65 constexpr int32_t H263Level40 = 0x08; 66 constexpr int32_t H263Level45 = 0x10; 67 constexpr int32_t H263Level50 = 0x20; 68 constexpr int32_t H263Level60 = 0x40; 69 constexpr int32_t H263Level70 = 0x80; 70 71 constexpr int32_t MPEG4ProfileSimple = 0x01; 72 constexpr int32_t MPEG4ProfileSimpleScalable = 0x02; 73 constexpr int32_t MPEG4ProfileCore = 0x04; 74 constexpr int32_t MPEG4ProfileMain = 0x08; 75 constexpr int32_t MPEG4ProfileNbit = 0x10; 76 constexpr int32_t MPEG4ProfileScalableTexture = 0x20; 77 constexpr int32_t MPEG4ProfileSimpleFace = 0x40; 78 constexpr int32_t MPEG4ProfileSimpleFBA = 0x80; 79 constexpr int32_t MPEG4ProfileBasicAnimated = 0x100; 80 constexpr int32_t MPEG4ProfileHybrid = 0x200; 81 constexpr int32_t MPEG4ProfileAdvancedRealTime = 0x400; 82 constexpr int32_t MPEG4ProfileCoreScalable = 0x800; 83 constexpr int32_t MPEG4ProfileAdvancedCoding = 0x1000; 84 constexpr int32_t MPEG4ProfileAdvancedCore = 0x2000; 85 constexpr int32_t MPEG4ProfileAdvancedScalable = 0x4000; 86 constexpr int32_t MPEG4ProfileAdvancedSimple = 0x8000; 87 88 constexpr int32_t MPEG4Level0 = 0x01; 89 constexpr int32_t MPEG4Level0b = 0x02; 90 constexpr int32_t MPEG4Level1 = 0x04; 91 constexpr int32_t MPEG4Level2 = 0x08; 92 constexpr int32_t MPEG4Level3 = 0x10; 93 constexpr int32_t MPEG4Level3b = 0x18; 94 constexpr int32_t MPEG4Level4 = 0x20; 95 constexpr int32_t MPEG4Level4a = 0x40; 96 constexpr int32_t MPEG4Level5 = 0x80; 97 constexpr int32_t MPEG4Level6 = 0x100; 98 99 constexpr int32_t MPEG2ProfileSimple = 0x00; 100 constexpr int32_t MPEG2ProfileMain = 0x01; 101 constexpr int32_t MPEG2Profile422 = 0x02; 102 constexpr int32_t MPEG2ProfileSNR = 0x03; 103 constexpr int32_t MPEG2ProfileSpatial = 0x04; 104 constexpr int32_t MPEG2ProfileHigh = 0x05; 105 106 constexpr int32_t MPEG2LevelLL = 0x00; 107 constexpr int32_t MPEG2LevelML = 0x01; 108 constexpr int32_t MPEG2LevelH14 = 0x02; 109 constexpr int32_t MPEG2LevelHL = 0x03; 110 constexpr int32_t MPEG2LevelHP = 0x04; 111 112 constexpr int32_t AACObjectMain = 1; 113 constexpr int32_t AACObjectLC = 2; 114 constexpr int32_t AACObjectSSR = 3; 115 constexpr int32_t AACObjectLTP = 4; 116 constexpr int32_t AACObjectHE = 5; 117 constexpr int32_t AACObjectScalable = 6; 118 constexpr int32_t AACObjectERLC = 17; 119 constexpr int32_t AACObjectERScalable = 20; 120 constexpr int32_t AACObjectLD = 23; 121 constexpr int32_t AACObjectHE_PS = 29; 122 constexpr int32_t AACObjectELD = 39; 123 constexpr int32_t AACObjectXHE = 42; 124 125 constexpr int32_t VP8Level_Version0 = 0x01; 126 constexpr int32_t VP8Level_Version1 = 0x02; 127 constexpr int32_t VP8Level_Version2 = 0x04; 128 constexpr int32_t VP8Level_Version3 = 0x08; 129 130 constexpr int32_t VP8ProfileMain = 0x01; 131 132 constexpr int32_t VP9Profile0 = 0x01; 133 constexpr int32_t VP9Profile1 = 0x02; 134 constexpr int32_t VP9Profile2 = 0x04; 135 constexpr int32_t VP9Profile3 = 0x08; 136 constexpr int32_t VP9Profile2HDR = 0x1000; 137 constexpr int32_t VP9Profile3HDR = 0x2000; 138 139 constexpr int32_t VP9Level1 = 0x1; 140 constexpr int32_t VP9Level11 = 0x2; 141 constexpr int32_t VP9Level2 = 0x4; 142 constexpr int32_t VP9Level21 = 0x8; 143 constexpr int32_t VP9Level3 = 0x10; 144 constexpr int32_t VP9Level31 = 0x20; 145 constexpr int32_t VP9Level4 = 0x40; 146 constexpr int32_t VP9Level41 = 0x80; 147 constexpr int32_t VP9Level5 = 0x100; 148 constexpr int32_t VP9Level51 = 0x200; 149 constexpr int32_t VP9Level52 = 0x400; 150 constexpr int32_t VP9Level6 = 0x800; 151 constexpr int32_t VP9Level61 = 0x1000; 152 constexpr int32_t VP9Level62 = 0x2000; 153 154 constexpr int32_t HEVCProfileMain = 0x01; 155 constexpr int32_t HEVCProfileMain10 = 0x02; 156 constexpr int32_t HEVCProfileMainStill = 0x04; 157 constexpr int32_t HEVCProfileMain10HDR10 = 0x1000; 158 159 constexpr int32_t HEVCMainTierLevel1 = 0x1; 160 constexpr int32_t HEVCHighTierLevel1 = 0x2; 161 constexpr int32_t HEVCMainTierLevel2 = 0x4; 162 constexpr int32_t HEVCHighTierLevel2 = 0x8; 163 constexpr int32_t HEVCMainTierLevel21 = 0x10; 164 constexpr int32_t HEVCHighTierLevel21 = 0x20; 165 constexpr int32_t HEVCMainTierLevel3 = 0x40; 166 constexpr int32_t HEVCHighTierLevel3 = 0x80; 167 constexpr int32_t HEVCMainTierLevel31 = 0x100; 168 constexpr int32_t HEVCHighTierLevel31 = 0x200; 169 constexpr int32_t HEVCMainTierLevel4 = 0x400; 170 constexpr int32_t HEVCHighTierLevel4 = 0x800; 171 constexpr int32_t HEVCMainTierLevel41 = 0x1000; 172 constexpr int32_t HEVCHighTierLevel41 = 0x2000; 173 constexpr int32_t HEVCMainTierLevel5 = 0x4000; 174 constexpr int32_t HEVCHighTierLevel5 = 0x8000; 175 constexpr int32_t HEVCMainTierLevel51 = 0x10000; 176 constexpr int32_t HEVCHighTierLevel51 = 0x20000; 177 constexpr int32_t HEVCMainTierLevel52 = 0x40000; 178 constexpr int32_t HEVCHighTierLevel52 = 0x80000; 179 constexpr int32_t HEVCMainTierLevel6 = 0x100000; 180 constexpr int32_t HEVCHighTierLevel6 = 0x200000; 181 constexpr int32_t HEVCMainTierLevel61 = 0x400000; 182 constexpr int32_t HEVCHighTierLevel61 = 0x800000; 183 constexpr int32_t HEVCMainTierLevel62 = 0x1000000; 184 constexpr int32_t HEVCHighTierLevel62 = 0x2000000; 185 186 constexpr int32_t DolbyVisionProfileDvavPer = 0x1; 187 constexpr int32_t DolbyVisionProfileDvavPen = 0x2; 188 constexpr int32_t DolbyVisionProfileDvheDer = 0x4; 189 constexpr int32_t DolbyVisionProfileDvheDen = 0x8; 190 constexpr int32_t DolbyVisionProfileDvheDtr = 0x10; 191 constexpr int32_t DolbyVisionProfileDvheStn = 0x20; 192 constexpr int32_t DolbyVisionProfileDvheDth = 0x40; 193 constexpr int32_t DolbyVisionProfileDvheDtb = 0x80; 194 constexpr int32_t DolbyVisionProfileDvheSt = 0x100; 195 constexpr int32_t DolbyVisionProfileDvavSe = 0x200; 196 197 constexpr int32_t DolbyVisionLevelHd24 = 0x1; 198 constexpr int32_t DolbyVisionLevelHd30 = 0x2; 199 constexpr int32_t DolbyVisionLevelFhd24 = 0x4; 200 constexpr int32_t DolbyVisionLevelFhd30 = 0x8; 201 constexpr int32_t DolbyVisionLevelFhd60 = 0x10; 202 constexpr int32_t DolbyVisionLevelUhd24 = 0x20; 203 constexpr int32_t DolbyVisionLevelUhd30 = 0x40; 204 constexpr int32_t DolbyVisionLevelUhd48 = 0x80; 205 constexpr int32_t DolbyVisionLevelUhd60 = 0x100; 206 207 constexpr int32_t BITRATE_MODE_CBR = 2; 208 constexpr int32_t BITRATE_MODE_CQ = 0; 209 constexpr int32_t BITRATE_MODE_VBR = 1; 210 211 constexpr int32_t COLOR_Format12bitRGB444 = 3; 212 constexpr int32_t COLOR_Format16bitARGB1555 = 5; 213 constexpr int32_t COLOR_Format16bitARGB4444 = 4; 214 constexpr int32_t COLOR_Format16bitBGR565 = 7; 215 constexpr int32_t COLOR_Format16bitRGB565 = 6; 216 constexpr int32_t COLOR_Format18bitARGB1665 = 9; 217 constexpr int32_t COLOR_Format18BitBGR666 = 41; 218 constexpr int32_t COLOR_Format18bitRGB666 = 8; 219 constexpr int32_t COLOR_Format19bitARGB1666 = 10; 220 constexpr int32_t COLOR_Format24BitABGR6666 = 43; 221 constexpr int32_t COLOR_Format24bitARGB1887 = 13; 222 constexpr int32_t COLOR_Format24BitARGB6666 = 42; 223 constexpr int32_t COLOR_Format24bitBGR888 = 12; 224 constexpr int32_t COLOR_Format24bitRGB888 = 11; 225 constexpr int32_t COLOR_Format25bitARGB1888 = 14; 226 constexpr int32_t COLOR_Format32bitABGR8888 = 0x7F00A000; 227 constexpr int32_t COLOR_Format32bitARGB8888 = 16; 228 constexpr int32_t COLOR_Format32bitBGRA8888 = 15; 229 constexpr int32_t COLOR_Format8bitRGB332 = 2; 230 constexpr int32_t COLOR_FormatCbYCrY = 27; 231 constexpr int32_t COLOR_FormatCrYCbY = 28; 232 constexpr int32_t COLOR_FormatL16 = 36; 233 constexpr int32_t COLOR_FormatL2 = 33; 234 constexpr int32_t COLOR_FormatL24 = 37; 235 constexpr int32_t COLOR_FormatL32 = 38; 236 constexpr int32_t COLOR_FormatL4 = 34; 237 constexpr int32_t COLOR_FormatL8 = 35; 238 constexpr int32_t COLOR_FormatMonochrome = 1; 239 constexpr int32_t COLOR_FormatRawBayer10bit = 31; 240 constexpr int32_t COLOR_FormatRawBayer8bit = 30; 241 constexpr int32_t COLOR_FormatRawBayer8bitcompressed = 32; 242 constexpr int32_t COLOR_FormatRGBAFlexible = 0x7F36A888; 243 constexpr int32_t COLOR_FormatRGBFlexible = 0x7F36B888; 244 constexpr int32_t COLOR_FormatSurface = 0x7F000789; 245 constexpr int32_t COLOR_FormatYCbYCr = 25; 246 constexpr int32_t COLOR_FormatYCrYCb = 26; 247 constexpr int32_t COLOR_FormatYUV411PackedPlanar = 18; 248 constexpr int32_t COLOR_FormatYUV411Planar = 17; 249 constexpr int32_t COLOR_FormatYUV420Flexible = 0x7F420888; 250 constexpr int32_t COLOR_FormatYUV420PackedPlanar = 20; 251 constexpr int32_t COLOR_FormatYUV420PackedSemiPlanar = 39; 252 constexpr int32_t COLOR_FormatYUV420Planar = 19; 253 constexpr int32_t COLOR_FormatYUV420SemiPlanar = 21; 254 constexpr int32_t COLOR_FormatYUV422Flexible = 0x7F422888; 255 constexpr int32_t COLOR_FormatYUV422PackedPlanar = 23; 256 constexpr int32_t COLOR_FormatYUV422PackedSemiPlanar = 40; 257 constexpr int32_t COLOR_FormatYUV422Planar = 22; 258 constexpr int32_t COLOR_FormatYUV422SemiPlanar = 24; 259 constexpr int32_t COLOR_FormatYUV444Flexible = 0x7F444888; 260 constexpr int32_t COLOR_FormatYUV444Interleaved = 29; 261 constexpr int32_t COLOR_QCOM_FormatYUV420SemiPlanar = 0x7fa30c00; 262 constexpr int32_t COLOR_TI_FormatYUV420PackedSemiPlanar = 0x7f000100; 263 264 constexpr char FEATURE_AdaptivePlayback[] = "adaptive-playback"; 265 constexpr char FEATURE_IntraRefresh[] = "intra-refresh"; 266 constexpr char FEATURE_PartialFrame[] = "partial-frame"; 267 constexpr char FEATURE_SecurePlayback[] = "secure-playback"; 268 constexpr char FEATURE_TunneledPlayback[] = "tunneled-playback"; 269 270 // from MediaFormat.java 271 constexpr char MIMETYPE_VIDEO_VP8[] = "video/x-vnd.on2.vp8"; 272 constexpr char MIMETYPE_VIDEO_VP9[] = "video/x-vnd.on2.vp9"; 273 constexpr char MIMETYPE_VIDEO_AVC[] = "video/avc"; 274 constexpr char MIMETYPE_VIDEO_HEVC[] = "video/hevc"; 275 constexpr char MIMETYPE_VIDEO_MPEG4[] = "video/mp4v-es"; 276 constexpr char MIMETYPE_VIDEO_H263[] = "video/3gpp"; 277 constexpr char MIMETYPE_VIDEO_MPEG2[] = "video/mpeg2"; 278 constexpr char MIMETYPE_VIDEO_RAW[] = "video/raw"; 279 constexpr char MIMETYPE_VIDEO_DOLBY_VISION[] = "video/dolby-vision"; 280 constexpr char MIMETYPE_VIDEO_SCRAMBLED[] = "video/scrambled"; 281 282 constexpr char MIMETYPE_AUDIO_AMR_NB[] = "audio/3gpp"; 283 constexpr char MIMETYPE_AUDIO_AMR_WB[] = "audio/amr-wb"; 284 constexpr char MIMETYPE_AUDIO_MPEG[] = "audio/mpeg"; 285 constexpr char MIMETYPE_AUDIO_AAC[] = "audio/mp4a-latm"; 286 constexpr char MIMETYPE_AUDIO_QCELP[] = "audio/qcelp"; 287 constexpr char MIMETYPE_AUDIO_VORBIS[] = "audio/vorbis"; 288 constexpr char MIMETYPE_AUDIO_OPUS[] = "audio/opus"; 289 constexpr char MIMETYPE_AUDIO_G711_ALAW[] = "audio/g711-alaw"; 290 constexpr char MIMETYPE_AUDIO_G711_MLAW[] = "audio/g711-mlaw"; 291 constexpr char MIMETYPE_AUDIO_RAW[] = "audio/raw"; 292 constexpr char MIMETYPE_AUDIO_FLAC[] = "audio/flac"; 293 constexpr char MIMETYPE_AUDIO_MSGSM[] = "audio/gsm"; 294 constexpr char MIMETYPE_AUDIO_AC3[] = "audio/ac3"; 295 constexpr char MIMETYPE_AUDIO_EAC3[] = "audio/eac3"; 296 constexpr char MIMETYPE_AUDIO_SCRAMBLED[] = "audio/scrambled"; 297 298 constexpr char MIMETYPE_IMAGE_ANDROID_HEIC[] = "image/vnd.android.heic"; 299 300 constexpr char MIMETYPE_TEXT_CEA_608[] = "text/cea-608"; 301 constexpr char MIMETYPE_TEXT_CEA_708[] = "text/cea-708"; 302 constexpr char MIMETYPE_TEXT_SUBRIP[] = "application/x-subrip"; 303 constexpr char MIMETYPE_TEXT_VTT[] = "text/vtt"; 304 305 constexpr int32_t COLOR_RANGE_FULL = 1; 306 constexpr int32_t COLOR_RANGE_LIMITED = 2; 307 constexpr int32_t COLOR_STANDARD_BT2020 = 6; 308 constexpr int32_t COLOR_STANDARD_BT601_NTSC = 4; 309 constexpr int32_t COLOR_STANDARD_BT601_PAL = 2; 310 constexpr int32_t COLOR_STANDARD_BT709 = 1; 311 constexpr int32_t COLOR_TRANSFER_HLG = 7; 312 constexpr int32_t COLOR_TRANSFER_LINEAR = 1; 313 constexpr int32_t COLOR_TRANSFER_SDR_VIDEO = 3; 314 constexpr int32_t COLOR_TRANSFER_ST2084 = 6; 315 316 constexpr char KEY_AAC_DRC_ATTENUATION_FACTOR[] = "aac-drc-cut-level"; 317 constexpr char KEY_AAC_DRC_BOOST_FACTOR[] = "aac-drc-boost-level"; 318 constexpr char KEY_AAC_DRC_EFFECT_TYPE[] = "aac-drc-effect-type"; 319 constexpr char KEY_AAC_DRC_HEAVY_COMPRESSION[] = "aac-drc-heavy-compression"; 320 constexpr char KEY_AAC_DRC_TARGET_REFERENCE_LEVEL[] = "aac-target-ref-level"; 321 constexpr char KEY_AAC_ENCODED_TARGET_LEVEL[] = "aac-encoded-target-level"; 322 constexpr char KEY_AAC_MAX_OUTPUT_CHANNEL_COUNT[] = "aac-max-output-channel_count"; 323 constexpr char KEY_AAC_PROFILE[] = "aac-profile"; 324 constexpr char KEY_AAC_SBR_MODE[] = "aac-sbr-mode"; 325 constexpr char KEY_AUDIO_SESSION_ID[] = "audio-session-id"; 326 constexpr char KEY_BIT_RATE[] = "bitrate"; 327 constexpr char KEY_BITRATE_MODE[] = "bitrate-mode"; 328 constexpr char KEY_CA_SESSION_ID[] = "ca-session-id"; 329 constexpr char KEY_CA_SYSTEM_ID[] = "ca-system-id"; 330 constexpr char KEY_CAPTURE_RATE[] = "capture-rate"; 331 constexpr char KEY_CHANNEL_COUNT[] = "channel-count"; 332 constexpr char KEY_CHANNEL_MASK[] = "channel-mask"; 333 constexpr char KEY_COLOR_FORMAT[] = "color-format"; 334 constexpr char KEY_COLOR_RANGE[] = "color-range"; 335 constexpr char KEY_COLOR_STANDARD[] = "color-standard"; 336 constexpr char KEY_COLOR_TRANSFER[] = "color-transfer"; 337 constexpr char KEY_COMPLEXITY[] = "complexity"; 338 constexpr char KEY_DURATION[] = "durationUs"; 339 constexpr char KEY_FEATURE_[] = "feature-"; 340 constexpr char KEY_FLAC_COMPRESSION_LEVEL[] = "flac-compression-level"; 341 constexpr char KEY_FRAME_RATE[] = "frame-rate"; 342 constexpr char KEY_GRID_COLUMNS[] = "grid-cols"; 343 constexpr char KEY_GRID_ROWS[] = "grid-rows"; 344 constexpr char KEY_HDR_STATIC_INFO[] = "hdr-static-info"; 345 constexpr char KEY_HEIGHT[] = "height"; 346 constexpr char KEY_I_FRAME_INTERVAL[] = "i-frame-interval"; 347 constexpr char KEY_INTRA_REFRESH_PERIOD[] = "intra-refresh-period"; 348 constexpr char KEY_IS_ADTS[] = "is-adts"; 349 constexpr char KEY_IS_AUTOSELECT[] = "is-autoselect"; 350 constexpr char KEY_IS_DEFAULT[] = "is-default"; 351 constexpr char KEY_IS_FORCED_SUBTITLE[] = "is-forced-subtitle"; 352 constexpr char KEY_IS_TIMED_TEXT[] = "is-timed-text"; 353 constexpr char KEY_LANGUAGE[] = "language"; 354 constexpr char KEY_LATENCY[] = "latency"; 355 constexpr char KEY_LEVEL[] = "level"; 356 constexpr char KEY_MAX_BIT_RATE[] = "max-bitrate"; 357 constexpr char KEY_MAX_HEIGHT[] = "max-height"; 358 constexpr char KEY_MAX_INPUT_SIZE[] = "max-input-size"; 359 constexpr char KEY_MAX_WIDTH[] = "max-width"; 360 constexpr char KEY_MIME[] = "mime"; 361 constexpr char KEY_OPERATING_RATE[] = "operating-rate"; 362 constexpr char KEY_OUTPUT_REORDER_DEPTH[] = "output-reorder-depth"; 363 constexpr char KEY_PCM_ENCODING[] = "pcm-encoding"; 364 constexpr char KEY_PRIORITY[] = "priority"; 365 constexpr char KEY_PROFILE[] = "profile"; 366 constexpr char KEY_PUSH_BLANK_BUFFERS_ON_STOP[] = "push-blank-buffers-on-shutdown"; 367 constexpr char KEY_QUALITY[] = "quality"; 368 constexpr char KEY_REPEAT_PREVIOUS_FRAME_AFTER[] = "repeat-previous-frame-after"; 369 constexpr char KEY_ROTATION[] = "rotation-degrees"; 370 constexpr char KEY_SAMPLE_RATE[] = "sample-rate"; 371 constexpr char KEY_SLICE_HEIGHT[] = "slice-height"; 372 constexpr char KEY_STRIDE[] = "stride"; 373 constexpr char KEY_TEMPORAL_LAYERING[] = "ts-schema"; 374 constexpr char KEY_TILE_HEIGHT[] = "tile-height"; 375 constexpr char KEY_TILE_WIDTH[] = "tile-width"; 376 constexpr char KEY_TRACK_ID[] = "track-id"; 377 constexpr char KEY_WIDTH[] = "width"; 378 379 // from MediaCodec.java 380 constexpr int32_t ERROR_INSUFFICIENT_OUTPUT_PROTECTION = 4; 381 constexpr int32_t ERROR_INSUFFICIENT_RESOURCE = 1100; 382 constexpr int32_t ERROR_KEY_EXPIRED = 2; 383 constexpr int32_t ERROR_NO_KEY = 1; 384 constexpr int32_t ERROR_RECLAIMED = 1101; 385 constexpr int32_t ERROR_RESOURCE_BUSY = 3; 386 constexpr int32_t ERROR_SESSION_NOT_OPENED = 5; 387 constexpr int32_t ERROR_UNSUPPORTED_OPERATION = 6; 388 constexpr char CODEC[] = "android.media.mediacodec.codec"; 389 constexpr char ENCODER[] = "android.media.mediacodec.encoder"; 390 constexpr char HEIGHT[] = "android.media.mediacodec.height"; 391 constexpr char MIME_TYPE[] = "android.media.mediacodec.mime"; 392 constexpr char MODE[] = "android.media.mediacodec.mode"; 393 constexpr char MODE_AUDIO[] = "audio"; 394 constexpr char MODE_VIDEO[] = "video"; 395 constexpr char ROTATION[] = "android.media.mediacodec.rotation"; 396 constexpr char SECURE[] = "android.media.mediacodec.secure"; 397 constexpr char WIDTH[] = "android.media.mediacodec.width"; 398 399 constexpr int32_t BUFFER_FLAG_CODEC_CONFIG = 2; 400 constexpr int32_t BUFFER_FLAG_END_OF_STREAM = 4; 401 constexpr int32_t BUFFER_FLAG_KEY_FRAME = 1; 402 constexpr int32_t BUFFER_FLAG_PARTIAL_FRAME = 8; 403 constexpr int32_t BUFFER_FLAG_SYNC_FRAME = 1; 404 constexpr int32_t CONFIGURE_FLAG_ENCODE = 1; 405 constexpr int32_t CRYPTO_MODE_AES_CBC = 2; 406 constexpr int32_t CRYPTO_MODE_AES_CTR = 1; 407 constexpr int32_t CRYPTO_MODE_UNENCRYPTED = 0; 408 constexpr int32_t INFO_OUTPUT_BUFFERS_CHANGED = -3; 409 constexpr int32_t INFO_OUTPUT_FORMAT_CHANGED = -2; 410 constexpr int32_t INFO_TRY_AGAIN_LATER = -1; 411 constexpr int32_t VIDEO_SCALING_MODE_SCALE_TO_FIT = 1; 412 constexpr int32_t VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING = 2; 413 constexpr char PARAMETER_KEY_REQUEST_SYNC_FRAME[] = "request-sync"; 414 constexpr char PARAMETER_KEY_SUSPEND[] = "drop-input-frames"; 415 constexpr char PARAMETER_KEY_VIDEO_BITRATE[] = "video-bitrate"; 416 417 } 418 419 #endif // MEDIA_CODEC_CONSTANTS_H_ 420 421