| 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 | 13 |
| 13 namespace media { | 14 namespace media { |
| 14 | 15 |
| 15 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.media | 16 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.media |
| 16 enum VideoCodec { | 17 enum VideoCodec { |
| 17 // These values are histogrammed over time; do not change their ordinal | 18 // These values are histogrammed over time; do not change their ordinal |
| 18 // values. When deleting a codec replace it with a dummy value; when adding a | 19 // values. When deleting a codec replace it with a dummy value; when adding a |
| 19 // codec, do so at the bottom (and update kVideoCodecMax). | 20 // codec, do so at the bottom (and update kVideoCodecMax). |
| 20 kUnknownVideoCodec = 0, | 21 kUnknownVideoCodec = 0, |
| 21 kCodecH264, | 22 kCodecH264, |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 std::string MEDIA_EXPORT GetProfileName(VideoCodecProfile profile); | 88 std::string MEDIA_EXPORT GetProfileName(VideoCodecProfile profile); |
| 88 | 89 |
| 89 // ParseNewStyleVp9CodecID handles parsing of new style vp9 codec IDs per | 90 // ParseNewStyleVp9CodecID handles parsing of new style vp9 codec IDs per |
| 90 // proposed VP Codec ISO Media File Format Binding specification: | 91 // proposed VP Codec ISO Media File Format Binding specification: |
| 91 // https://storage.googleapis.com/downloads.webmproject.org/docs/vp9/vp-codec-is
o-media-file-format-binding-20160516-draft.pdf | 92 // https://storage.googleapis.com/downloads.webmproject.org/docs/vp9/vp-codec-is
o-media-file-format-binding-20160516-draft.pdf |
| 92 // ParseLegacyVp9CodecID handles parsing of legacy VP9 codec strings defined | 93 // ParseLegacyVp9CodecID handles parsing of legacy VP9 codec strings defined |
| 93 // for WebM. | 94 // for WebM. |
| 94 // TODO(kqyang): Consolidate the two functions once we address crbug.com/667834 | 95 // TODO(kqyang): Consolidate the two functions once we address crbug.com/667834 |
| 95 MEDIA_EXPORT bool ParseNewStyleVp9CodecID(const std::string& codec_id, | 96 MEDIA_EXPORT bool ParseNewStyleVp9CodecID(const std::string& codec_id, |
| 96 VideoCodecProfile* profile, | 97 VideoCodecProfile* profile, |
| 97 uint8_t* level_idc); | 98 uint8_t* level_idc, |
| 99 gfx::ColorSpace::TransferID* eotf); |
| 100 |
| 98 MEDIA_EXPORT bool ParseLegacyVp9CodecID(const std::string& codec_id, | 101 MEDIA_EXPORT bool ParseLegacyVp9CodecID(const std::string& codec_id, |
| 99 VideoCodecProfile* profile, | 102 VideoCodecProfile* profile, |
| 100 uint8_t* level_idc); | 103 uint8_t* level_idc); |
| 101 | 104 |
| 102 // Handle parsing AVC/H.264 codec ids as outlined in RFC 6381 and ISO-14496-10. | 105 // Handle parsing AVC/H.264 codec ids as outlined in RFC 6381 and ISO-14496-10. |
| 103 MEDIA_EXPORT bool ParseAVCCodecId(const std::string& codec_id, | 106 MEDIA_EXPORT bool ParseAVCCodecId(const std::string& codec_id, |
| 104 VideoCodecProfile* profile, | 107 VideoCodecProfile* profile, |
| 105 uint8_t* level_idc); | 108 uint8_t* level_idc); |
| 106 | 109 |
| 107 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) | 110 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) |
| 108 MEDIA_EXPORT bool ParseHEVCCodecId(const std::string& codec_id, | 111 MEDIA_EXPORT bool ParseHEVCCodecId(const std::string& codec_id, |
| 109 VideoCodecProfile* profile, | 112 VideoCodecProfile* profile, |
| 110 uint8_t* level_idc); | 113 uint8_t* level_idc); |
| 111 #endif | 114 #endif |
| 112 | 115 |
| 113 MEDIA_EXPORT VideoCodec StringToVideoCodec(const std::string& codec_id); | 116 MEDIA_EXPORT VideoCodec StringToVideoCodec(const std::string& codec_id); |
| 114 | 117 |
| 115 #if BUILDFLAG(ENABLE_MSE_MPEG2TS_STREAM_PARSER) | 118 #if BUILDFLAG(ENABLE_MSE_MPEG2TS_STREAM_PARSER) |
| 116 // Translate legacy avc1 codec ids (like avc1.66.30 or avc1.77.31) into a new | 119 // 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 | 120 // 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. | 121 // recognized as a legacy codec id, then returns the input string unchanged. |
| 119 std::string TranslateLegacyAvc1CodecIds(const std::string& codec_id); | 122 std::string TranslateLegacyAvc1CodecIds(const std::string& codec_id); |
| 120 #endif | 123 #endif |
| 121 | 124 |
| 122 } // namespace media | 125 } // namespace media |
| 123 | 126 |
| 124 #endif // MEDIA_BASE_VIDEO_CODECS_H_ | 127 #endif // MEDIA_BASE_VIDEO_CODECS_H_ |
| OLD | NEW |