Index: media/filters/chunk_demuxer.cc |
diff --git a/media/filters/chunk_demuxer.cc b/media/filters/chunk_demuxer.cc |
index 1302aa531a87e405aafd14d75a96ae3bf1001e48..47b41b14e8d6cdd91f4d6cb931b4c5fa4c604236 100644 |
--- a/media/filters/chunk_demuxer.cc |
+++ b/media/filters/chunk_demuxer.cc |
@@ -308,7 +308,7 @@ void ChunkDemuxerStream::set_enabled(bool enabled, base::TimeDelta timestamp) { |
StreamParserBuffer::CreateEOSBuffer()); |
} |
if (!stream_status_change_cb_.is_null()) |
- stream_status_change_cb_.Run(is_enabled_, timestamp); |
+ stream_status_change_cb_.Run(this, is_enabled_, timestamp); |
} |
void ChunkDemuxerStream::SetStreamStatusChangeCB( |
@@ -491,26 +491,25 @@ base::Time ChunkDemuxer::GetTimelineOffset() const { |
return timeline_offset_; |
} |
-DemuxerStream* ChunkDemuxer::GetStream(DemuxerStream::Type type) { |
- DCHECK_NE(type, DemuxerStream::TEXT); |
+std::vector<DemuxerStream*> ChunkDemuxer::GetStreams() { |
base::AutoLock auto_lock(lock_); |
- // TODO(servolk): For now return only the first enabled audio/video stream, |
- // since this GetStream method is part of the implementation of the |
- // DemuxerStreamProvider interface that is used in many places and can't be |
- // changed easily. It will be fixed later, when we add support for multiple |
- // streams/tracks in DemuxerStreamProvider, tracked by crbug.com/646669 |
- if (type == DemuxerStream::AUDIO) |
- for (const auto& s : audio_streams_) |
- if (s->enabled()) |
- return s.get(); |
+ std::vector<DemuxerStream*> result; |
+ for (const auto& stream : audio_streams_) |
+ result.push_back(stream.get()); |
- if (type == DemuxerStream::VIDEO) |
- for (const auto& s : video_streams_) |
- if (s->enabled()) |
- return s.get(); |
+ for (const auto& stream : video_streams_) |
+ result.push_back(stream.get()); |
+ |
+ return result; |
+} |
- return NULL; |
+void ChunkDemuxer::SetStreamStatusChangeCB(const StreamStatusChangeCB& cb) { |
+ DCHECK(!cb.is_null()); |
+ for (const auto& s : audio_streams_) |
+ s->SetStreamStatusChangeCB(cb); |
+ for (const auto& s : video_streams_) |
+ s->SetStreamStatusChangeCB(cb); |
} |
TimeDelta ChunkDemuxer::GetStartTime() const { |