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

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

Issue 2773793002: Allow mp3 audio codec for mpeg2ts containers in MSE (Closed)
Patch Set: CR feedback Created 3 years, 8 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
« no previous file with comments | « media/base/audio_codecs.cc ('k') | media/filters/stream_parser_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "media/filters/chunk_demuxer.h" 5 #include "media/filters/chunk_demuxer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 597
598 if ((state_ != WAITING_FOR_INIT && state_ != INITIALIZING) || IsValidId(id)) 598 if ((state_ != WAITING_FOR_INIT && state_ != INITIALIZING) || IsValidId(id))
599 return kReachedIdLimit; 599 return kReachedIdLimit;
600 600
601 std::vector<std::string> parsed_codec_ids; 601 std::vector<std::string> parsed_codec_ids;
602 media::SplitCodecsToVector(codecs, &parsed_codec_ids, false); 602 media::SplitCodecsToVector(codecs, &parsed_codec_ids, false);
603 603
604 std::unique_ptr<media::StreamParser> stream_parser( 604 std::unique_ptr<media::StreamParser> stream_parser(
605 StreamParserFactory::Create(type, parsed_codec_ids, media_log_)); 605 StreamParserFactory::Create(type, parsed_codec_ids, media_log_));
606 606
607 if (!stream_parser) 607 if (!stream_parser) {
608 DVLOG(1) << __func__ << " failed: unsupported mime_type=" << type
609 << " codecs=" << codecs;
608 return ChunkDemuxer::kNotSupported; 610 return ChunkDemuxer::kNotSupported;
611 }
609 612
610 std::unique_ptr<FrameProcessor> frame_processor( 613 std::unique_ptr<FrameProcessor> frame_processor(
611 new FrameProcessor(base::Bind(&ChunkDemuxer::IncreaseDurationIfNecessary, 614 new FrameProcessor(base::Bind(&ChunkDemuxer::IncreaseDurationIfNecessary,
612 base::Unretained(this)), 615 base::Unretained(this)),
613 media_log_)); 616 media_log_));
614 617
615 std::unique_ptr<SourceBufferState> source_state(new SourceBufferState( 618 std::unique_ptr<SourceBufferState> source_state(new SourceBufferState(
616 std::move(stream_parser), std::move(frame_processor), 619 std::move(stream_parser), std::move(frame_processor),
617 base::Bind(&ChunkDemuxer::CreateDemuxerStream, base::Unretained(this), 620 base::Bind(&ChunkDemuxer::CreateDemuxerStream, base::Unretained(this),
618 id), 621 id),
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
1339 } 1342 }
1340 1343
1341 void ChunkDemuxer::ShutdownAllStreams() { 1344 void ChunkDemuxer::ShutdownAllStreams() {
1342 for (auto itr = source_state_map_.begin(); itr != source_state_map_.end(); 1345 for (auto itr = source_state_map_.begin(); itr != source_state_map_.end();
1343 ++itr) { 1346 ++itr) {
1344 itr->second->Shutdown(); 1347 itr->second->Shutdown();
1345 } 1348 }
1346 } 1349 }
1347 1350
1348 } // namespace media 1351 } // namespace media
OLDNEW
« no previous file with comments | « media/base/audio_codecs.cc ('k') | media/filters/stream_parser_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698