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