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 #include "ui/gfx/color_space.h" | 12 #include "ui/gfx/color_space.h" |
13 | 13 |
14 namespace media { | 14 namespace media { |
15 | 15 |
| 16 class VideoColorSpace; |
| 17 |
16 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.media | 18 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.media |
17 enum VideoCodec { | 19 enum VideoCodec { |
18 // These values are histogrammed over time; do not change their ordinal | 20 // These values are histogrammed over time; do not change their ordinal |
19 // values. When deleting a codec replace it with a dummy value; when adding a | 21 // values. When deleting a codec replace it with a dummy value; when adding a |
20 // codec, do so at the bottom (and update kVideoCodecMax). | 22 // codec, do so at the bottom (and update kVideoCodecMax). |
21 kUnknownVideoCodec = 0, | 23 kUnknownVideoCodec = 0, |
22 kCodecH264, | 24 kCodecH264, |
23 kCodecVC1, | 25 kCodecVC1, |
24 kCodecMPEG2, | 26 kCodecMPEG2, |
25 kCodecMPEG4, | 27 kCodecMPEG4, |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 99 |
98 // ParseNewStyleVp9CodecID handles parsing of new style vp9 codec IDs per | 100 // ParseNewStyleVp9CodecID handles parsing of new style vp9 codec IDs per |
99 // proposed VP Codec ISO Media File Format Binding specification: | 101 // proposed VP Codec ISO Media File Format Binding specification: |
100 // https://storage.googleapis.com/downloads.webmproject.org/docs/vp9/vp-codec-is
o-media-file-format-binding-20160516-draft.pdf | 102 // https://storage.googleapis.com/downloads.webmproject.org/docs/vp9/vp-codec-is
o-media-file-format-binding-20160516-draft.pdf |
101 // ParseLegacyVp9CodecID handles parsing of legacy VP9 codec strings defined | 103 // ParseLegacyVp9CodecID handles parsing of legacy VP9 codec strings defined |
102 // for WebM. | 104 // for WebM. |
103 // TODO(kqyang): Consolidate the two functions once we address crbug.com/667834 | 105 // TODO(kqyang): Consolidate the two functions once we address crbug.com/667834 |
104 MEDIA_EXPORT bool ParseNewStyleVp9CodecID(const std::string& codec_id, | 106 MEDIA_EXPORT bool ParseNewStyleVp9CodecID(const std::string& codec_id, |
105 VideoCodecProfile* profile, | 107 VideoCodecProfile* profile, |
106 uint8_t* level_idc, | 108 uint8_t* level_idc, |
107 gfx::ColorSpace::TransferID* eotf); | 109 VideoColorSpace* color_space); |
108 | 110 |
109 MEDIA_EXPORT bool ParseLegacyVp9CodecID(const std::string& codec_id, | 111 MEDIA_EXPORT bool ParseLegacyVp9CodecID(const std::string& codec_id, |
110 VideoCodecProfile* profile, | 112 VideoCodecProfile* profile, |
111 uint8_t* level_idc); | 113 uint8_t* level_idc); |
112 | 114 |
113 // Handle parsing AVC/H.264 codec ids as outlined in RFC 6381 and ISO-14496-10. | 115 // Handle parsing AVC/H.264 codec ids as outlined in RFC 6381 and ISO-14496-10. |
114 MEDIA_EXPORT bool ParseAVCCodecId(const std::string& codec_id, | 116 MEDIA_EXPORT bool ParseAVCCodecId(const std::string& codec_id, |
115 VideoCodecProfile* profile, | 117 VideoCodecProfile* profile, |
116 uint8_t* level_idc); | 118 uint8_t* level_idc); |
117 | 119 |
(...skipping 14 matching lines...) Expand all Loading... |
132 #if BUILDFLAG(ENABLE_MSE_MPEG2TS_STREAM_PARSER) | 134 #if BUILDFLAG(ENABLE_MSE_MPEG2TS_STREAM_PARSER) |
133 // Translate legacy avc1 codec ids (like avc1.66.30 or avc1.77.31) into a new | 135 // Translate legacy avc1 codec ids (like avc1.66.30 or avc1.77.31) into a new |
134 // style standard avc1 codec ids like avc1.4D002F. If the input codec is not | 136 // style standard avc1 codec ids like avc1.4D002F. If the input codec is not |
135 // recognized as a legacy codec id, then returns the input string unchanged. | 137 // recognized as a legacy codec id, then returns the input string unchanged. |
136 std::string TranslateLegacyAvc1CodecIds(const std::string& codec_id); | 138 std::string TranslateLegacyAvc1CodecIds(const std::string& codec_id); |
137 #endif | 139 #endif |
138 | 140 |
139 } // namespace media | 141 } // namespace media |
140 | 142 |
141 #endif // MEDIA_BASE_VIDEO_CODECS_H_ | 143 #endif // MEDIA_BASE_VIDEO_CODECS_H_ |
OLD | NEW |