| 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 a89892c20abf90f185782a6efecbaf3e92acfad3..dd1f17c72239579de5b282f24eb3ad2f173eabfd 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.
|
| +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_;
|
| + 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
|
| @@ -94,25 +123,18 @@ class CastSessionDelegate {
|
| media::cast::CastInitializationStatus result) const;
|
|
|
| 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);
|
|
|