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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 &kADTSCodecInfo, | 291 &kADTSCodecInfo, |
292 NULL | 292 NULL |
293 }; | 293 }; |
294 | 294 |
295 static StreamParser* BuildADTSParser(const std::vector<std::string>& codecs, | 295 static StreamParser* BuildADTSParser(const std::vector<std::string>& codecs, |
296 const scoped_refptr<MediaLog>& media_log) { | 296 const scoped_refptr<MediaLog>& media_log) { |
297 return new ADTSStreamParser(); | 297 return new ADTSStreamParser(); |
298 } | 298 } |
299 | 299 |
300 #if BUILDFLAG(ENABLE_MSE_MPEG2TS_STREAM_PARSER) | 300 #if BUILDFLAG(ENABLE_MSE_MPEG2TS_STREAM_PARSER) |
301 static const CodecInfo* kVideoMP2TCodecs[] = { | 301 // These codec ids correspond to object types registered with MP4RA and are the |
302 &kH264AVC1CodecInfo, | 302 // same as MP3 audio codec ids in media/base/mime_util_internal.cc. |
303 &kH264AVC3CodecInfo, | 303 // From http://www.mp4ra.org/object.html: |
304 &kMPEG4AACCodecInfo, | 304 // 69 Audio ISO/IEC 13818-3 |
305 &kMPEG2AACLCCodecInfo, | 305 // 6B Audio ISO/IEC 11172-3 |
306 NULL | 306 static const CodecInfo kMPEG2TS_MP3CodecInfo1 = { |
307 }; | 307 "mp4a.69", CodecInfo::AUDIO, NULL, CodecInfo::HISTOGRAM_MP3}; |
| 308 static const CodecInfo kMPEG2TS_MP3CodecInfo2 = { |
| 309 "mp4a.6B", CodecInfo::AUDIO, NULL, CodecInfo::HISTOGRAM_MP3}; |
| 310 |
| 311 static const CodecInfo* kVideoMP2TCodecs[] = {&kH264AVC1CodecInfo, |
| 312 &kH264AVC3CodecInfo, |
| 313 &kMPEG2TS_MP3CodecInfo1, |
| 314 &kMPEG2TS_MP3CodecInfo2, |
| 315 &kMPEG4AACCodecInfo, |
| 316 &kMPEG2AACLCCodecInfo, |
| 317 NULL}; |
308 | 318 |
309 static StreamParser* BuildMP2TParser(const std::vector<std::string>& codecs, | 319 static StreamParser* BuildMP2TParser(const std::vector<std::string>& codecs, |
310 const scoped_refptr<MediaLog>& media_log) { | 320 const scoped_refptr<MediaLog>& media_log) { |
311 bool has_sbr = false; | 321 bool has_sbr = false; |
312 for (size_t i = 0; i < codecs.size(); ++i) { | 322 for (size_t i = 0; i < codecs.size(); ++i) { |
313 std::string codec_id = codecs[i]; | 323 std::string codec_id = codecs[i]; |
314 if (base::MatchPattern(codec_id, kMPEG4AACCodecInfo.pattern)) { | 324 if (base::MatchPattern(codec_id, kMPEG4AACCodecInfo.pattern)) { |
315 int audio_object_type = GetMP4AudioObjectType(codec_id, media_log); | 325 int audio_object_type = GetMP4AudioObjectType(codec_id, media_log); |
316 if (audio_object_type == kAACSBRObjectType || | 326 if (audio_object_type == kAACSBRObjectType || |
317 audio_object_type == kAACPSObjectType) { | 327 audio_object_type == kAACPSObjectType) { |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 CodecInfo::HISTOGRAM_MAX + 1); | 492 CodecInfo::HISTOGRAM_MAX + 1); |
483 } | 493 } |
484 | 494 |
485 stream_parser.reset(factory_function(codecs, media_log)); | 495 stream_parser.reset(factory_function(codecs, media_log)); |
486 } | 496 } |
487 | 497 |
488 return stream_parser; | 498 return stream_parser; |
489 } | 499 } |
490 | 500 |
491 } // namespace media | 501 } // namespace media |
OLD | NEW |