1 // Copyright 2012 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 // Note: ported from Chromium commit head: becc5bbb0aa6 5 // Note: only necessary functions are ported. 6 7 #ifndef VIDEO_CODECS_H_ 8 #define VIDEO_CODECS_H_ 9 10 #include <string> 11 12 namespace media { 13 14 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.media 15 enum VideoCodec { 16 // These values are histogrammed over time; do not change their ordinal 17 // values. When deleting a codec replace it with a dummy value; when adding a 18 // codec, do so at the bottom (and update kVideoCodecMax). 19 kUnknownVideoCodec = 0, 20 kCodecH264, 21 kCodecVC1, 22 kCodecMPEG2, 23 kCodecMPEG4, 24 kCodecTheora, 25 kCodecVP8, 26 kCodecVP9, 27 kCodecHEVC, 28 kCodecDolbyVision, 29 kCodecAV1, 30 // DO NOT ADD RANDOM VIDEO CODECS! 31 // 32 // The only acceptable time to add a new codec is if there is production code 33 // that uses said codec in the same CL. 34 35 kVideoCodecMax = kCodecAV1, // Must equal the last "real" codec above. 36 }; 37 38 // Video codec profiles. Keep in sync with mojo::VideoCodecProfile (see 39 // media/mojo/mojom/media_types.mojom), gpu::VideoCodecProfile (see 40 // gpu/config/gpu_info.h), and PP_VideoDecoder_Profile (translation is performed 41 // in content/renderer/pepper/ppb_video_decoder_impl.cc). 42 // NOTE: These values are histogrammed over time in UMA so the values must never 43 // ever change (add new values to tools/metrics/histograms/histograms.xml) 44 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.media 45 enum VideoCodecProfile { 46 // Keep the values in this enum unique, as they imply format (h.264 vs. VP8, 47 // for example), and keep the values for a particular format grouped 48 // together for clarity. 49 VIDEO_CODEC_PROFILE_UNKNOWN = -1, 50 VIDEO_CODEC_PROFILE_MIN = VIDEO_CODEC_PROFILE_UNKNOWN, 51 H264PROFILE_MIN = 0, 52 H264PROFILE_BASELINE = H264PROFILE_MIN, 53 H264PROFILE_MAIN = 1, 54 H264PROFILE_EXTENDED = 2, 55 H264PROFILE_HIGH = 3, 56 H264PROFILE_HIGH10PROFILE = 4, 57 H264PROFILE_HIGH422PROFILE = 5, 58 H264PROFILE_HIGH444PREDICTIVEPROFILE = 6, 59 H264PROFILE_SCALABLEBASELINE = 7, 60 H264PROFILE_SCALABLEHIGH = 8, 61 H264PROFILE_STEREOHIGH = 9, 62 H264PROFILE_MULTIVIEWHIGH = 10, 63 H264PROFILE_MAX = H264PROFILE_MULTIVIEWHIGH, 64 VP8PROFILE_MIN = 11, 65 VP8PROFILE_ANY = VP8PROFILE_MIN, 66 VP8PROFILE_MAX = VP8PROFILE_ANY, 67 VP9PROFILE_MIN = 12, 68 VP9PROFILE_PROFILE0 = VP9PROFILE_MIN, 69 VP9PROFILE_PROFILE1 = 13, 70 VP9PROFILE_PROFILE2 = 14, 71 VP9PROFILE_PROFILE3 = 15, 72 VP9PROFILE_MAX = VP9PROFILE_PROFILE3, 73 HEVCPROFILE_MIN = 16, 74 HEVCPROFILE_MAIN = HEVCPROFILE_MIN, 75 HEVCPROFILE_MAIN10 = 17, 76 HEVCPROFILE_MAIN_STILL_PICTURE = 18, 77 HEVCPROFILE_MAX = HEVCPROFILE_MAIN_STILL_PICTURE, 78 DOLBYVISION_PROFILE0 = 19, 79 DOLBYVISION_PROFILE4 = 20, 80 DOLBYVISION_PROFILE5 = 21, 81 DOLBYVISION_PROFILE7 = 22, 82 THEORAPROFILE_MIN = 23, 83 THEORAPROFILE_ANY = THEORAPROFILE_MIN, 84 THEORAPROFILE_MAX = THEORAPROFILE_ANY, 85 AV1PROFILE_MIN = 24, 86 AV1PROFILE_PROFILE_MAIN = AV1PROFILE_MIN, 87 AV1PROFILE_PROFILE_HIGH = 25, 88 AV1PROFILE_PROFILE_PRO = 26, 89 AV1PROFILE_MAX = AV1PROFILE_PROFILE_PRO, 90 DOLBYVISION_PROFILE8 = 27, 91 DOLBYVISION_PROFILE9 = 28, 92 VIDEO_CODEC_PROFILE_MAX = DOLBYVISION_PROFILE9, 93 }; 94 95 std::string GetProfileName(VideoCodecProfile profile); 96 97 } // namespace media 98 99 #endif // VIDEO_CODECS_H_ 100