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_WEBRTC_TRANSPORT_H_ | 5 #ifndef REMOTING_PROTOCOL_WEBRTC_TRANSPORT_H_ |
6 #define REMOTING_PROTOCOL_WEBRTC_TRANSPORT_H_ | 6 #define REMOTING_PROTOCOL_WEBRTC_TRANSPORT_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 WebrtcTransport(rtc::Thread* worker_thread, | 64 WebrtcTransport(rtc::Thread* worker_thread, |
65 scoped_refptr<TransportContext> transport_context, | 65 scoped_refptr<TransportContext> transport_context, |
66 EventHandler* event_handler); | 66 EventHandler* event_handler); |
67 ~WebrtcTransport() override; | 67 ~WebrtcTransport() override; |
68 | 68 |
69 webrtc::PeerConnectionInterface* peer_connection(); | 69 webrtc::PeerConnectionInterface* peer_connection(); |
70 webrtc::PeerConnectionFactoryInterface* peer_connection_factory(); | 70 webrtc::PeerConnectionFactoryInterface* peer_connection_factory(); |
71 WebrtcDummyVideoEncoderFactory* video_encoder_factory() { | 71 WebrtcDummyVideoEncoderFactory* video_encoder_factory() { |
72 return video_encoder_factory_; | 72 return video_encoder_factory_; |
73 } | 73 } |
| 74 WebrtcAudioModule* audio_module(); |
74 | 75 |
75 // Creates outgoing data channel. The channel is created in CONNECTING state. | 76 // Creates outgoing data channel. The channel is created in CONNECTING state. |
76 // The caller must wait for OnMessagePipeOpen() notification before sending | 77 // The caller must wait for OnMessagePipeOpen() notification before sending |
77 // any messages. | 78 // any messages. |
78 std::unique_ptr<MessagePipe> CreateOutgoingChannel(const std::string& name); | 79 std::unique_ptr<MessagePipe> CreateOutgoingChannel(const std::string& name); |
79 | 80 |
80 // Transport interface. | 81 // Transport interface. |
81 void Start(Authenticator* authenticator, | 82 void Start(Authenticator* authenticator, |
82 SendTransportInfoCallback send_transport_info_callback) override; | 83 SendTransportInfoCallback send_transport_info_callback) override; |
83 bool ProcessTransportInfo(buzz::XmlElement* transport_info) override; | 84 bool ProcessTransportInfo(buzz::XmlElement* transport_info) override; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 void OnIceCandidate(const webrtc::IceCandidateInterface* candidate); | 117 void OnIceCandidate(const webrtc::IceCandidateInterface* candidate); |
117 | 118 |
118 void RequestNegotiation(); | 119 void RequestNegotiation(); |
119 void SendOffer(); | 120 void SendOffer(); |
120 void EnsurePendingTransportInfoMessage(); | 121 void EnsurePendingTransportInfoMessage(); |
121 void SendTransportInfo(); | 122 void SendTransportInfo(); |
122 void AddPendingCandidatesIfPossible(); | 123 void AddPendingCandidatesIfPossible(); |
123 | 124 |
124 base::ThreadChecker thread_checker_; | 125 base::ThreadChecker thread_checker_; |
125 | 126 |
126 rtc::Thread* worker_thread_; | |
127 scoped_refptr<TransportContext> transport_context_; | 127 scoped_refptr<TransportContext> transport_context_; |
128 EventHandler* event_handler_ = nullptr; | 128 EventHandler* event_handler_ = nullptr; |
129 SendTransportInfoCallback send_transport_info_callback_; | 129 SendTransportInfoCallback send_transport_info_callback_; |
130 | 130 |
131 crypto::HMAC handshake_hmac_; | 131 crypto::HMAC handshake_hmac_; |
132 | 132 |
133 std::unique_ptr<PeerConnectionWrapper> peer_connection_wrapper_; | 133 std::unique_ptr<PeerConnectionWrapper> peer_connection_wrapper_; |
134 | 134 |
135 WebrtcDummyVideoEncoderFactory* video_encoder_factory_; | 135 WebrtcDummyVideoEncoderFactory* video_encoder_factory_; |
136 | 136 |
137 bool negotiation_pending_ = false; | 137 bool negotiation_pending_ = false; |
138 | 138 |
139 bool connected_ = false; | 139 bool connected_ = false; |
140 | 140 |
141 std::unique_ptr<buzz::XmlElement> pending_transport_info_message_; | 141 std::unique_ptr<buzz::XmlElement> pending_transport_info_message_; |
142 base::OneShotTimer transport_info_timer_; | 142 base::OneShotTimer transport_info_timer_; |
143 | 143 |
144 ScopedVector<webrtc::IceCandidateInterface> pending_incoming_candidates_; | 144 ScopedVector<webrtc::IceCandidateInterface> pending_incoming_candidates_; |
145 | 145 |
146 base::WeakPtrFactory<WebrtcTransport> weak_factory_; | 146 base::WeakPtrFactory<WebrtcTransport> weak_factory_; |
147 | 147 |
148 DISALLOW_COPY_AND_ASSIGN(WebrtcTransport); | 148 DISALLOW_COPY_AND_ASSIGN(WebrtcTransport); |
149 }; | 149 }; |
150 | 150 |
151 } // namespace protocol | 151 } // namespace protocol |
152 } // namespace remoting | 152 } // namespace remoting |
153 | 153 |
154 #endif // REMOTING_PROTOCOL_WEBRTC_TRANSPORT_H_ | 154 #endif // REMOTING_PROTOCOL_WEBRTC_TRANSPORT_H_ |
OLD | NEW |