Chromium Code Reviews| Index: chrome/renderer/media/cast_session_delegate.h |
| diff --git a/chrome/renderer/media/cast_session_delegate.h b/chrome/renderer/media/cast_session_delegate.h |
| index fb0dd09793e166a92575d79ae3cc13b2ea7004ed..75a0ccbdbe7800cb53f5522b0c0281fe55f5d763 100644 |
| --- a/chrome/renderer/media/cast_session_delegate.h |
| +++ b/chrome/renderer/media/cast_session_delegate.h |
| @@ -39,11 +39,42 @@ class CastTransportSender; |
| } // namespace cast |
| } // namespace media |
| +// Breaks out functionality that is common between. |
|
miu
2015/02/11 02:52:50
Please finish this sentence.
hubbe
2015/02/11 22:38:17
Done.
|
| +class CastSessionDelegateBase { |
| + public: |
| + CastSessionDelegateBase(); |
| + virtual ~CastSessionDelegateBase(); |
| + |
| + // This will start the session by configuring and creating the Cast transport |
| + // and the Cast sender. |
| + // Must be called before initialization of audio or video. |
| + void StartUDP(const net::IPEndPoint& local_endpoint, |
| + const net::IPEndPoint& remote_endpoint, |
| + scoped_ptr<base::DictionaryValue> options); |
| + |
| + protected: |
| + void StatusNotificationCB( |
| + media::cast::CastTransportStatus status); |
| + virtual void LogRawEvents( |
| + const std::vector<media::cast::PacketEvent>& packet_events, |
| + const std::vector<media::cast::FrameEvent>& frame_events) = 0; |
| + |
| + base::ThreadChecker thread_checker_; |
| + scoped_refptr<media::cast::CastEnvironment> cast_environment_; |
| + scoped_ptr<media::cast::CastTransportSender> cast_transport_; |
| + |
| + // Proxy to the IO message loop. |
| + scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; |
|
miu
2015/02/11 02:52:50
nit: const scoped_refptr<...>
hubbe
2015/02/11 22:38:17
Done.
|
| + base::WeakPtrFactory<CastSessionDelegateBase> weak_factory_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(CastSessionDelegateBase); |
| +}; |
| + |
| // This class hosts CastSender and connects it to audio/video frame input |
| // and network socket. |
| // This class is created on the render thread and destroyed on the IO |
| // thread. All methods are accessible only on the IO thread. |
| -class CastSessionDelegate { |
| +class CastSessionDelegate : public CastSessionDelegateBase { |
| public: |
| typedef base::Callback<void(const scoped_refptr< |
| media::cast::AudioFrameInput>&)> AudioFrameInputAvailableCallback; |
| @@ -54,12 +85,10 @@ class CastSessionDelegate { |
| typedef base::Callback<void(const std::string&)> ErrorCallback; |
| CastSessionDelegate(); |
| - virtual ~CastSessionDelegate(); |
| + ~CastSessionDelegate() override; |
| - // This will start the session by configuring and creating the Cast transport |
| - // and the Cast sender. |
| - // Must be called before initialization of audio or video. |
| - void StartUDP(const net::IPEndPoint& remote_endpoint, |
| + void StartUDP(const net::IPEndPoint& local_endpoint, |
| + const net::IPEndPoint& remote_endpoint, |
| scoped_ptr<base::DictionaryValue> options); |
| // After calling StartAudio() or StartVideo() encoding of that media will |
| @@ -99,25 +128,18 @@ class CastSessionDelegate { |
| media::cast::OperationalStatus result); |
| private: |
| - void StatusNotificationCB( |
| - media::cast::CastTransportStatus status); |
| - |
| // Adds logs collected from transport on browser side. |
| void LogRawEvents(const std::vector<media::cast::PacketEvent>& packet_events, |
| - const std::vector<media::cast::FrameEvent>& frame_events); |
| + const std::vector<media::cast::FrameEvent>& frame_events) |
| + override; |
| - base::ThreadChecker thread_checker_; |
| - scoped_refptr<media::cast::CastEnvironment> cast_environment_; |
| scoped_ptr<media::cast::CastSender> cast_sender_; |
| - scoped_ptr<media::cast::CastTransportSender> cast_transport_; |
| AudioFrameInputAvailableCallback audio_frame_input_available_callback_; |
| VideoFrameInputAvailableCallback video_frame_input_available_callback_; |
| scoped_ptr<media::cast::RawEventSubscriberBundle> event_subscribers_; |
| - // Proxy to the IO message loop. |
| - scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; |
| base::WeakPtrFactory<CastSessionDelegate> weak_factory_; |
| DISALLOW_COPY_AND_ASSIGN(CastSessionDelegate); |