OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2004 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // If |srtp_required| is true, the channel will not send or receive any | 79 // If |srtp_required| is true, the channel will not send or receive any |
80 // RTP/RTCP packets without using SRTP (either using SDES or DTLS-SRTP). | 80 // RTP/RTCP packets without using SRTP (either using SDES or DTLS-SRTP). |
81 BaseChannel(rtc::Thread* worker_thread, | 81 BaseChannel(rtc::Thread* worker_thread, |
82 rtc::Thread* network_thread, | 82 rtc::Thread* network_thread, |
83 rtc::Thread* signaling_thread, | 83 rtc::Thread* signaling_thread, |
84 MediaChannel* channel, | 84 MediaChannel* channel, |
85 const std::string& content_name, | 85 const std::string& content_name, |
86 bool rtcp_mux_required, | 86 bool rtcp_mux_required, |
87 bool srtp_required); | 87 bool srtp_required); |
88 virtual ~BaseChannel(); | 88 virtual ~BaseChannel(); |
89 bool Init_w(TransportChannel* rtp_transport, | 89 bool Init_w(DtlsTransportInternal* rtp_dtls_transport, |
90 TransportChannel* rtcp_transport); | 90 DtlsTransportInternal* rtcp_dtls_transport); |
91 // Deinit may be called multiple times and is simply ignored if it's already | 91 // Deinit may be called multiple times and is simply ignored if it's already |
92 // done. | 92 // done. |
93 void Deinit(); | 93 void Deinit(); |
94 | 94 |
95 rtc::Thread* worker_thread() const { return worker_thread_; } | 95 rtc::Thread* worker_thread() const { return worker_thread_; } |
96 rtc::Thread* network_thread() const { return network_thread_; } | 96 rtc::Thread* network_thread() const { return network_thread_; } |
97 const std::string& content_name() const { return content_name_; } | 97 const std::string& content_name() const { return content_name_; } |
98 const std::string& transport_name() const { return transport_name_; } | 98 const std::string& transport_name() const { return transport_name_; } |
99 bool enabled() const { return enabled_; } | 99 bool enabled() const { return enabled_; } |
100 | 100 |
101 // This function returns true if we are using SRTP. | 101 // This function returns true if we are using SRTP. |
102 bool secure() const { return srtp_filter_.IsActive(); } | 102 bool secure() const { return srtp_filter_.IsActive(); } |
103 // The following function returns true if we are using | 103 // The following function returns true if we are using |
104 // DTLS-based keying. If you turned off SRTP later, however | 104 // DTLS-based keying. If you turned off SRTP later, however |
105 // you could have secure() == false and dtls_secure() == true. | 105 // you could have secure() == false and dtls_secure() == true. |
106 bool secure_dtls() const { return dtls_keyed_; } | 106 bool secure_dtls() const { return dtls_keyed_; } |
107 | 107 |
108 bool writable() const { return writable_; } | 108 bool writable() const { return writable_; } |
109 | 109 |
110 // Set the transport(s), and update writability and "ready-to-send" state. | 110 // Set the transport(s), and update writability and "ready-to-send" state. |
111 // |rtp_transport| must be non-null. | 111 // |rtp_transport| must be non-null. |
112 // |rtcp_transport| must be supplied if NeedsRtcpTransport() is true (meaning | 112 // |rtcp_transport| must be supplied if NeedsRtcpTransport() is true (meaning |
113 // RTCP muxing is not fully active yet). | 113 // RTCP muxing is not fully active yet). |
114 // |rtp_transport| and |rtcp_transport| must share the same transport name as | 114 // |rtp_transport| and |rtcp_transport| must share the same transport name as |
115 // well. | 115 // well. |
116 void SetTransports(TransportChannel* rtp_transport, | 116 void SetTransports(DtlsTransportInternal* rtp_dtls_transport, |
117 TransportChannel* rtcp_transport); | 117 DtlsTransportInternal* rtcp_dtls_transport); |
118 bool PushdownLocalDescription(const SessionDescription* local_desc, | 118 bool PushdownLocalDescription(const SessionDescription* local_desc, |
119 ContentAction action, | 119 ContentAction action, |
120 std::string* error_desc); | 120 std::string* error_desc); |
121 bool PushdownRemoteDescription(const SessionDescription* remote_desc, | 121 bool PushdownRemoteDescription(const SessionDescription* remote_desc, |
122 ContentAction action, | 122 ContentAction action, |
123 std::string* error_desc); | 123 std::string* error_desc); |
124 // Channel control | 124 // Channel control |
125 bool SetLocalContent(const MediaContentDescription* content, | 125 bool SetLocalContent(const MediaContentDescription* content, |
126 ContentAction action, | 126 ContentAction action, |
127 std::string* error_desc); | 127 std::string* error_desc); |
(...skipping 24 matching lines...) Expand all Loading... |
152 return remote_streams_; | 152 return remote_streams_; |
153 } | 153 } |
154 | 154 |
155 sigslot::signal2<BaseChannel*, bool> SignalDtlsSrtpSetupFailure; | 155 sigslot::signal2<BaseChannel*, bool> SignalDtlsSrtpSetupFailure; |
156 void SignalDtlsSrtpSetupFailure_n(bool rtcp); | 156 void SignalDtlsSrtpSetupFailure_n(bool rtcp); |
157 void SignalDtlsSrtpSetupFailure_s(bool rtcp); | 157 void SignalDtlsSrtpSetupFailure_s(bool rtcp); |
158 | 158 |
159 // Used for latency measurements. | 159 // Used for latency measurements. |
160 sigslot::signal1<BaseChannel*> SignalFirstPacketReceived; | 160 sigslot::signal1<BaseChannel*> SignalFirstPacketReceived; |
161 | 161 |
162 // Forward TransportChannel SignalSentPacket to worker thread. | 162 // Forward SignalSentPacket to worker thread. |
163 sigslot::signal1<const rtc::SentPacket&> SignalSentPacket; | 163 sigslot::signal1<const rtc::SentPacket&> SignalSentPacket; |
164 | 164 |
165 // Emitted whenever rtcp-mux is fully negotiated and the rtcp-transport can | 165 // Emitted whenever rtcp-mux is fully negotiated and the rtcp-transport can |
166 // be destroyed. | 166 // be destroyed. |
167 // Fired on the network thread. | 167 // Fired on the network thread. |
168 sigslot::signal1<const std::string&> SignalRtcpMuxFullyActive; | 168 sigslot::signal1<const std::string&> SignalRtcpMuxFullyActive; |
169 | 169 |
170 TransportChannel* rtp_transport() const { return rtp_transport_; } | 170 // Only public for unit tests. Otherwise, consider private. |
171 TransportChannel* rtcp_transport() const { return rtcp_transport_; } | 171 DtlsTransportInternal* rtp_dtls_transport() const { |
| 172 return rtp_dtls_transport_; |
| 173 } |
| 174 DtlsTransportInternal* rtcp_dtls_transport() const { |
| 175 return rtcp_dtls_transport_; |
| 176 } |
172 | 177 |
173 bool NeedsRtcpTransport(); | 178 bool NeedsRtcpTransport(); |
174 | 179 |
175 // Made public for easier testing. | 180 // Made public for easier testing. |
176 // | 181 // |
177 // Updates "ready to send" for an individual channel, and informs the media | 182 // Updates "ready to send" for an individual channel, and informs the media |
178 // channel that the transport is ready to send if each channel (in use) is | 183 // channel that the transport is ready to send if each channel (in use) is |
179 // ready to send. This is more specific than just "writable"; it means the | 184 // ready to send. This is more specific than just "writable"; it means the |
180 // last send didn't return ENOTCONN. | 185 // last send didn't return ENOTCONN. |
181 // | 186 // |
(...skipping 11 matching lines...) Expand all Loading... |
193 virtual cricket::MediaType media_type() = 0; | 198 virtual cricket::MediaType media_type() = 0; |
194 | 199 |
195 bool SetCryptoOptions(const rtc::CryptoOptions& crypto_options); | 200 bool SetCryptoOptions(const rtc::CryptoOptions& crypto_options); |
196 | 201 |
197 // This function returns true if we require SRTP for call setup. | 202 // This function returns true if we require SRTP for call setup. |
198 bool srtp_required_for_testing() const { return srtp_required_; } | 203 bool srtp_required_for_testing() const { return srtp_required_; } |
199 | 204 |
200 protected: | 205 protected: |
201 virtual MediaChannel* media_channel() const { return media_channel_; } | 206 virtual MediaChannel* media_channel() const { return media_channel_; } |
202 | 207 |
203 void SetTransports_n(TransportChannel* rtp_transport, | 208 void SetTransports_n(DtlsTransportInternal* rtp_dtls_transport, |
204 TransportChannel* rtcp_transport); | 209 DtlsTransportInternal* rtcp_dtls_transport); |
205 | 210 |
206 // This does not update writability or "ready-to-send" state; it just | 211 // This does not update writability or "ready-to-send" state; it just |
207 // disconnects from the old channel and connects to the new one. | 212 // disconnects from the old channel and connects to the new one. |
208 void SetTransportChannel_n(bool rtcp, TransportChannel* new_transport); | 213 void SetTransport_n(bool rtcp, DtlsTransportInternal* new_transport); |
209 | 214 |
210 bool was_ever_writable() const { return was_ever_writable_; } | 215 bool was_ever_writable() const { return was_ever_writable_; } |
211 void set_local_content_direction(MediaContentDirection direction) { | 216 void set_local_content_direction(MediaContentDirection direction) { |
212 local_content_direction_ = direction; | 217 local_content_direction_ = direction; |
213 } | 218 } |
214 void set_remote_content_direction(MediaContentDirection direction) { | 219 void set_remote_content_direction(MediaContentDirection direction) { |
215 remote_content_direction_ = direction; | 220 remote_content_direction_ = direction; |
216 } | 221 } |
217 // These methods verify that: | 222 // These methods verify that: |
218 // * The required content description directions have been set. | 223 // * The required content description directions have been set. |
219 // * The channel is enabled. | 224 // * The channel is enabled. |
220 // * And for sending: | 225 // * And for sending: |
221 // - The SRTP filter is active if it's needed. | 226 // - The SRTP filter is active if it's needed. |
222 // - The transport has been writable before, meaning it should be at least | 227 // - The transport has been writable before, meaning it should be at least |
223 // possible to succeed in sending a packet. | 228 // possible to succeed in sending a packet. |
224 // | 229 // |
225 // When any of these properties change, UpdateMediaSendRecvState_w should be | 230 // When any of these properties change, UpdateMediaSendRecvState_w should be |
226 // called. | 231 // called. |
227 bool IsReadyToReceiveMedia_w() const; | 232 bool IsReadyToReceiveMedia_w() const; |
228 bool IsReadyToSendMedia_w() const; | 233 bool IsReadyToSendMedia_w() const; |
229 rtc::Thread* signaling_thread() { return signaling_thread_; } | 234 rtc::Thread* signaling_thread() { return signaling_thread_; } |
230 | 235 |
231 void ConnectToTransportChannel(TransportChannel* tc); | 236 void ConnectToTransport(DtlsTransportInternal* transport); |
232 void DisconnectFromTransportChannel(TransportChannel* tc); | 237 void DisconnectFromTransport(DtlsTransportInternal* transport); |
233 | 238 |
234 void FlushRtcpMessages_n(); | 239 void FlushRtcpMessages_n(); |
235 | 240 |
236 // NetworkInterface implementation, called by MediaEngine | 241 // NetworkInterface implementation, called by MediaEngine |
237 bool SendPacket(rtc::CopyOnWriteBuffer* packet, | 242 bool SendPacket(rtc::CopyOnWriteBuffer* packet, |
238 const rtc::PacketOptions& options) override; | 243 const rtc::PacketOptions& options) override; |
239 bool SendRtcp(rtc::CopyOnWriteBuffer* packet, | 244 bool SendRtcp(rtc::CopyOnWriteBuffer* packet, |
240 const rtc::PacketOptions& options) override; | 245 const rtc::PacketOptions& options) override; |
241 | 246 |
242 // From TransportChannel | 247 // From TransportChannel |
243 void OnWritableState(rtc::PacketTransportInterface* transport); | 248 void OnWritableState(rtc::PacketTransportInterface* transport); |
244 virtual void OnPacketRead(rtc::PacketTransportInterface* transport, | 249 virtual void OnPacketRead(rtc::PacketTransportInterface* transport, |
245 const char* data, | 250 const char* data, |
246 size_t len, | 251 size_t len, |
247 const rtc::PacketTime& packet_time, | 252 const rtc::PacketTime& packet_time, |
248 int flags); | 253 int flags); |
249 void OnReadyToSend(rtc::PacketTransportInterface* transport); | 254 void OnReadyToSend(rtc::PacketTransportInterface* transport); |
250 | 255 |
251 void OnDtlsState(TransportChannel* channel, DtlsTransportState state); | 256 void OnDtlsState(DtlsTransportInternal* transport, DtlsTransportState state); |
252 | 257 |
253 void OnSelectedCandidatePairChanged( | 258 void OnSelectedCandidatePairChanged( |
254 TransportChannel* channel, | 259 IceTransportInternal* ice_transport, |
255 CandidatePairInterface* selected_candidate_pair, | 260 CandidatePairInterface* selected_candidate_pair, |
256 int last_sent_packet_id, | 261 int last_sent_packet_id, |
257 bool ready_to_send); | 262 bool ready_to_send); |
258 | 263 |
259 bool PacketIsRtcp(const rtc::PacketTransportInterface* transport, | 264 bool PacketIsRtcp(const rtc::PacketTransportInterface* transport, |
260 const char* data, | 265 const char* data, |
261 size_t len); | 266 size_t len); |
262 bool SendPacket(bool rtcp, | 267 bool SendPacket(bool rtcp, |
263 rtc::CopyOnWriteBuffer* packet, | 268 rtc::CopyOnWriteBuffer* packet, |
264 const rtc::PacketOptions& options); | 269 const rtc::PacketOptions& options); |
(...skipping 15 matching lines...) Expand all Loading... |
280 void ChannelWritable_n(); | 285 void ChannelWritable_n(); |
281 void ChannelNotWritable_n(); | 286 void ChannelNotWritable_n(); |
282 | 287 |
283 bool AddRecvStream_w(const StreamParams& sp); | 288 bool AddRecvStream_w(const StreamParams& sp); |
284 bool RemoveRecvStream_w(uint32_t ssrc); | 289 bool RemoveRecvStream_w(uint32_t ssrc); |
285 bool AddSendStream_w(const StreamParams& sp); | 290 bool AddSendStream_w(const StreamParams& sp); |
286 bool RemoveSendStream_w(uint32_t ssrc); | 291 bool RemoveSendStream_w(uint32_t ssrc); |
287 bool ShouldSetupDtlsSrtp_n() const; | 292 bool ShouldSetupDtlsSrtp_n() const; |
288 // Do the DTLS key expansion and impose it on the SRTP/SRTCP filters. | 293 // Do the DTLS key expansion and impose it on the SRTP/SRTCP filters. |
289 // |rtcp_channel| indicates whether to set up the RTP or RTCP filter. | 294 // |rtcp_channel| indicates whether to set up the RTP or RTCP filter. |
290 bool SetupDtlsSrtp_n(bool rtcp_channel); | 295 bool SetupDtlsSrtp_n(bool rtcp); |
291 void MaybeSetupDtlsSrtp_n(); | 296 void MaybeSetupDtlsSrtp_n(); |
292 // Set the DTLS-SRTP cipher policy on this channel as appropriate. | 297 // Set the DTLS-SRTP cipher policy on this channel as appropriate. |
293 bool SetDtlsSrtpCryptoSuites_n(TransportChannel* tc, bool rtcp); | 298 bool SetDtlsSrtpCryptoSuites_n(DtlsTransportInternal* transport, bool rtcp); |
294 | 299 |
295 // Should be called whenever the conditions for | 300 // Should be called whenever the conditions for |
296 // IsReadyToReceiveMedia/IsReadyToSendMedia are satisfied (or unsatisfied). | 301 // IsReadyToReceiveMedia/IsReadyToSendMedia are satisfied (or unsatisfied). |
297 // Updates the send/recv state of the media channel. | 302 // Updates the send/recv state of the media channel. |
298 void UpdateMediaSendRecvState(); | 303 void UpdateMediaSendRecvState(); |
299 virtual void UpdateMediaSendRecvState_w() = 0; | 304 virtual void UpdateMediaSendRecvState_w() = 0; |
300 | 305 |
301 // Gets the content info appropriate to the channel (audio or video). | 306 // Gets the content info appropriate to the channel (audio or video). |
302 virtual const ContentInfo* GetFirstContent( | 307 virtual const ContentInfo* GetFirstContent( |
303 const SessionDescription* sdesc) = 0; | 308 const SessionDescription* sdesc) = 0; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 const std::vector<ConnectionInfo>& infos) = 0; | 358 const std::vector<ConnectionInfo>& infos) = 0; |
354 | 359 |
355 // Helper function for invoking bool-returning methods on the worker thread. | 360 // Helper function for invoking bool-returning methods on the worker thread. |
356 template <class FunctorT> | 361 template <class FunctorT> |
357 bool InvokeOnWorker(const rtc::Location& posted_from, | 362 bool InvokeOnWorker(const rtc::Location& posted_from, |
358 const FunctorT& functor) { | 363 const FunctorT& functor) { |
359 return worker_thread_->Invoke<bool>(posted_from, functor); | 364 return worker_thread_->Invoke<bool>(posted_from, functor); |
360 } | 365 } |
361 | 366 |
362 private: | 367 private: |
363 bool InitNetwork_n(TransportChannel* rtp_transport, | 368 bool InitNetwork_n(DtlsTransportInternal* rtp_dtls_transport, |
364 TransportChannel* rtcp_transport); | 369 DtlsTransportInternal* rtcp_dtls_transport); |
365 void DisconnectTransportChannels_n(); | 370 void DisconnectTransportChannels_n(); |
366 void SignalSentPacket_n(rtc::PacketTransportInterface* transport, | 371 void SignalSentPacket_n(rtc::PacketTransportInterface* transport, |
367 const rtc::SentPacket& sent_packet); | 372 const rtc::SentPacket& sent_packet); |
368 void SignalSentPacket_w(const rtc::SentPacket& sent_packet); | 373 void SignalSentPacket_w(const rtc::SentPacket& sent_packet); |
369 bool IsReadyToSendMedia_n() const; | 374 bool IsReadyToSendMedia_n() const; |
370 void CacheRtpAbsSendTimeHeaderExtension_n(int rtp_abs_sendtime_extn_id); | 375 void CacheRtpAbsSendTimeHeaderExtension_n(int rtp_abs_sendtime_extn_id); |
371 int GetTransportOverheadPerPacket() const; | 376 int GetTransportOverheadPerPacket() const; |
372 void UpdateTransportOverhead(); | 377 void UpdateTransportOverhead(); |
373 | 378 |
374 rtc::Thread* const worker_thread_; | 379 rtc::Thread* const worker_thread_; |
375 rtc::Thread* const network_thread_; | 380 rtc::Thread* const network_thread_; |
376 rtc::Thread* const signaling_thread_; | 381 rtc::Thread* const signaling_thread_; |
377 rtc::AsyncInvoker invoker_; | 382 rtc::AsyncInvoker invoker_; |
378 | 383 |
379 const std::string content_name_; | 384 const std::string content_name_; |
380 std::unique_ptr<ConnectionMonitor> connection_monitor_; | 385 std::unique_ptr<ConnectionMonitor> connection_monitor_; |
381 | 386 |
382 std::string transport_name_; | 387 std::string transport_name_; |
383 // True if RTCP-multiplexing is required. In other words, no standalone RTCP | 388 // True if RTCP-multiplexing is required. In other words, no standalone RTCP |
384 // transport will ever be used for this channel. | 389 // transport will ever be used for this channel. |
385 const bool rtcp_mux_required_; | 390 const bool rtcp_mux_required_; |
386 // TODO(johan): Replace TransportChannel* with rtc::PacketTransportInterface*. | 391 |
387 TransportChannel* rtp_transport_ = nullptr; | 392 DtlsTransportInternal* rtp_dtls_transport_ = nullptr; |
388 std::vector<std::pair<rtc::Socket::Option, int> > socket_options_; | 393 std::vector<std::pair<rtc::Socket::Option, int> > socket_options_; |
389 TransportChannel* rtcp_transport_ = nullptr; | 394 DtlsTransportInternal* rtcp_dtls_transport_ = nullptr; |
390 std::vector<std::pair<rtc::Socket::Option, int> > rtcp_socket_options_; | 395 std::vector<std::pair<rtc::Socket::Option, int> > rtcp_socket_options_; |
391 SrtpFilter srtp_filter_; | 396 SrtpFilter srtp_filter_; |
392 RtcpMuxFilter rtcp_mux_filter_; | 397 RtcpMuxFilter rtcp_mux_filter_; |
393 BundleFilter bundle_filter_; | 398 BundleFilter bundle_filter_; |
394 bool rtp_ready_to_send_ = false; | 399 bool rtp_ready_to_send_ = false; |
395 bool rtcp_ready_to_send_ = false; | 400 bool rtcp_ready_to_send_ = false; |
396 bool writable_ = false; | 401 bool writable_ = false; |
397 bool was_ever_writable_ = false; | 402 bool was_ever_writable_ = false; |
398 bool has_received_packet_ = false; | 403 bool has_received_packet_ = false; |
399 bool dtls_keyed_ = false; | 404 bool dtls_keyed_ = false; |
(...skipping 21 matching lines...) Expand all Loading... |
421 public: | 426 public: |
422 VoiceChannel(rtc::Thread* worker_thread, | 427 VoiceChannel(rtc::Thread* worker_thread, |
423 rtc::Thread* network_thread, | 428 rtc::Thread* network_thread, |
424 rtc::Thread* signaling_thread, | 429 rtc::Thread* signaling_thread, |
425 MediaEngineInterface* media_engine, | 430 MediaEngineInterface* media_engine, |
426 VoiceMediaChannel* channel, | 431 VoiceMediaChannel* channel, |
427 const std::string& content_name, | 432 const std::string& content_name, |
428 bool rtcp_mux_required, | 433 bool rtcp_mux_required, |
429 bool srtp_required); | 434 bool srtp_required); |
430 ~VoiceChannel(); | 435 ~VoiceChannel(); |
431 bool Init_w(TransportChannel* rtp_transport, | 436 bool Init_w(DtlsTransportInternal* rtp_dtls_transport, |
432 TransportChannel* rtcp_transport); | 437 DtlsTransportInternal* rtcp_dtls_transport); |
433 | 438 |
434 // Configure sending media on the stream with SSRC |ssrc| | 439 // Configure sending media on the stream with SSRC |ssrc| |
435 // If there is only one sending stream SSRC 0 can be used. | 440 // If there is only one sending stream SSRC 0 can be used. |
436 bool SetAudioSend(uint32_t ssrc, | 441 bool SetAudioSend(uint32_t ssrc, |
437 bool enable, | 442 bool enable, |
438 const AudioOptions* options, | 443 const AudioOptions* options, |
439 AudioSource* source); | 444 AudioSource* source); |
440 | 445 |
441 // downcasts a MediaChannel | 446 // downcasts a MediaChannel |
442 VoiceMediaChannel* media_channel() const override { | 447 VoiceMediaChannel* media_channel() const override { |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 class VideoChannel : public BaseChannel { | 545 class VideoChannel : public BaseChannel { |
541 public: | 546 public: |
542 VideoChannel(rtc::Thread* worker_thread, | 547 VideoChannel(rtc::Thread* worker_thread, |
543 rtc::Thread* network_thread, | 548 rtc::Thread* network_thread, |
544 rtc::Thread* signaling_thread, | 549 rtc::Thread* signaling_thread, |
545 VideoMediaChannel* channel, | 550 VideoMediaChannel* channel, |
546 const std::string& content_name, | 551 const std::string& content_name, |
547 bool rtcp_mux_required, | 552 bool rtcp_mux_required, |
548 bool srtp_required); | 553 bool srtp_required); |
549 ~VideoChannel(); | 554 ~VideoChannel(); |
550 bool Init_w(TransportChannel* rtp_transport, | 555 bool Init_w(DtlsTransportInternal* rtp_dtls_transport, |
551 TransportChannel* rtcp_transport); | 556 DtlsTransportInternal* rtcp_dtls_transport); |
552 | 557 |
553 // downcasts a MediaChannel | 558 // downcasts a MediaChannel |
554 VideoMediaChannel* media_channel() const override { | 559 VideoMediaChannel* media_channel() const override { |
555 return static_cast<VideoMediaChannel*>(BaseChannel::media_channel()); | 560 return static_cast<VideoMediaChannel*>(BaseChannel::media_channel()); |
556 } | 561 } |
557 | 562 |
558 bool SetSink(uint32_t ssrc, | 563 bool SetSink(uint32_t ssrc, |
559 rtc::VideoSinkInterface<webrtc::VideoFrame>* sink); | 564 rtc::VideoSinkInterface<webrtc::VideoFrame>* sink); |
560 // Get statistics about the current media session. | 565 // Get statistics about the current media session. |
561 bool GetStats(VideoMediaInfo* stats); | 566 bool GetStats(VideoMediaInfo* stats); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 class RtpDataChannel : public BaseChannel { | 625 class RtpDataChannel : public BaseChannel { |
621 public: | 626 public: |
622 RtpDataChannel(rtc::Thread* worker_thread, | 627 RtpDataChannel(rtc::Thread* worker_thread, |
623 rtc::Thread* network_thread, | 628 rtc::Thread* network_thread, |
624 rtc::Thread* signaling_thread, | 629 rtc::Thread* signaling_thread, |
625 DataMediaChannel* channel, | 630 DataMediaChannel* channel, |
626 const std::string& content_name, | 631 const std::string& content_name, |
627 bool rtcp_mux_required, | 632 bool rtcp_mux_required, |
628 bool srtp_required); | 633 bool srtp_required); |
629 ~RtpDataChannel(); | 634 ~RtpDataChannel(); |
630 bool Init_w(TransportChannel* rtp_transport, | 635 bool Init_w(DtlsTransportInternal* rtp_dtls_transport, |
631 TransportChannel* rtcp_transport); | 636 DtlsTransportInternal* rtcp_dtls_transport); |
632 | 637 |
633 virtual bool SendData(const SendDataParams& params, | 638 virtual bool SendData(const SendDataParams& params, |
634 const rtc::CopyOnWriteBuffer& payload, | 639 const rtc::CopyOnWriteBuffer& payload, |
635 SendDataResult* result); | 640 SendDataResult* result); |
636 | 641 |
637 void StartMediaMonitor(int cms); | 642 void StartMediaMonitor(int cms); |
638 void StopMediaMonitor(); | 643 void StopMediaMonitor(); |
639 | 644 |
640 // Should be called on the signaling thread only. | 645 // Should be called on the signaling thread only. |
641 bool ready_to_send_data() const { | 646 bool ready_to_send_data() const { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 // SetSendParameters. | 729 // SetSendParameters. |
725 DataSendParameters last_send_params_; | 730 DataSendParameters last_send_params_; |
726 // Last DataRecvParameters sent down to the media_channel() via | 731 // Last DataRecvParameters sent down to the media_channel() via |
727 // SetRecvParameters. | 732 // SetRecvParameters. |
728 DataRecvParameters last_recv_params_; | 733 DataRecvParameters last_recv_params_; |
729 }; | 734 }; |
730 | 735 |
731 } // namespace cricket | 736 } // namespace cricket |
732 | 737 |
733 #endif // WEBRTC_PC_CHANNEL_H_ | 738 #endif // WEBRTC_PC_CHANNEL_H_ |
OLD | NEW |