| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef REMOTING_PROTOCOL_ICE_CONNECTION_TO_CLIENT_H_ | 5 #ifndef REMOTING_PROTOCOL_ICE_CONNECTION_TO_CLIENT_H_ |
| 6 #define REMOTING_PROTOCOL_ICE_CONNECTION_TO_CLIENT_H_ | 6 #define REMOTING_PROTOCOL_ICE_CONNECTION_TO_CLIENT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // host. It sets up all protocol channels and connects them to the | 31 // host. It sets up all protocol channels and connects them to the |
| 32 // stubs. | 32 // stubs. |
| 33 class IceConnectionToClient : public ConnectionToClient, | 33 class IceConnectionToClient : public ConnectionToClient, |
| 34 public Session::EventHandler, | 34 public Session::EventHandler, |
| 35 public IceTransport::EventHandler, | 35 public IceTransport::EventHandler, |
| 36 public ChannelDispatcherBase::EventHandler { | 36 public ChannelDispatcherBase::EventHandler { |
| 37 public: | 37 public: |
| 38 IceConnectionToClient( | 38 IceConnectionToClient( |
| 39 std::unique_ptr<Session> session, | 39 std::unique_ptr<Session> session, |
| 40 scoped_refptr<TransportContext> transport_context, | 40 scoped_refptr<TransportContext> transport_context, |
| 41 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner); | 41 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner, |
| 42 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner); |
| 42 ~IceConnectionToClient() override; | 43 ~IceConnectionToClient() override; |
| 43 | 44 |
| 44 // ConnectionToClient interface. | 45 // ConnectionToClient interface. |
| 45 void SetEventHandler( | 46 void SetEventHandler( |
| 46 ConnectionToClient::EventHandler* event_handler) override; | 47 ConnectionToClient::EventHandler* event_handler) override; |
| 47 Session* session() override; | 48 Session* session() override; |
| 48 void Disconnect(ErrorCode error) override; | 49 void Disconnect(ErrorCode error) override; |
| 49 void OnInputEventReceived(int64_t timestamp) override; | 50 void OnInputEventReceived(int64_t timestamp) override; |
| 50 std::unique_ptr<VideoStream> StartVideoStream( | 51 std::unique_ptr<VideoStream> StartVideoStream( |
| 51 std::unique_ptr<webrtc::DesktopCapturer> desktop_capturer) override; | 52 std::unique_ptr<webrtc::DesktopCapturer> desktop_capturer) override; |
| 52 AudioStub* audio_stub() override; | 53 std::unique_ptr<AudioSendStream> StartAudioStream( |
| 54 std::unique_ptr<AudioSource> audio_source) override; |
| 53 ClientStub* client_stub() override; | 55 ClientStub* client_stub() override; |
| 54 void set_clipboard_stub(ClipboardStub* clipboard_stub) override; | 56 void set_clipboard_stub(ClipboardStub* clipboard_stub) override; |
| 55 void set_host_stub(HostStub* host_stub) override; | 57 void set_host_stub(HostStub* host_stub) override; |
| 56 void set_input_stub(InputStub* input_stub) override; | 58 void set_input_stub(InputStub* input_stub) override; |
| 57 | 59 |
| 58 private: | 60 private: |
| 59 // Session::EventHandler interface. | 61 // Session::EventHandler interface. |
| 60 void OnSessionStateChange(Session::State state) override; | 62 void OnSessionStateChange(Session::State state) override; |
| 61 | 63 |
| 62 // IceTransport::EventHandler interface. | 64 // IceTransport::EventHandler interface. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 73 void CloseChannels(); | 75 void CloseChannels(); |
| 74 | 76 |
| 75 base::ThreadChecker thread_checker_; | 77 base::ThreadChecker thread_checker_; |
| 76 | 78 |
| 77 // Event handler for handling events sent from this object. | 79 // Event handler for handling events sent from this object. |
| 78 ConnectionToClient::EventHandler* event_handler_; | 80 ConnectionToClient::EventHandler* event_handler_; |
| 79 | 81 |
| 80 std::unique_ptr<Session> session_; | 82 std::unique_ptr<Session> session_; |
| 81 | 83 |
| 82 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner_; | 84 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner_; |
| 85 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; |
| 83 | 86 |
| 84 IceTransport transport_; | 87 IceTransport transport_; |
| 85 | 88 |
| 86 std::unique_ptr<HostControlDispatcher> control_dispatcher_; | 89 std::unique_ptr<HostControlDispatcher> control_dispatcher_; |
| 87 std::unique_ptr<HostEventDispatcher> event_dispatcher_; | 90 std::unique_ptr<HostEventDispatcher> event_dispatcher_; |
| 88 std::unique_ptr<HostVideoDispatcher> video_dispatcher_; | 91 std::unique_ptr<HostVideoDispatcher> video_dispatcher_; |
| 89 std::unique_ptr<AudioWriter> audio_writer_; | 92 std::unique_ptr<AudioWriter> audio_writer_; |
| 90 | 93 |
| 91 DISALLOW_COPY_AND_ASSIGN(IceConnectionToClient); | 94 DISALLOW_COPY_AND_ASSIGN(IceConnectionToClient); |
| 92 }; | 95 }; |
| 93 | 96 |
| 94 } // namespace protocol | 97 } // namespace protocol |
| 95 } // namespace remoting | 98 } // namespace remoting |
| 96 | 99 |
| 97 #endif // REMOTING_PROTOCOL_ICE_CONNECTION_TO_CLIENT_H_ | 100 #endif // REMOTING_PROTOCOL_ICE_CONNECTION_TO_CLIENT_H_ |
| OLD | NEW |