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

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

Issue 551963004: media: scaffolding and plumbing for MojoRenderer{Impl, Service} (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: public_deps Created 6 years, 3 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/mojo_demuxer_stream_adapter.cc ('k') | media/mojo/services/mojo_demuxer_stream_impl.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_impl.h
diff --git a/media/mojo/services/mojo_demuxer_stream_impl.h b/media/mojo/services/mojo_demuxer_stream_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..62dbfd2085bb57ed4e6b5a6d62ef672646fd2b73
--- /dev/null
+++ b/media/mojo/services/mojo_demuxer_stream_impl.h
@@ -0,0 +1,53 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_MOJO_SERVICES_MOJO_DEMUXER_STREAM_IMPL_H_
+#define MEDIA_MOJO_SERVICES_MOJO_DEMUXER_STREAM_IMPL_H_
+
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "media/base/demuxer_stream.h"
+#include "media/mojo/interfaces/demuxer_stream.mojom.h"
+#include "mojo/public/cpp/bindings/interface_impl.h"
+
+namespace media {
+class DemuxerStream;
+
+// This class wraps a media::DemuxerStream and exposes it as a
+// mojo::DemuxerStream for use as a proxy from remote applications.
+class MojoDemuxerStreamImpl : public mojo::InterfaceImpl<mojo::DemuxerStream> {
+ public:
+ // |stream| is the underlying DemuxerStream we are proxying for.
+ // Note: |this| does not take ownership of |stream|.
+ explicit MojoDemuxerStreamImpl(media::DemuxerStream* stream);
+ virtual ~MojoDemuxerStreamImpl();
+
+ // mojo::DemuxerStream implementation.
+ virtual void Read(const mojo::Callback<
+ void(mojo::DemuxerStream::Status, mojo::MediaDecoderBufferPtr)>& callback)
+ OVERRIDE;
+
+ // mojo::InterfaceImpl overrides.
+ virtual void OnConnectionEstablished() OVERRIDE;
+
+ private:
+ // |callback| is the callback that was passed to the initiating Read()
+ // call by our client.
+ // |status| and |buffer| are the standard media::ReadCB parameters.
+ typedef mojo::Callback<void(mojo::DemuxerStream::Status,
+ mojo::MediaDecoderBufferPtr)> BufferReadyCB;
+ void OnBufferReady(const BufferReadyCB& callback,
+ media::DemuxerStream::Status status,
+ const scoped_refptr<media::DecoderBuffer>& buffer);
+
+ // See constructor. We do not own |stream_|.
+ media::DemuxerStream* stream_;
+
+ base::WeakPtrFactory<MojoDemuxerStreamImpl> weak_factory_;
+ DISALLOW_COPY_AND_ASSIGN(MojoDemuxerStreamImpl);
+};
+
+} // namespace media
+
+#endif // MEDIA_MOJO_SERVICES_MOJO_DEMUXER_STREAM_IMPL_H_
« no previous file with comments | « media/mojo/services/mojo_demuxer_stream_adapter.cc ('k') | media/mojo/services/mojo_demuxer_stream_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698