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_HOST_H_ | 5 #ifndef REMOTING_PROTOCOL_ICE_CONNECTION_TO_HOST_H_ |
6 #define REMOTING_PROTOCOL_ICE_CONNECTION_TO_HOST_H_ | 6 #define REMOTING_PROTOCOL_ICE_CONNECTION_TO_HOST_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/threading/non_thread_safe.h" | 15 #include "base/threading/non_thread_safe.h" |
16 #include "remoting/proto/internal.pb.h" | 16 #include "remoting/proto/internal.pb.h" |
17 #include "remoting/protocol/channel_dispatcher_base.h" | 17 #include "remoting/protocol/channel_dispatcher_base.h" |
18 #include "remoting/protocol/clipboard_filter.h" | 18 #include "remoting/protocol/clipboard_filter.h" |
19 #include "remoting/protocol/connection_to_host.h" | 19 #include "remoting/protocol/connection_to_host.h" |
20 #include "remoting/protocol/errors.h" | 20 #include "remoting/protocol/errors.h" |
21 #include "remoting/protocol/ice_transport.h" | 21 #include "remoting/protocol/ice_transport.h" |
22 #include "remoting/protocol/input_filter.h" | 22 #include "remoting/protocol/input_filter.h" |
23 #include "remoting/protocol/monitored_video_stub.h" | 23 #include "remoting/protocol/monitored_video_stub.h" |
24 #include "remoting/protocol/session.h" | 24 #include "remoting/protocol/session.h" |
25 #include "remoting/protocol/session_config.h" | 25 #include "remoting/protocol/session_config.h" |
26 | 26 |
27 namespace remoting { | 27 namespace remoting { |
28 namespace protocol { | 28 namespace protocol { |
29 | 29 |
| 30 class AudioDecodeScheduler; |
30 class AudioReader; | 31 class AudioReader; |
31 class ClientControlDispatcher; | 32 class ClientControlDispatcher; |
32 class ClientEventDispatcher; | 33 class ClientEventDispatcher; |
33 class ClientVideoDispatcher; | 34 class ClientVideoDispatcher; |
34 | 35 |
35 class IceConnectionToHost : public ConnectionToHost, | 36 class IceConnectionToHost : public ConnectionToHost, |
36 public Session::EventHandler, | 37 public Session::EventHandler, |
37 public IceTransport::EventHandler, | 38 public IceTransport::EventHandler, |
38 public ChannelDispatcherBase::EventHandler, | 39 public ChannelDispatcherBase::EventHandler, |
39 public base::NonThreadSafe { | 40 public base::NonThreadSafe { |
40 public: | 41 public: |
41 IceConnectionToHost(); | 42 IceConnectionToHost(); |
42 ~IceConnectionToHost() override; | 43 ~IceConnectionToHost() override; |
43 | 44 |
44 // ConnectionToHost interface. | 45 // ConnectionToHost interface. |
45 void set_client_stub(ClientStub* client_stub) override; | 46 void set_client_stub(ClientStub* client_stub) override; |
46 void set_clipboard_stub(ClipboardStub* clipboard_stub) override; | 47 void set_clipboard_stub(ClipboardStub* clipboard_stub) override; |
47 void set_video_renderer(VideoRenderer* video_renderer) override; | 48 void set_video_renderer(VideoRenderer* video_renderer) override; |
48 void set_audio_stub(AudioStub* audio_stub) override; | 49 void InitializeAudio( |
| 50 scoped_refptr<base::SingleThreadTaskRunner> audio_decode_task_runner, |
| 51 base::WeakPtr<AudioStub> audio_stub) override; |
49 void Connect(std::unique_ptr<Session> session, | 52 void Connect(std::unique_ptr<Session> session, |
50 scoped_refptr<TransportContext> transport_context, | 53 scoped_refptr<TransportContext> transport_context, |
51 HostEventCallback* event_callback) override; | 54 HostEventCallback* event_callback) override; |
52 const SessionConfig& config() override; | 55 const SessionConfig& config() override; |
53 ClipboardStub* clipboard_forwarder() override; | 56 ClipboardStub* clipboard_forwarder() override; |
54 HostStub* host_stub() override; | 57 HostStub* host_stub() override; |
55 InputStub* input_stub() override; | 58 InputStub* input_stub() override; |
56 State state() const override; | 59 State state() const override; |
57 | 60 |
58 private: | 61 private: |
(...skipping 18 matching lines...) Expand all Loading... |
77 void CloseChannels(); | 80 void CloseChannels(); |
78 | 81 |
79 void SetState(State state, ErrorCode error); | 82 void SetState(State state, ErrorCode error); |
80 | 83 |
81 HostEventCallback* event_callback_ = nullptr; | 84 HostEventCallback* event_callback_ = nullptr; |
82 | 85 |
83 // Stub for incoming messages. | 86 // Stub for incoming messages. |
84 ClientStub* client_stub_ = nullptr; | 87 ClientStub* client_stub_ = nullptr; |
85 ClipboardStub* clipboard_stub_ = nullptr; | 88 ClipboardStub* clipboard_stub_ = nullptr; |
86 VideoRenderer* video_renderer_ = nullptr; | 89 VideoRenderer* video_renderer_ = nullptr; |
87 AudioStub* audio_stub_ = nullptr; | 90 |
| 91 std::unique_ptr<AudioDecodeScheduler> audio_decode_scheduler_; |
88 | 92 |
89 std::unique_ptr<Session> session_; | 93 std::unique_ptr<Session> session_; |
90 std::unique_ptr<IceTransport> transport_; | 94 std::unique_ptr<IceTransport> transport_; |
91 | 95 |
92 std::unique_ptr<MonitoredVideoStub> monitored_video_stub_; | 96 std::unique_ptr<MonitoredVideoStub> monitored_video_stub_; |
93 std::unique_ptr<ClientVideoDispatcher> video_dispatcher_; | 97 std::unique_ptr<ClientVideoDispatcher> video_dispatcher_; |
94 std::unique_ptr<AudioReader> audio_reader_; | 98 std::unique_ptr<AudioReader> audio_reader_; |
95 std::unique_ptr<ClientControlDispatcher> control_dispatcher_; | 99 std::unique_ptr<ClientControlDispatcher> control_dispatcher_; |
96 std::unique_ptr<ClientEventDispatcher> event_dispatcher_; | 100 std::unique_ptr<ClientEventDispatcher> event_dispatcher_; |
97 ClipboardFilter clipboard_forwarder_; | 101 ClipboardFilter clipboard_forwarder_; |
98 InputFilter event_forwarder_; | 102 InputFilter event_forwarder_; |
99 | 103 |
100 // Internal state of the connection. | 104 // Internal state of the connection. |
101 State state_ = INITIALIZING; | 105 State state_ = INITIALIZING; |
102 ErrorCode error_ = OK; | 106 ErrorCode error_ = OK; |
103 | 107 |
104 private: | 108 private: |
105 DISALLOW_COPY_AND_ASSIGN(IceConnectionToHost); | 109 DISALLOW_COPY_AND_ASSIGN(IceConnectionToHost); |
106 }; | 110 }; |
107 | 111 |
108 } // namespace protocol | 112 } // namespace protocol |
109 } // namespace remoting | 113 } // namespace remoting |
110 | 114 |
111 #endif // REMOTING_PROTOCOL_ICE_CONNECTION_TO_HOST_H_ | 115 #endif // REMOTING_PROTOCOL_ICE_CONNECTION_TO_HOST_H_ |
OLD | NEW |