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

Unified Diff: media/mojo/services/media_resource_shim.cc

Issue 2667283002: Refactor MediaResource to be multi-stream capable (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/mojo/services/media_resource_shim.h ('k') | media/mojo/services/mojo_demuxer_stream_adapter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/services/media_resource_shim.cc
diff --git a/media/mojo/services/media_resource_shim.cc b/media/mojo/services/media_resource_shim.cc
index 2d178922e888cdaedee03bcf2278be7ac53f6fa7..fb984103ebc047baf1f778d3390d03954c10277e 100644
--- a/media/mojo/services/media_resource_shim.cc
+++ b/media/mojo/services/media_resource_shim.cc
@@ -30,16 +30,17 @@ MediaResourceShim::MediaResourceShim(
MediaResourceShim::~MediaResourceShim() {}
-// This function returns only the first stream of the given |type| for now.
-// TODO(servolk): Make this work with multiple streams.
-DemuxerStream* MediaResourceShim::GetStream(DemuxerStream::Type type) {
+std::vector<DemuxerStream*> MediaResourceShim::GetStreams() {
DCHECK(demuxer_ready_cb_.is_null());
- for (auto& stream : streams_) {
- if (stream->type() == type)
- return stream.get();
- }
+ std::vector<DemuxerStream*> result;
+ for (auto& stream : streams_)
+ result.push_back(stream.get());
+ return result;
+}
- return nullptr;
+void MediaResourceShim::SetStreamStatusChangeCB(
+ const StreamStatusChangeCB& cb) {
+ NOTIMPLEMENTED();
}
void MediaResourceShim::OnStreamReady() {
« no previous file with comments | « media/mojo/services/media_resource_shim.h ('k') | media/mojo/services/mojo_demuxer_stream_adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698