| 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 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1802 return false; | 1798 return false; |
| 1803 } | 1799 } |
| 1804 } | 1800 } |
| 1805 | 1801 |
| 1806 return true; | 1802 return true; |
| 1807 } | 1803 } |
| 1808 | 1804 |
| 1809 bool WebRtcSession::CreateVoiceChannel(const cricket::ContentInfo* content) { | 1805 bool WebRtcSession::CreateVoiceChannel(const cricket::ContentInfo* content) { |
| 1810 voice_channel_.reset(channel_manager_->CreateVoiceChannel( | 1806 voice_channel_.reset(channel_manager_->CreateVoiceChannel( |
| 1811 media_controller_, transport_controller_.get(), content->name, true, | 1807 media_controller_, transport_controller_.get(), content->name, true, |
| 1812 audio_options_)); | 1808 channel_options_, audio_options_)); |
| 1813 if (!voice_channel_) { | 1809 if (!voice_channel_) { |
| 1814 return false; | 1810 return false; |
| 1815 } | 1811 } |
| 1816 | 1812 |
| 1817 voice_channel_->SignalDtlsSetupFailure.connect( | 1813 voice_channel_->SignalDtlsSetupFailure.connect( |
| 1818 this, &WebRtcSession::OnDtlsSetupFailure); | 1814 this, &WebRtcSession::OnDtlsSetupFailure); |
| 1819 | 1815 |
| 1820 SignalVoiceChannelCreated(); | 1816 SignalVoiceChannelCreated(); |
| 1821 voice_channel_->transport_channel()->SignalSentPacket.connect( | 1817 voice_channel_->transport_channel()->SignalSentPacket.connect( |
| 1822 this, &WebRtcSession::OnSentPacket_w); | 1818 this, &WebRtcSession::OnSentPacket_w); |
| 1823 return true; | 1819 return true; |
| 1824 } | 1820 } |
| 1825 | 1821 |
| 1826 bool WebRtcSession::CreateVideoChannel(const cricket::ContentInfo* content) { | 1822 bool WebRtcSession::CreateVideoChannel(const cricket::ContentInfo* content) { |
| 1827 video_channel_.reset(channel_manager_->CreateVideoChannel( | 1823 video_channel_.reset(channel_manager_->CreateVideoChannel( |
| 1828 media_controller_, transport_controller_.get(), content->name, true, | 1824 media_controller_, transport_controller_.get(), content->name, true, |
| 1829 video_options_)); | 1825 channel_options_, video_options_)); |
| 1830 if (!video_channel_) { | 1826 if (!video_channel_) { |
| 1831 return false; | 1827 return false; |
| 1832 } | 1828 } |
| 1833 | 1829 |
| 1834 video_channel_->SignalDtlsSetupFailure.connect( | 1830 video_channel_->SignalDtlsSetupFailure.connect( |
| 1835 this, &WebRtcSession::OnDtlsSetupFailure); | 1831 this, &WebRtcSession::OnDtlsSetupFailure); |
| 1836 | 1832 |
| 1837 SignalVideoChannelCreated(); | 1833 SignalVideoChannelCreated(); |
| 1838 video_channel_->transport_channel()->SignalSentPacket.connect( | 1834 video_channel_->transport_channel()->SignalSentPacket.connect( |
| 1839 this, &WebRtcSession::OnSentPacket_w); | 1835 this, &WebRtcSession::OnSentPacket_w); |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2177 } | 2173 } |
| 2178 } | 2174 } |
| 2179 | 2175 |
| 2180 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, | 2176 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, |
| 2181 const rtc::SentPacket& sent_packet) { | 2177 const rtc::SentPacket& sent_packet) { |
| 2182 RTC_DCHECK(worker_thread()->IsCurrent()); | 2178 RTC_DCHECK(worker_thread()->IsCurrent()); |
| 2183 media_controller_->call_w()->OnSentPacket(sent_packet); | 2179 media_controller_->call_w()->OnSentPacket(sent_packet); |
| 2184 } | 2180 } |
| 2185 | 2181 |
| 2186 } // namespace webrtc | 2182 } // namespace webrtc |
| OLD | NEW |