Chromium Code Reviews| 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..46344f4d4177945ecba934cfbeab67fb0d0c3704 |
| --- /dev/null |
| +++ b/chromecast/renderer/media/media_channel_proxy.h |
| @@ -0,0 +1,69 @@ |
| +// 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/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 cma { |
|
gunsch
2014/12/20 22:41:34
chromecast::media
erickung1
2014/12/21 11:10:47
Done.
|
| + |
| +// MediaChannelProxy - Manage the lifetime of a CMA ipc channel. |
| +// Must be invoked from the IO thread of the renderer process. |
| +// |
|
gunsch
2014/12/20 22:41:34
remove line
erickung1
2014/12/21 11:10:47
Done.
|
| +class MediaChannelProxy |
| + : public base::RefCountedThreadSafe<MediaChannelProxy> { |
| + public: |
| + MediaChannelProxy(); |
| + |
| + // Open a CMA ipc channel. |
| + void Open(chromecast::media::LoadType load_type); |
| + |
| + // Close the ipc channel. |
| + void Close(); |
| + |
| + // Return the ID of the CMA ipc channel. |
| + // 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.
|
| + int GetId() { return id_; } |
| + |
| + // Manage delegates. |
| + bool SetMediaDelegate( |
| + const CmaMessageFilterProxy::MediaDelegate& media_delegate); |
| + bool SetAudioDelegate( |
| + const CmaMessageFilterProxy::AudioDelegate& audio_delegate); |
| + bool SetVideoDelegate( |
| + const CmaMessageFilterProxy::VideoDelegate& video_delegate); |
| + |
| + // Send an IPC message over this CMA ipc channel. |
| + bool Send(scoped_ptr<IPC::Message> message); |
| + |
| + private: |
| + friend class base::RefCountedThreadSafe<MediaChannelProxy>; |
| + 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
|
| + |
| + // Message filter running on the renderer side. |
| + scoped_refptr<CmaMessageFilterProxy> filter_; |
| + |
| + // Indicate whether the CMA channel is open. |
| + bool is_open_; |
| + |
| + // Unique identifier per media pipeline. |
| + int id_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(MediaChannelProxy); |
|
gunsch
2014/12/20 22:41:34
include base/macros.h
erickung1
2014/12/21 11:10:47
Done.
|
| +}; |
| + |
| +} // namespace cma |
| +} // namespace chromecast |
| + |
| +#endif // CHROMECAST_RENDERER_MEDIA_MEDIA_CHANNEL_PROXY_H_ |
| + |