Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_BASE_VIDEO_CODECS_H_ | 5 #ifndef MEDIA_BASE_VIDEO_CODECS_H_ |
| 6 #define MEDIA_BASE_VIDEO_CODECS_H_ | 6 #define MEDIA_BASE_VIDEO_CODECS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include "media/base/media_export.h" | 10 #include "media/base/media_export.h" |
| 11 #include "media/media_features.h" | 11 #include "media/media_features.h" |
| 12 | 12 |
| 13 namespace media { | 13 namespace media { |
| 14 | 14 |
| 15 enum VideoCodec { | 15 enum VideoCodec { |
| 16 // These values are histogrammed over time; do not change their ordinal | 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 | 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). | 18 // codec, do so at the bottom (and update kVideoCodecMax). |
| 19 kUnknownVideoCodec = 0, | 19 kUnknownVideoCodec = 0, |
| 20 kCodecH264, | 20 kCodecH264, |
| 21 kCodecVC1, | 21 kCodecVC1, |
| 22 kCodecMPEG2, | 22 kCodecMPEG2, |
| 23 kCodecMPEG4, | 23 kCodecMPEG4, |
| 24 kCodecTheora, | 24 kCodecTheora, |
| 25 kCodecVP8, | 25 kCodecVP8, |
| 26 kCodecVP9, | 26 kCodecVP9, |
| 27 kCodecHEVC, | 27 kCodecHEVC, |
| 28 kCodecDolbyVision, | |
| 28 // DO NOT ADD RANDOM VIDEO CODECS! | 29 // DO NOT ADD RANDOM VIDEO CODECS! |
| 29 // | 30 // |
| 30 // The only acceptable time to add a new codec is if there is production code | 31 // The only acceptable time to add a new codec is if there is production code |
| 31 // that uses said codec in the same CL. | 32 // that uses said codec in the same CL. |
| 32 | 33 |
| 33 kVideoCodecMax = kCodecHEVC // Must equal the last "real" codec above. | 34 kVideoCodecMax = kCodecDolbyVision // Must equal the last "real" codec above. |
| 34 }; | 35 }; |
| 35 | 36 |
| 36 // Video codec profiles. Keep in sync with mojo::VideoCodecProfile (see | 37 // Video codec profiles. Keep in sync with mojo::VideoCodecProfile (see |
| 37 // media/mojo/interfaces/media_types.mojom), gpu::VideoCodecProfile (see | 38 // media/mojo/interfaces/media_types.mojom), gpu::VideoCodecProfile (see |
| 38 // gpu/config/gpu_info.h), and | 39 // gpu/config/gpu_info.h), and |
| 39 // media/base/android/java/src/org/chromium/media/CodecProfileLevelList.java, | 40 // media/base/android/java/src/org/chromium/media/CodecProfileLevelList.java, |
| 40 // as well as PP_VideoDecoder_Profile (translation is performed in | 41 // as well as PP_VideoDecoder_Profile (translation is performed in |
| 41 // content/renderer/pepper/ppb_video_decoder_impl.cc). | 42 // content/renderer/pepper/ppb_video_decoder_impl.cc). |
| 42 // NOTE: These values are histogrammed over time in UMA so the values must | 43 // NOTE: These values are histogrammed over time in UMA so the values must |
| 43 // never ever change (add new values to tools/metrics/histograms/histograms.xml) | 44 // never ever change (add new values to tools/metrics/histograms/histograms.xml) |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 65 VP8PROFILE_MAX = VP8PROFILE_ANY, | 66 VP8PROFILE_MAX = VP8PROFILE_ANY, |
| 66 VP9PROFILE_MIN = 12, | 67 VP9PROFILE_MIN = 12, |
| 67 VP9PROFILE_PROFILE0 = VP9PROFILE_MIN, | 68 VP9PROFILE_PROFILE0 = VP9PROFILE_MIN, |
| 68 VP9PROFILE_PROFILE1 = 13, | 69 VP9PROFILE_PROFILE1 = 13, |
| 69 VP9PROFILE_PROFILE2 = 14, | 70 VP9PROFILE_PROFILE2 = 14, |
| 70 VP9PROFILE_PROFILE3 = 15, | 71 VP9PROFILE_PROFILE3 = 15, |
| 71 VP9PROFILE_MAX = VP9PROFILE_PROFILE3, | 72 VP9PROFILE_MAX = VP9PROFILE_PROFILE3, |
| 72 HEVCPROFILE_MIN = 16, | 73 HEVCPROFILE_MIN = 16, |
| 73 HEVCPROFILE_MAIN = HEVCPROFILE_MIN, | 74 HEVCPROFILE_MAIN = HEVCPROFILE_MIN, |
| 74 HEVCPROFILE_MAIN10 = 17, | 75 HEVCPROFILE_MAIN10 = 17, |
| 75 HEVCPROFILE_MAIN_STILL_PICTURE = 18, | 76 HEVCPROFILE_MAIN_STILL_PICTURE = 18, |
|
wolenetz
2017/02/18 00:01:03
Was there unintentional deletion of HEVCPROFILE_MA
erickung1
2017/02/27 17:33:10
Done.
| |
| 76 HEVCPROFILE_MAX = HEVCPROFILE_MAIN_STILL_PICTURE, | 77 DOLBYVISION_MIN = 19, |
| 77 VIDEO_CODEC_PROFILE_MAX = HEVCPROFILE_MAX, | 78 DOLBYVISION_PROFILE0 = DOLBYVISION_MIN, |
| 79 DOLBYVISION_PROFILE4 = 20, | |
| 80 DOLBYVISION_PROFILE5 = 21, | |
| 81 DOLBYVISION_PROFILE7 = 22, | |
| 82 DOLBYVISION_MAX = DOLBYVISION_PROFILE7, | |
| 83 VIDEO_CODEC_PROFILE_MAX = DOLBYVISION_MAX, | |
| 78 }; | 84 }; |
| 79 | 85 |
| 80 struct CodecProfileLevel { | 86 struct CodecProfileLevel { |
| 81 VideoCodec codec; | 87 VideoCodec codec; |
| 82 VideoCodecProfile profile; | 88 VideoCodecProfile profile; |
| 83 int level; | 89 int level; |
| 84 }; | 90 }; |
| 85 | 91 |
| 86 std::string MEDIA_EXPORT GetCodecName(VideoCodec codec); | 92 std::string MEDIA_EXPORT GetCodecName(VideoCodec codec); |
| 87 std::string MEDIA_EXPORT GetProfileName(VideoCodecProfile profile); | 93 std::string MEDIA_EXPORT GetProfileName(VideoCodecProfile profile); |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 103 MEDIA_EXPORT bool ParseAVCCodecId(const std::string& codec_id, | 109 MEDIA_EXPORT bool ParseAVCCodecId(const std::string& codec_id, |
| 104 VideoCodecProfile* profile, | 110 VideoCodecProfile* profile, |
| 105 uint8_t* level_idc); | 111 uint8_t* level_idc); |
| 106 | 112 |
| 107 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) | 113 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) |
| 108 MEDIA_EXPORT bool ParseHEVCCodecId(const std::string& codec_id, | 114 MEDIA_EXPORT bool ParseHEVCCodecId(const std::string& codec_id, |
| 109 VideoCodecProfile* profile, | 115 VideoCodecProfile* profile, |
| 110 uint8_t* level_idc); | 116 uint8_t* level_idc); |
| 111 #endif | 117 #endif |
| 112 | 118 |
| 119 #if BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING) | |
| 120 MEDIA_EXPORT bool ParseDolbyVisionCodecId(const std::string& codec_id, | |
| 121 VideoCodecProfile* profile, | |
| 122 uint8_t* level_id); | |
| 123 #endif | |
| 124 | |
| 113 MEDIA_EXPORT VideoCodec StringToVideoCodec(const std::string& codec_id); | 125 MEDIA_EXPORT VideoCodec StringToVideoCodec(const std::string& codec_id); |
| 114 | 126 |
| 115 #if BUILDFLAG(ENABLE_MSE_MPEG2TS_STREAM_PARSER) | 127 #if BUILDFLAG(ENABLE_MSE_MPEG2TS_STREAM_PARSER) |
| 116 // Translate legacy avc1 codec ids (like avc1.66.30 or avc1.77.31) into a new | 128 // Translate legacy avc1 codec ids (like avc1.66.30 or avc1.77.31) into a new |
| 117 // style standard avc1 codec ids like avc1.4D002F. If the input codec is not | 129 // style standard avc1 codec ids like avc1.4D002F. If the input codec is not |
| 118 // recognized as a legacy codec id, then returns the input string unchanged. | 130 // recognized as a legacy codec id, then returns the input string unchanged. |
| 119 std::string TranslateLegacyAvc1CodecIds(const std::string& codec_id); | 131 std::string TranslateLegacyAvc1CodecIds(const std::string& codec_id); |
| 120 #endif | 132 #endif |
| 121 | 133 |
| 122 } // namespace media | 134 } // namespace media |
| 123 | 135 |
| 124 #endif // MEDIA_BASE_VIDEO_CODECS_H_ | 136 #endif // MEDIA_BASE_VIDEO_CODECS_H_ |
| OLD | NEW |