Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: media/filters/stream_parser_factory.cc

Issue 2773793002: Allow mp3 audio codec for mpeg2ts containers in MSE (Closed)
Patch Set: Use mp4a.69,mp4a.6B codec ids instead of mp3 Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 static const CodecInfo kMPEG2TS_MP3CodecInfo1 = {
wolenetz 2017/03/24 17:34:25 nit: please reference the mp4ra object registry si
servolk 2017/03/27 20:10:39 Done.
302 &kH264AVC1CodecInfo, 302 "mp4a.69", CodecInfo::AUDIO, NULL, CodecInfo::HISTOGRAM_MP3};
303 &kH264AVC3CodecInfo, 303 static const CodecInfo kMPEG2TS_MP3CodecInfo2 = {
304 &kMPEG4AACCodecInfo, 304 "mp4a.6B", CodecInfo::AUDIO, NULL, CodecInfo::HISTOGRAM_MP3};
305 &kMPEG2AACLCCodecInfo, 305
306 NULL 306 static const CodecInfo* kVideoMP2TCodecs[] = {&kH264AVC1CodecInfo,
307 }; 307 &kH264AVC3CodecInfo,
308 &kMPEG2TS_MP3CodecInfo1,
309 &kMPEG2TS_MP3CodecInfo2,
310 &kMPEG4AACCodecInfo,
311 &kMPEG2AACLCCodecInfo,
312 NULL};
308 313
309 static StreamParser* BuildMP2TParser(const std::vector<std::string>& codecs, 314 static StreamParser* BuildMP2TParser(const std::vector<std::string>& codecs,
310 const scoped_refptr<MediaLog>& media_log) { 315 const scoped_refptr<MediaLog>& media_log) {
311 bool has_sbr = false; 316 bool has_sbr = false;
312 for (size_t i = 0; i < codecs.size(); ++i) { 317 for (size_t i = 0; i < codecs.size(); ++i) {
313 std::string codec_id = codecs[i]; 318 std::string codec_id = codecs[i];
314 if (base::MatchPattern(codec_id, kMPEG4AACCodecInfo.pattern)) { 319 if (base::MatchPattern(codec_id, kMPEG4AACCodecInfo.pattern)) {
315 int audio_object_type = GetMP4AudioObjectType(codec_id, media_log); 320 int audio_object_type = GetMP4AudioObjectType(codec_id, media_log);
316 if (audio_object_type == kAACSBRObjectType || 321 if (audio_object_type == kAACSBRObjectType ||
317 audio_object_type == kAACPSObjectType) { 322 audio_object_type == kAACPSObjectType) {
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 CodecInfo::HISTOGRAM_MAX + 1); 487 CodecInfo::HISTOGRAM_MAX + 1);
483 } 488 }
484 489
485 stream_parser.reset(factory_function(codecs, media_log)); 490 stream_parser.reset(factory_function(codecs, media_log));
486 } 491 }
487 492
488 return stream_parser; 493 return stream_parser;
489 } 494 }
490 495
491 } // namespace media 496 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698