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

Unified Diff: media/mojo/services/mojo_demuxer_stream_adapter.h

Issue 981423002: Remove mojo::DemuxerStreamObserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/mojo/interfaces/demuxer_stream.mojom ('k') | media/mojo/services/mojo_demuxer_stream_adapter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/services/mojo_demuxer_stream_adapter.h
diff --git a/media/mojo/services/mojo_demuxer_stream_adapter.h b/media/mojo/services/mojo_demuxer_stream_adapter.h
index 9b6ba960d0b12087f3df140ef04afdbe6797cbe6..ee7c64de4b3ca20c4e5b4f17b6b998843d921b63 100644
--- a/media/mojo/services/mojo_demuxer_stream_adapter.h
+++ b/media/mojo/services/mojo_demuxer_stream_adapter.h
@@ -19,13 +19,12 @@ namespace media {
// that is part of a Pipeline in a remote application. Roughly speaking, it
// takes a mojo::DemuxerStreamPtr and exposes it as a DemuxerStream for use by
// media components.
-class MojoDemuxerStreamAdapter : public DemuxerStream,
- public mojo::DemuxerStreamObserver {
+class MojoDemuxerStreamAdapter : public DemuxerStream {
public:
// |demuxer_stream| is connected to the mojo::DemuxerStream that |this| will
// become the client of.
- // |stream_ready_cb| will be invoked when |stream| has fully initialized
- // and |this| is ready for use.
+ // |stream_ready_cb| will be invoked when |demuxer_stream| has fully
+ // initialized and |this| is ready for use.
// NOTE: Illegal to call any methods until |stream_ready_cb| is invoked.
MojoDemuxerStreamAdapter(mojo::DemuxerStreamPtr demuxer_stream,
const base::Closure& stream_ready_cb);
@@ -40,21 +39,24 @@ class MojoDemuxerStreamAdapter : public DemuxerStream,
bool SupportsConfigChanges() override;
VideoRotation video_rotation() override;
- // mojo::DemuxerStreamClient implementation.
- void OnAudioDecoderConfigChanged(mojo::AudioDecoderConfigPtr config) override;
- void OnVideoDecoderConfigChanged(mojo::VideoDecoderConfigPtr config) override;
-
private:
+ void OnStreamReady(mojo::DemuxerStream::Type type,
+ mojo::ScopedDataPipeConsumerHandle pipe,
+ mojo::AudioDecoderConfigPtr audio_config,
+ mojo::VideoDecoderConfigPtr video_config);
+
// The callback from |demuxer_stream_| that a read operation has completed.
// |read_cb| is a callback from the client who invoked Read() on |this|.
void OnBufferReady(mojo::DemuxerStream::Status status,
- mojo::MediaDecoderBufferPtr buffer);
+ mojo::MediaDecoderBufferPtr buffer,
+ mojo::AudioDecoderConfigPtr audio_config,
+ mojo::VideoDecoderConfigPtr video_config);
- void OnStreamReady(mojo::ScopedDataPipeConsumerHandle pipe);
+ void UpdateConfig(mojo::AudioDecoderConfigPtr audio_config,
+ mojo::VideoDecoderConfigPtr video_config);
// See constructor for descriptions.
mojo::DemuxerStreamPtr demuxer_stream_;
- mojo::Binding<DemuxerStreamObserver> binding_;
base::Closure stream_ready_cb_;
// The last ReadCB received through a call to Read().
@@ -64,10 +66,9 @@ class MojoDemuxerStreamAdapter : public DemuxerStream,
// on to the caller of Read() until OnAudioDecoderConfigChanged is observed.
DemuxerStream::ReadCB read_cb_;
- // The front of the queue is the current config. We pop when we observe
- // DemuxerStatus::CONFIG_CHANGED.
- std::queue<AudioDecoderConfig> audio_config_queue_;
- std::queue<VideoDecoderConfig> video_config_queue_;
+ // The current config.
+ AudioDecoderConfig audio_config_;
+ VideoDecoderConfig video_config_;
DemuxerStream::Type type_;
« no previous file with comments | « media/mojo/interfaces/demuxer_stream.mojom ('k') | media/mojo/services/mojo_demuxer_stream_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698