Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Side by Side Diff: talk/session/media/channel.cc

Issue 1363573002: Wire up transport sequence number / send time callbacks to webrtc via libjingle. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: No changes to const parameters. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2004 Google Inc. 3 * Copyright 2004 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 12 matching lines...) Expand all
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28 #include "talk/session/media/channel.h" 28 #include "talk/session/media/channel.h"
29 29
30 #include "talk/media/base/constants.h" 30 #include "talk/media/base/constants.h"
31 #include "talk/media/base/rtputils.h" 31 #include "talk/media/base/rtputils.h"
32 #include "webrtc/p2p/base/transportchannel.h" 32 #include "webrtc/p2p/base/transportchannel.h"
33 #include "talk/app/webrtc/mediacontroller.h"
33 #include "talk/session/media/channelmanager.h" 34 #include "talk/session/media/channelmanager.h"
34 #include "webrtc/base/bind.h" 35 #include "webrtc/base/bind.h"
35 #include "webrtc/base/buffer.h" 36 #include "webrtc/base/buffer.h"
36 #include "webrtc/base/byteorder.h" 37 #include "webrtc/base/byteorder.h"
37 #include "webrtc/base/common.h" 38 #include "webrtc/base/common.h"
38 #include "webrtc/base/dscp.h" 39 #include "webrtc/base/dscp.h"
39 #include "webrtc/base/logging.h" 40 #include "webrtc/base/logging.h"
41 #include "webrtc/common_types.h"
40 42
41 namespace cricket { 43 namespace cricket {
42 44
43 using rtc::Bind; 45 using rtc::Bind;
44 46
45 enum { 47 enum {
46 MSG_EARLYMEDIATIMEOUT = 1, 48 MSG_EARLYMEDIATIMEOUT = 1,
47 MSG_SCREENCASTWINDOWEVENT, 49 MSG_SCREENCASTWINDOWEVENT,
48 MSG_RTPPACKET, 50 MSG_RTPPACKET,
49 MSG_RTCPPACKET, 51 MSG_RTCPPACKET,
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 template <class Codec, class Options> 166 template <class Codec, class Options>
165 void RtpSendParametersFromMediaDescription( 167 void RtpSendParametersFromMediaDescription(
166 const MediaContentDescriptionImpl<Codec>* desc, 168 const MediaContentDescriptionImpl<Codec>* desc,
167 RtpSendParameters<Codec, Options>* send_params) { 169 RtpSendParameters<Codec, Options>* send_params) {
168 RtpParametersFromMediaDescription(desc, send_params); 170 RtpParametersFromMediaDescription(desc, send_params);
169 send_params->max_bandwidth_bps = desc->bandwidth(); 171 send_params->max_bandwidth_bps = desc->bandwidth();
170 } 172 }
171 173
172 BaseChannel::BaseChannel(rtc::Thread* thread, 174 BaseChannel::BaseChannel(rtc::Thread* thread,
173 MediaChannel* media_channel, 175 MediaChannel* media_channel,
176 webrtc::MediaControllerInterface* media_controller,
174 TransportController* transport_controller, 177 TransportController* transport_controller,
175 const std::string& content_name, 178 const std::string& content_name,
176 bool rtcp) 179 bool rtcp)
177 : worker_thread_(thread), 180 : worker_thread_(thread),
178 transport_controller_(transport_controller), 181 transport_controller_(transport_controller),
179 media_channel_(media_channel), 182 media_channel_(media_channel),
183 media_controller_(media_controller),
180 content_name_(content_name), 184 content_name_(content_name),
181 rtcp_transport_enabled_(rtcp), 185 rtcp_transport_enabled_(rtcp),
182 transport_channel_(nullptr), 186 transport_channel_(nullptr),
183 rtcp_transport_channel_(nullptr), 187 rtcp_transport_channel_(nullptr),
184 enabled_(false), 188 enabled_(false),
185 writable_(false), 189 writable_(false),
186 rtp_ready_to_send_(false), 190 rtp_ready_to_send_(false),
187 rtcp_ready_to_send_(false), 191 rtcp_ready_to_send_(false),
188 was_ever_writable_(false), 192 was_ever_writable_(false),
189 local_content_direction_(MD_INACTIVE), 193 local_content_direction_(MD_INACTIVE),
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 // setting new channel 340 // setting new channel
337 UpdateWritableState_w(); 341 UpdateWritableState_w();
338 SetReadyToSend(true, new_tc && new_tc->writable()); 342 SetReadyToSend(true, new_tc && new_tc->writable());
339 } 343 }
340 344
341 void BaseChannel::ConnectToTransportChannel(TransportChannel* tc) { 345 void BaseChannel::ConnectToTransportChannel(TransportChannel* tc) {
342 ASSERT(worker_thread_ == rtc::Thread::Current()); 346 ASSERT(worker_thread_ == rtc::Thread::Current());
343 347
344 tc->SignalWritableState.connect(this, &BaseChannel::OnWritableState); 348 tc->SignalWritableState.connect(this, &BaseChannel::OnWritableState);
345 tc->SignalReadPacket.connect(this, &BaseChannel::OnChannelRead); 349 tc->SignalReadPacket.connect(this, &BaseChannel::OnChannelRead);
350 tc->SignalSentPacket.connect(this, &BaseChannel::OnPacketSent);
346 tc->SignalReadyToSend.connect(this, &BaseChannel::OnReadyToSend); 351 tc->SignalReadyToSend.connect(this, &BaseChannel::OnReadyToSend);
347 } 352 }
348 353
349 void BaseChannel::DisconnectFromTransportChannel(TransportChannel* tc) { 354 void BaseChannel::DisconnectFromTransportChannel(TransportChannel* tc) {
350 ASSERT(worker_thread_ == rtc::Thread::Current()); 355 ASSERT(worker_thread_ == rtc::Thread::Current());
351 356
352 tc->SignalWritableState.disconnect(this); 357 tc->SignalWritableState.disconnect(this);
353 tc->SignalReadPacket.disconnect(this); 358 tc->SignalReadPacket.disconnect(this);
354 tc->SignalReadyToSend.disconnect(this); 359 tc->SignalReadyToSend.disconnect(this);
355 } 360 }
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 bool BaseChannel::IsReadyToSend() const { 429 bool BaseChannel::IsReadyToSend() const {
425 // Send outgoing data if we are enabled, have local and remote content, 430 // Send outgoing data if we are enabled, have local and remote content,
426 // and we have had some form of connectivity. 431 // and we have had some form of connectivity.
427 return enabled() && 432 return enabled() &&
428 IsReceiveContentDirection(remote_content_direction_) && 433 IsReceiveContentDirection(remote_content_direction_) &&
429 IsSendContentDirection(local_content_direction_) && 434 IsSendContentDirection(local_content_direction_) &&
430 was_ever_writable(); 435 was_ever_writable();
431 } 436 }
432 437
433 bool BaseChannel::SendPacket(rtc::Buffer* packet, 438 bool BaseChannel::SendPacket(rtc::Buffer* packet,
434 rtc::DiffServCodePoint dscp) { 439 const rtc::PacketOptions& options) {
435 return SendPacket(false, packet, dscp); 440 return SendPacket(false, packet, options);
436 } 441 }
437 442
438 bool BaseChannel::SendRtcp(rtc::Buffer* packet, 443 bool BaseChannel::SendRtcp(rtc::Buffer* packet,
439 rtc::DiffServCodePoint dscp) { 444 const rtc::PacketOptions& options) {
440 return SendPacket(true, packet, dscp); 445 return SendPacket(true, packet, options);
441 } 446 }
442 447
443 int BaseChannel::SetOption(SocketType type, rtc::Socket::Option opt, 448 int BaseChannel::SetOption(SocketType type, rtc::Socket::Option opt,
444 int value) { 449 int value) {
445 TransportChannel* channel = NULL; 450 TransportChannel* channel = NULL;
446 switch (type) { 451 switch (type) {
447 case ST_RTP: 452 case ST_RTP:
448 channel = transport_channel_; 453 channel = transport_channel_;
449 socket_options_.push_back( 454 socket_options_.push_back(
450 std::pair<rtc::Socket::Option, int>(opt, value)); 455 std::pair<rtc::Socket::Option, int>(opt, value));
(...skipping 19 matching lines...) Expand all
470 // OnChannelRead gets called from P2PSocket; now pass data to MediaEngine 475 // OnChannelRead gets called from P2PSocket; now pass data to MediaEngine
471 ASSERT(worker_thread_ == rtc::Thread::Current()); 476 ASSERT(worker_thread_ == rtc::Thread::Current());
472 477
473 // When using RTCP multiplexing we might get RTCP packets on the RTP 478 // When using RTCP multiplexing we might get RTCP packets on the RTP
474 // transport. We feed RTP traffic into the demuxer to determine if it is RTCP. 479 // transport. We feed RTP traffic into the demuxer to determine if it is RTCP.
475 bool rtcp = PacketIsRtcp(channel, data, len); 480 bool rtcp = PacketIsRtcp(channel, data, len);
476 rtc::Buffer packet(data, len); 481 rtc::Buffer packet(data, len);
477 HandlePacket(rtcp, &packet, packet_time); 482 HandlePacket(rtcp, &packet, packet_time);
478 } 483 }
479 484
485 void BaseChannel::OnPacketSent(TransportChannel* channel,
486 const rtc::SentPacket& sent_packet) {
487 if (!media_controller_)
488 return;
pthatcher1 2015/10/05 18:30:13 {}s please
stefan-webrtc 2015/10/07 16:55:25 This code has now been removed.
489 ASSERT(channel == transport_channel_ || channel == rtcp_transport_channel_);
490 webrtc::SentPacket webrtc_sent_packet(sent_packet.packet_id,
491 sent_packet.send_time_ms);
pthatcher1 2015/10/05 18:30:13 Similarly, can we have just one SentPacket struct?
492 media_controller_->OnPacketSent(webrtc_sent_packet);
pthatcher1 2015/10/05 18:30:13 Would it make sense for this to be media_controlle
493 }
494
480 void BaseChannel::OnReadyToSend(TransportChannel* channel) { 495 void BaseChannel::OnReadyToSend(TransportChannel* channel) {
481 ASSERT(channel == transport_channel_ || channel == rtcp_transport_channel_); 496 ASSERT(channel == transport_channel_ || channel == rtcp_transport_channel_);
482 SetReadyToSend(channel == rtcp_transport_channel_, true); 497 SetReadyToSend(channel == rtcp_transport_channel_, true);
483 } 498 }
484 499
485 void BaseChannel::SetReadyToSend(bool rtcp, bool ready) { 500 void BaseChannel::SetReadyToSend(bool rtcp, bool ready) {
486 if (rtcp) { 501 if (rtcp) {
487 rtcp_ready_to_send_ = ready; 502 rtcp_ready_to_send_ = ready;
488 } else { 503 } else {
489 rtp_ready_to_send_ = ready; 504 rtp_ready_to_send_ = ready;
490 } 505 }
491 506
492 if (rtp_ready_to_send_ && 507 if (rtp_ready_to_send_ &&
493 // In the case of rtcp mux |rtcp_transport_channel_| will be null. 508 // In the case of rtcp mux |rtcp_transport_channel_| will be null.
494 (rtcp_ready_to_send_ || !rtcp_transport_channel_)) { 509 (rtcp_ready_to_send_ || !rtcp_transport_channel_)) {
495 // Notify the MediaChannel when both rtp and rtcp channel can send. 510 // Notify the MediaChannel when both rtp and rtcp channel can send.
496 media_channel_->OnReadyToSend(true); 511 media_channel_->OnReadyToSend(true);
497 } else { 512 } else {
498 // Notify the MediaChannel when either rtp or rtcp channel can't send. 513 // Notify the MediaChannel when either rtp or rtcp channel can't send.
499 media_channel_->OnReadyToSend(false); 514 media_channel_->OnReadyToSend(false);
500 } 515 }
501 } 516 }
502 517
503 bool BaseChannel::PacketIsRtcp(const TransportChannel* channel, 518 bool BaseChannel::PacketIsRtcp(const TransportChannel* channel,
504 const char* data, size_t len) { 519 const char* data, size_t len) {
505 return (channel == rtcp_transport_channel_ || 520 return (channel == rtcp_transport_channel_ ||
506 rtcp_mux_filter_.DemuxRtcp(data, static_cast<int>(len))); 521 rtcp_mux_filter_.DemuxRtcp(data, static_cast<int>(len)));
507 } 522 }
508 523
509 bool BaseChannel::SendPacket(bool rtcp, rtc::Buffer* packet, 524 bool BaseChannel::SendPacket(bool rtcp,
510 rtc::DiffServCodePoint dscp) { 525 rtc::Buffer* packet,
526 const rtc::PacketOptions& options) {
511 // SendPacket gets called from MediaEngine, typically on an encoder thread. 527 // SendPacket gets called from MediaEngine, typically on an encoder thread.
512 // If the thread is not our worker thread, we will post to our worker 528 // If the thread is not our worker thread, we will post to our worker
513 // so that the real work happens on our worker. This avoids us having to 529 // so that the real work happens on our worker. This avoids us having to
514 // synchronize access to all the pieces of the send path, including 530 // synchronize access to all the pieces of the send path, including
515 // SRTP and the inner workings of the transport channels. 531 // SRTP and the inner workings of the transport channels.
516 // The only downside is that we can't return a proper failure code if 532 // The only downside is that we can't return a proper failure code if
517 // needed. Since UDP is unreliable anyway, this should be a non-issue. 533 // needed. Since UDP is unreliable anyway, this should be a non-issue.
518 if (rtc::Thread::Current() != worker_thread_) { 534 if (rtc::Thread::Current() != worker_thread_) {
519 // Avoid a copy by transferring the ownership of the packet data. 535 // Avoid a copy by transferring the ownership of the packet data.
520 int message_id = (!rtcp) ? MSG_RTPPACKET : MSG_RTCPPACKET; 536 int message_id = (!rtcp) ? MSG_RTPPACKET : MSG_RTCPPACKET;
521 PacketMessageData* data = new PacketMessageData; 537 PacketMessageData* data = new PacketMessageData;
522 data->packet = packet->Pass(); 538 data->packet = packet->Pass();
523 data->dscp = dscp; 539 data->dscp = options.dscp;
524 worker_thread_->Post(this, message_id, data); 540 worker_thread_->Post(this, message_id, data);
525 return true; 541 return true;
526 } 542 }
527 543
528 // Now that we are on the correct thread, ensure we have a place to send this 544 // Now that we are on the correct thread, ensure we have a place to send this
529 // packet before doing anything. (We might get RTCP packets that we don't 545 // packet before doing anything. (We might get RTCP packets that we don't
530 // intend to send.) If we've negotiated RTCP mux, send RTCP over the RTP 546 // intend to send.) If we've negotiated RTCP mux, send RTCP over the RTP
531 // transport. 547 // transport.
532 TransportChannel* channel = (!rtcp || rtcp_mux_filter_.IsActive()) ? 548 TransportChannel* channel = (!rtcp || rtcp_mux_filter_.IsActive()) ?
533 transport_channel_ : rtcp_transport_channel_; 549 transport_channel_ : rtcp_transport_channel_;
534 if (!channel || !channel->writable()) { 550 if (!channel || !channel->writable()) {
535 return false; 551 return false;
536 } 552 }
537 553
538 // Protect ourselves against crazy data. 554 // Protect ourselves against crazy data.
539 if (!ValidPacket(rtcp, packet)) { 555 if (!ValidPacket(rtcp, packet)) {
540 LOG(LS_ERROR) << "Dropping outgoing " << content_name_ << " " 556 LOG(LS_ERROR) << "Dropping outgoing " << content_name_ << " "
541 << PacketType(rtcp) 557 << PacketType(rtcp)
542 << " packet: wrong size=" << packet->size(); 558 << " packet: wrong size=" << packet->size();
543 return false; 559 return false;
544 } 560 }
545 561
546 rtc::PacketOptions options(dscp); 562 rtc::PacketOptions updated_options;
563 updated_options = options;
547 // Protect if needed. 564 // Protect if needed.
548 if (srtp_filter_.IsActive()) { 565 if (srtp_filter_.IsActive()) {
549 bool res; 566 bool res;
550 uint8_t* data = packet->data(); 567 uint8_t* data = packet->data();
551 int len = static_cast<int>(packet->size()); 568 int len = static_cast<int>(packet->size());
552 if (!rtcp) { 569 if (!rtcp) {
553 // If ENABLE_EXTERNAL_AUTH flag is on then packet authentication is not done 570 // If ENABLE_EXTERNAL_AUTH flag is on then packet authentication is not done
554 // inside libsrtp for a RTP packet. A external HMAC module will be writing 571 // inside libsrtp for a RTP packet. A external HMAC module will be writing
555 // a fake HMAC value. This is ONLY done for a RTP packet. 572 // a fake HMAC value. This is ONLY done for a RTP packet.
556 // Socket layer will update rtp sendtime extension header if present in 573 // Socket layer will update rtp sendtime extension header if present in
557 // packet with current time before updating the HMAC. 574 // packet with current time before updating the HMAC.
558 #if !defined(ENABLE_EXTERNAL_AUTH) 575 #if !defined(ENABLE_EXTERNAL_AUTH)
559 res = srtp_filter_.ProtectRtp( 576 res = srtp_filter_.ProtectRtp(
560 data, len, static_cast<int>(packet->capacity()), &len); 577 data, len, static_cast<int>(packet->capacity()), &len);
561 #else 578 #else
562 options.packet_time_params.rtp_sendtime_extension_id = 579 updated_options.packet_time_params.rtp_sendtime_extension_id =
563 rtp_abs_sendtime_extn_id_; 580 rtp_abs_sendtime_extn_id_;
564 res = srtp_filter_.ProtectRtp( 581 res = srtp_filter_.ProtectRtp(
565 data, len, static_cast<int>(packet->capacity()), &len, 582 data, len, static_cast<int>(packet->capacity()), &len,
566 &options.packet_time_params.srtp_packet_index); 583 &updated_options.packet_time_params.srtp_packet_index);
567 // If protection succeeds, let's get auth params from srtp. 584 // If protection succeeds, let's get auth params from srtp.
568 if (res) { 585 if (res) {
569 uint8* auth_key = NULL; 586 uint8* auth_key = NULL;
570 int key_len; 587 int key_len;
571 res = srtp_filter_.GetRtpAuthParams( 588 res = srtp_filter_.GetRtpAuthParams(
572 &auth_key, &key_len, &options.packet_time_params.srtp_auth_tag_len); 589 &auth_key, &key_len,
590 &updated_options.packet_time_params.srtp_auth_tag_len);
573 if (res) { 591 if (res) {
574 options.packet_time_params.srtp_auth_key.resize(key_len); 592 updated_options.packet_time_params.srtp_auth_key.resize(key_len);
575 options.packet_time_params.srtp_auth_key.assign(auth_key, 593 updated_options.packet_time_params.srtp_auth_key.assign(
576 auth_key + key_len); 594 auth_key, auth_key + key_len);
577 } 595 }
578 } 596 }
579 #endif 597 #endif
580 if (!res) { 598 if (!res) {
581 int seq_num = -1; 599 int seq_num = -1;
582 uint32 ssrc = 0; 600 uint32 ssrc = 0;
583 GetRtpSeqNum(data, len, &seq_num); 601 GetRtpSeqNum(data, len, &seq_num);
584 GetRtpSsrc(data, len, &ssrc); 602 GetRtpSsrc(data, len, &ssrc);
585 LOG(LS_ERROR) << "Failed to protect " << content_name_ 603 LOG(LS_ERROR) << "Failed to protect " << content_name_
586 << " RTP packet: size=" << len 604 << " RTP packet: size=" << len
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 worker_thread_->Clear(this, MSG_RTCPPACKET, &rtcp_messages); 1289 worker_thread_->Clear(this, MSG_RTCPPACKET, &rtcp_messages);
1272 for (rtc::MessageList::iterator it = rtcp_messages.begin(); 1290 for (rtc::MessageList::iterator it = rtcp_messages.begin();
1273 it != rtcp_messages.end(); ++it) { 1291 it != rtcp_messages.end(); ++it) {
1274 worker_thread_->Send(this, MSG_RTCPPACKET, it->pdata); 1292 worker_thread_->Send(this, MSG_RTCPPACKET, it->pdata);
1275 } 1293 }
1276 } 1294 }
1277 1295
1278 VoiceChannel::VoiceChannel(rtc::Thread* thread, 1296 VoiceChannel::VoiceChannel(rtc::Thread* thread,
1279 MediaEngineInterface* media_engine, 1297 MediaEngineInterface* media_engine,
1280 VoiceMediaChannel* media_channel, 1298 VoiceMediaChannel* media_channel,
1299 webrtc::MediaControllerInterface* media_controller,
1281 TransportController* transport_controller, 1300 TransportController* transport_controller,
1282 const std::string& content_name, 1301 const std::string& content_name,
1283 bool rtcp) 1302 bool rtcp)
1284 : BaseChannel(thread, 1303 : BaseChannel(thread,
1285 media_channel, 1304 media_channel,
1305 media_controller,
1286 transport_controller, 1306 transport_controller,
1287 content_name, 1307 content_name,
1288 rtcp), 1308 rtcp),
1289 media_engine_(media_engine), 1309 media_engine_(media_engine),
1290 received_media_(false) {} 1310 received_media_(false) {}
1291 1311
1292 VoiceChannel::~VoiceChannel() { 1312 VoiceChannel::~VoiceChannel() {
1293 StopAudioMonitor(); 1313 StopAudioMonitor();
1294 StopMediaMonitor(); 1314 StopMediaMonitor();
1295 // this can't be done in the base class, since it calls a virtual 1315 // this can't be done in the base class, since it calls a virtual
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
1589 SignalAudioMonitor(this, info); 1609 SignalAudioMonitor(this, info);
1590 } 1610 }
1591 1611
1592 void VoiceChannel::GetSrtpCryptoSuiteNames( 1612 void VoiceChannel::GetSrtpCryptoSuiteNames(
1593 std::vector<std::string>* ciphers) const { 1613 std::vector<std::string>* ciphers) const {
1594 GetSupportedAudioCryptoSuites(ciphers); 1614 GetSupportedAudioCryptoSuites(ciphers);
1595 } 1615 }
1596 1616
1597 VideoChannel::VideoChannel(rtc::Thread* thread, 1617 VideoChannel::VideoChannel(rtc::Thread* thread,
1598 VideoMediaChannel* media_channel, 1618 VideoMediaChannel* media_channel,
1619 webrtc::MediaControllerInterface* media_controller,
1599 TransportController* transport_controller, 1620 TransportController* transport_controller,
1600 const std::string& content_name, 1621 const std::string& content_name,
1601 bool rtcp) 1622 bool rtcp)
1602 : BaseChannel(thread, 1623 : BaseChannel(thread,
1603 media_channel, 1624 media_channel,
1625 media_controller,
1604 transport_controller, 1626 transport_controller,
1605 content_name, 1627 content_name,
1606 rtcp), 1628 rtcp),
1607 renderer_(NULL), 1629 renderer_(NULL),
1608 previous_we_(rtc::WE_CLOSE) {} 1630 previous_we_(rtc::WE_CLOSE) {}
1609 1631
1610 bool VideoChannel::Init() { 1632 bool VideoChannel::Init() {
1611 if (!BaseChannel::Init()) { 1633 if (!BaseChannel::Init()) {
1612 return false; 1634 return false;
1613 } 1635 }
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
1984 GetSupportedVideoCryptoSuites(ciphers); 2006 GetSupportedVideoCryptoSuites(ciphers);
1985 } 2007 }
1986 2008
1987 DataChannel::DataChannel(rtc::Thread* thread, 2009 DataChannel::DataChannel(rtc::Thread* thread,
1988 DataMediaChannel* media_channel, 2010 DataMediaChannel* media_channel,
1989 TransportController* transport_controller, 2011 TransportController* transport_controller,
1990 const std::string& content_name, 2012 const std::string& content_name,
1991 bool rtcp) 2013 bool rtcp)
1992 : BaseChannel(thread, 2014 : BaseChannel(thread,
1993 media_channel, 2015 media_channel,
2016 nullptr,
1994 transport_controller, 2017 transport_controller,
1995 content_name, 2018 content_name,
1996 rtcp), 2019 rtcp),
1997 data_channel_type_(cricket::DCT_NONE), 2020 data_channel_type_(cricket::DCT_NONE),
1998 ready_to_send_data_(false) {} 2021 ready_to_send_data_(false) {}
1999 2022
2000 DataChannel::~DataChannel() { 2023 DataChannel::~DataChannel() {
2001 StopMediaMonitor(); 2024 StopMediaMonitor();
2002 // this can't be done in the base class, since it calls a virtual 2025 // this can't be done in the base class, since it calls a virtual
2003 DisableMedia_w(); 2026 DisableMedia_w();
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
2296 return (data_channel_type_ == DCT_RTP); 2319 return (data_channel_type_ == DCT_RTP);
2297 } 2320 }
2298 2321
2299 void DataChannel::OnStreamClosedRemotely(uint32 sid) { 2322 void DataChannel::OnStreamClosedRemotely(uint32 sid) {
2300 rtc::TypedMessageData<uint32>* message = 2323 rtc::TypedMessageData<uint32>* message =
2301 new rtc::TypedMessageData<uint32>(sid); 2324 new rtc::TypedMessageData<uint32>(sid);
2302 signaling_thread()->Post(this, MSG_STREAMCLOSEDREMOTELY, message); 2325 signaling_thread()->Post(this, MSG_STREAMCLOSEDREMOTELY, message);
2303 } 2326 }
2304 2327
2305 } // namespace cricket 2328 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698