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

Unified Diff: chromecast/renderer/media/media_channel_proxy.h

Issue 814403002: [Chromecast] Add CmaMediaRendererFactory and IPC proxy components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
Index: chromecast/renderer/media/media_channel_proxy.h
diff --git a/chromecast/renderer/media/media_channel_proxy.h b/chromecast/renderer/media/media_channel_proxy.h
new file mode 100644
index 0000000000000000000000000000000000000000..c7c46965bf66b68109e66784a66d80450b9c7eca
--- /dev/null
+++ b/chromecast/renderer/media/media_channel_proxy.h
@@ -0,0 +1,68 @@
+// 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 CHROMECAST_RENDERER_MEDIA_MEDIA_CHANNEL_PROXY_H_
+#define CHROMECAST_RENDERER_MEDIA_MEDIA_CHANNEL_PROXY_H_
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "chromecast/media/cma/pipeline/load_type.h"
+#include "chromecast/renderer/media/cma_message_filter_proxy.h"
+
+namespace IPC {
+class Message;
+}
+
+namespace chromecast {
+namespace media {
+
+// MediaChannelProxy - Manage the lifetime of a CMA ipc channel.
+// Must be invoked from the IO thread of the renderer process.
+class MediaChannelProxy
+ : public base::RefCountedThreadSafe<MediaChannelProxy> {
+ public:
+ MediaChannelProxy();
+
+ // Opens a CMA ipc channel.
+ void Open(LoadType load_type);
+
+ // Closes the ipc channel.
+ void Close();
+
+ // Returns the ID of the CMA ipc channel.
+ // Returns 0 or negative ID if no channel has been opened.
+ int GetId() { return id_; }
+
+ // Manages delegates.
+ bool SetMediaDelegate(
+ const CmaMessageFilterProxy::MediaDelegate& media_delegate);
+ bool SetAudioDelegate(
+ const CmaMessageFilterProxy::AudioDelegate& audio_delegate);
+ bool SetVideoDelegate(
+ const CmaMessageFilterProxy::VideoDelegate& video_delegate);
+
+ // Sends an IPC message over this CMA ipc channel.
+ bool Send(scoped_ptr<IPC::Message> message);
+
+ private:
+ friend class base::RefCountedThreadSafe<MediaChannelProxy>;
+ virtual ~MediaChannelProxy();
+
+ // Message filter running on the renderer side.
+ scoped_refptr<CmaMessageFilterProxy> filter_;
+
+ // Indicates whether the CMA channel is open.
+ bool is_open_;
+
+ // Unique identifier per media pipeline.
+ int id_;
+
+ DISALLOW_COPY_AND_ASSIGN(MediaChannelProxy);
+};
+
+} // namespace media
+} // namespace chromecast
+
+#endif // CHROMECAST_RENDERER_MEDIA_MEDIA_CHANNEL_PROXY_H_
« no previous file with comments | « chromecast/renderer/media/cma_message_filter_proxy.cc ('k') | chromecast/renderer/media/media_channel_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698