OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "media/filters/stream_parser_factory.h" | 5 #include "media/filters/stream_parser_factory.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 const scoped_refptr<MediaLog>& media_log); | 74 const scoped_refptr<MediaLog>& media_log); |
75 | 75 |
76 struct SupportedTypeInfo { | 76 struct SupportedTypeInfo { |
77 const char* type; | 77 const char* type; |
78 const ParserFactoryFunction factory_function; | 78 const ParserFactoryFunction factory_function; |
79 const CodecInfo** codecs; | 79 const CodecInfo** codecs; |
80 }; | 80 }; |
81 | 81 |
82 static const CodecInfo kVP8CodecInfo = { "vp8", CodecInfo::VIDEO, NULL, | 82 static const CodecInfo kVP8CodecInfo = { "vp8", CodecInfo::VIDEO, NULL, |
83 CodecInfo::HISTOGRAM_VP8 }; | 83 CodecInfo::HISTOGRAM_VP8 }; |
84 static const CodecInfo kVP9CodecInfo = { "vp9", CodecInfo::VIDEO, NULL, | 84 static const CodecInfo kLegacyVP9CodecInfo = {"vp9", CodecInfo::VIDEO, NULL, |
85 CodecInfo::HISTOGRAM_VP9 }; | 85 CodecInfo::HISTOGRAM_VP9}; |
| 86 static const CodecInfo kVP9CodecInfo = {"vp09.*", CodecInfo::VIDEO, NULL, |
| 87 CodecInfo::HISTOGRAM_VP9}; |
86 static const CodecInfo kVorbisCodecInfo = { "vorbis", CodecInfo::AUDIO, NULL, | 88 static const CodecInfo kVorbisCodecInfo = { "vorbis", CodecInfo::AUDIO, NULL, |
87 CodecInfo::HISTOGRAM_VORBIS }; | 89 CodecInfo::HISTOGRAM_VORBIS }; |
88 static const CodecInfo kOpusCodecInfo = { "opus", CodecInfo::AUDIO, NULL, | 90 static const CodecInfo kOpusCodecInfo = { "opus", CodecInfo::AUDIO, NULL, |
89 CodecInfo::HISTOGRAM_OPUS }; | 91 CodecInfo::HISTOGRAM_OPUS }; |
90 | 92 |
91 static const CodecInfo* kVideoWebMCodecs[] = { | 93 static const CodecInfo* kVideoWebMCodecs[] = { |
92 &kVP8CodecInfo, | 94 &kVP8CodecInfo, &kLegacyVP9CodecInfo, &kVP9CodecInfo, |
93 &kVP9CodecInfo, | 95 &kVorbisCodecInfo, &kOpusCodecInfo, NULL}; |
94 &kVorbisCodecInfo, | |
95 &kOpusCodecInfo, | |
96 NULL | |
97 }; | |
98 | 96 |
99 static const CodecInfo* kAudioWebMCodecs[] = { | 97 static const CodecInfo* kAudioWebMCodecs[] = { |
100 &kVorbisCodecInfo, | 98 &kVorbisCodecInfo, |
101 &kOpusCodecInfo, | 99 &kOpusCodecInfo, |
102 NULL | 100 NULL |
103 }; | 101 }; |
104 | 102 |
105 static StreamParser* BuildWebMParser(const std::vector<std::string>& codecs, | 103 static StreamParser* BuildWebMParser(const std::vector<std::string>& codecs, |
106 const scoped_refptr<MediaLog>& media_log) { | 104 const scoped_refptr<MediaLog>& media_log) { |
107 return new WebMStreamParser(); | 105 return new WebMStreamParser(); |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 CodecInfo::HISTOGRAM_MAX + 1); | 462 CodecInfo::HISTOGRAM_MAX + 1); |
465 } | 463 } |
466 | 464 |
467 stream_parser.reset(factory_function(codecs, media_log)); | 465 stream_parser.reset(factory_function(codecs, media_log)); |
468 } | 466 } |
469 | 467 |
470 return stream_parser; | 468 return stream_parser; |
471 } | 469 } |
472 | 470 |
473 } // namespace media | 471 } // namespace media |
OLD | NEW |