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

Side by Side 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 5 years, 12 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROMECAST_RENDERER_MEDIA_MEDIA_CHANNEL_PROXY_H_
6 #define CHROMECAST_RENDERER_MEDIA_MEDIA_CHANNEL_PROXY_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "chromecast/media/cma/pipeline/load_type.h"
11 #include "chromecast/renderer/media/cma_message_filter_proxy.h"
12
13 namespace IPC {
14 class Message;
15 }
16
17 namespace chromecast {
18 namespace cma {
gunsch 2014/12/20 22:41:34 chromecast::media
erickung1 2014/12/21 11:10:47 Done.
19
20 // MediaChannelProxy - Manage the lifetime of a CMA ipc channel.
21 // Must be invoked from the IO thread of the renderer process.
22 //
gunsch 2014/12/20 22:41:34 remove line
erickung1 2014/12/21 11:10:47 Done.
23 class MediaChannelProxy
24 : public base::RefCountedThreadSafe<MediaChannelProxy> {
25 public:
26 MediaChannelProxy();
27
28 // Open a CMA ipc channel.
29 void Open(chromecast::media::LoadType load_type);
30
31 // Close the ipc channel.
32 void Close();
33
34 // Return the ID of the CMA ipc channel.
35 // Return a null or negative ID if no channel has been opened.
gunsch 2014/12/20 22:41:34 can't return null, it's an int also, from the cod
erickung1 2014/12/21 11:10:47 Done.
36 int GetId() { return id_; }
37
38 // Manage delegates.
39 bool SetMediaDelegate(
40 const CmaMessageFilterProxy::MediaDelegate& media_delegate);
41 bool SetAudioDelegate(
42 const CmaMessageFilterProxy::AudioDelegate& audio_delegate);
43 bool SetVideoDelegate(
44 const CmaMessageFilterProxy::VideoDelegate& video_delegate);
45
46 // Send an IPC message over this CMA ipc channel.
47 bool Send(scoped_ptr<IPC::Message> message);
48
49 private:
50 friend class base::RefCountedThreadSafe<MediaChannelProxy>;
51 virtual ~MediaChannelProxy();
gunsch 2014/12/20 22:41:34 ~MediaChannelProxy() override;
erickung1 2014/12/21 11:10:47 This has to be virtual or not virtual(too risky) s
52
53 // Message filter running on the renderer side.
54 scoped_refptr<CmaMessageFilterProxy> filter_;
55
56 // Indicate whether the CMA channel is open.
57 bool is_open_;
58
59 // Unique identifier per media pipeline.
60 int id_;
61
62 DISALLOW_COPY_AND_ASSIGN(MediaChannelProxy);
gunsch 2014/12/20 22:41:34 include base/macros.h
erickung1 2014/12/21 11:10:47 Done.
63 };
64
65 } // namespace cma
66 } // namespace chromecast
67
68 #endif // CHROMECAST_RENDERER_MEDIA_MEDIA_CHANNEL_PROXY_H_
69
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698