| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 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 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 data_channel_type_ = cricket::DCT_RTP; | 643 data_channel_type_ = cricket::DCT_RTP; |
| 644 } else { | 644 } else { |
| 645 // DTLS has to be enabled to use SCTP. | 645 // DTLS has to be enabled to use SCTP. |
| 646 if (!options.disable_sctp_data_channels && dtls_enabled_) { | 646 if (!options.disable_sctp_data_channels && dtls_enabled_) { |
| 647 LOG(LS_INFO) << "Allowing SCTP data engine."; | 647 LOG(LS_INFO) << "Allowing SCTP data engine."; |
| 648 data_channel_type_ = cricket::DCT_SCTP; | 648 data_channel_type_ = cricket::DCT_SCTP; |
| 649 } | 649 } |
| 650 } | 650 } |
| 651 | 651 |
| 652 // Find DSCP constraint. | 652 // Find DSCP constraint. |
| 653 if (FindConstraint( | 653 if (FindConstraint(constraints, MediaConstraintsInterface::kEnableDscp, |
| 654 constraints, | 654 &value, NULL)) |
| 655 MediaConstraintsInterface::kEnableDscp, | 655 channel_options_.enable_dscp = value; |
| 656 &value, NULL)) { | |
| 657 audio_options_.dscp = rtc::Optional<bool>(value); | |
| 658 video_options_.dscp = rtc::Optional<bool>(value); | |
| 659 } | |
| 660 | 656 |
| 661 // Find Suspend Below Min Bitrate constraint. | 657 // Find Suspend Below Min Bitrate constraint. |
| 662 if (FindConstraint( | 658 if (FindConstraint( |
| 663 constraints, | 659 constraints, |
| 664 MediaConstraintsInterface::kEnableVideoSuspendBelowMinBitrate, | 660 MediaConstraintsInterface::kEnableVideoSuspendBelowMinBitrate, |
| 665 &value, | 661 &value, |
| 666 NULL)) { | 662 NULL)) { |
| 667 video_options_.suspend_below_min_bitrate = rtc::Optional<bool>(value); | 663 video_options_.suspend_below_min_bitrate = rtc::Optional<bool>(value); |
| 668 } | 664 } |
| 669 | 665 |
| (...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1801 return false; | 1797 return false; |
| 1802 } | 1798 } |
| 1803 } | 1799 } |
| 1804 | 1800 |
| 1805 return true; | 1801 return true; |
| 1806 } | 1802 } |
| 1807 | 1803 |
| 1808 bool WebRtcSession::CreateVoiceChannel(const cricket::ContentInfo* content) { | 1804 bool WebRtcSession::CreateVoiceChannel(const cricket::ContentInfo* content) { |
| 1809 voice_channel_.reset(channel_manager_->CreateVoiceChannel( | 1805 voice_channel_.reset(channel_manager_->CreateVoiceChannel( |
| 1810 media_controller_, transport_controller_.get(), content->name, true, | 1806 media_controller_, transport_controller_.get(), content->name, true, |
| 1811 audio_options_)); | 1807 channel_options_, audio_options_)); |
| 1812 if (!voice_channel_) { | 1808 if (!voice_channel_) { |
| 1813 return false; | 1809 return false; |
| 1814 } | 1810 } |
| 1815 | 1811 |
| 1816 voice_channel_->SignalDtlsSetupFailure.connect( | 1812 voice_channel_->SignalDtlsSetupFailure.connect( |
| 1817 this, &WebRtcSession::OnDtlsSetupFailure); | 1813 this, &WebRtcSession::OnDtlsSetupFailure); |
| 1818 | 1814 |
| 1819 SignalVoiceChannelCreated(); | 1815 SignalVoiceChannelCreated(); |
| 1820 voice_channel_->transport_channel()->SignalSentPacket.connect( | 1816 voice_channel_->transport_channel()->SignalSentPacket.connect( |
| 1821 this, &WebRtcSession::OnSentPacket_w); | 1817 this, &WebRtcSession::OnSentPacket_w); |
| 1822 return true; | 1818 return true; |
| 1823 } | 1819 } |
| 1824 | 1820 |
| 1825 bool WebRtcSession::CreateVideoChannel(const cricket::ContentInfo* content) { | 1821 bool WebRtcSession::CreateVideoChannel(const cricket::ContentInfo* content) { |
| 1826 video_channel_.reset(channel_manager_->CreateVideoChannel( | 1822 video_channel_.reset(channel_manager_->CreateVideoChannel( |
| 1827 media_controller_, transport_controller_.get(), content->name, true, | 1823 media_controller_, transport_controller_.get(), content->name, true, |
| 1828 video_options_)); | 1824 channel_options_, video_options_)); |
| 1829 if (!video_channel_) { | 1825 if (!video_channel_) { |
| 1830 return false; | 1826 return false; |
| 1831 } | 1827 } |
| 1832 | 1828 |
| 1833 video_channel_->SignalDtlsSetupFailure.connect( | 1829 video_channel_->SignalDtlsSetupFailure.connect( |
| 1834 this, &WebRtcSession::OnDtlsSetupFailure); | 1830 this, &WebRtcSession::OnDtlsSetupFailure); |
| 1835 | 1831 |
| 1836 SignalVideoChannelCreated(); | 1832 SignalVideoChannelCreated(); |
| 1837 video_channel_->transport_channel()->SignalSentPacket.connect( | 1833 video_channel_->transport_channel()->SignalSentPacket.connect( |
| 1838 this, &WebRtcSession::OnSentPacket_w); | 1834 this, &WebRtcSession::OnSentPacket_w); |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2176 } | 2172 } |
| 2177 } | 2173 } |
| 2178 | 2174 |
| 2179 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, | 2175 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, |
| 2180 const rtc::SentPacket& sent_packet) { | 2176 const rtc::SentPacket& sent_packet) { |
| 2181 RTC_DCHECK(worker_thread()->IsCurrent()); | 2177 RTC_DCHECK(worker_thread()->IsCurrent()); |
| 2182 media_controller_->call_w()->OnSentPacket(sent_packet); | 2178 media_controller_->call_w()->OnSentPacket(sent_packet); |
| 2183 } | 2179 } |
| 2184 | 2180 |
| 2185 } // namespace webrtc | 2181 } // namespace webrtc |
| OLD | NEW |