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

Side by Side Diff: webrtc/pc/channel.cc

Issue 2537343003: Removing "crypto_required" from MediaContentDescription. (Closed)
Patch Set: Created 4 years 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 * 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 RtpSendParameters<Codec>* send_params) { 157 RtpSendParameters<Codec>* send_params) {
158 RtpParametersFromMediaDescription(desc, send_params); 158 RtpParametersFromMediaDescription(desc, send_params);
159 send_params->max_bandwidth_bps = desc->bandwidth(); 159 send_params->max_bandwidth_bps = desc->bandwidth();
160 } 160 }
161 161
162 BaseChannel::BaseChannel(rtc::Thread* worker_thread, 162 BaseChannel::BaseChannel(rtc::Thread* worker_thread,
163 rtc::Thread* network_thread, 163 rtc::Thread* network_thread,
164 MediaChannel* media_channel, 164 MediaChannel* media_channel,
165 TransportController* transport_controller, 165 TransportController* transport_controller,
166 const std::string& content_name, 166 const std::string& content_name,
167 bool rtcp) 167 bool rtcp,
168 bool secure_required)
168 : worker_thread_(worker_thread), 169 : worker_thread_(worker_thread),
169 network_thread_(network_thread), 170 network_thread_(network_thread),
170 171
171 content_name_(content_name), 172 content_name_(content_name),
172 173
173 transport_controller_(transport_controller), 174 transport_controller_(transport_controller),
174 rtcp_enabled_(rtcp), 175 rtcp_enabled_(rtcp),
176 secure_required_(secure_required),
175 media_channel_(media_channel), 177 media_channel_(media_channel),
176 selected_candidate_pair_(nullptr) { 178 selected_candidate_pair_(nullptr) {
177 RTC_DCHECK(worker_thread_ == rtc::Thread::Current()); 179 RTC_DCHECK(worker_thread_ == rtc::Thread::Current());
178 if (transport_controller) { 180 if (transport_controller) {
179 RTC_DCHECK_EQ(network_thread, transport_controller->network_thread()); 181 RTC_DCHECK_EQ(network_thread, transport_controller->network_thread());
180 } 182 }
181 LOG(LS_INFO) << "Created channel for " << content_name; 183 LOG(LS_INFO) << "Created channel for " << content_name;
182 } 184 }
183 185
184 BaseChannel::~BaseChannel() { 186 BaseChannel::~BaseChannel() {
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 content, action, src, error_desc)); 1093 content, action, src, error_desc));
1092 } 1094 }
1093 1095
1094 bool BaseChannel::SetRtpTransportParameters_n( 1096 bool BaseChannel::SetRtpTransportParameters_n(
1095 const MediaContentDescription* content, 1097 const MediaContentDescription* content,
1096 ContentAction action, 1098 ContentAction action,
1097 ContentSource src, 1099 ContentSource src,
1098 std::string* error_desc) { 1100 std::string* error_desc) {
1099 RTC_DCHECK(network_thread_->IsCurrent()); 1101 RTC_DCHECK(network_thread_->IsCurrent());
1100 1102
1101 if (src == CS_LOCAL) {
1102 set_secure_required(content->crypto_required() != CT_NONE);
1103 }
1104
1105 if (!SetSrtp_n(content->cryptos(), action, src, error_desc)) { 1103 if (!SetSrtp_n(content->cryptos(), action, src, error_desc)) {
1106 return false; 1104 return false;
1107 } 1105 }
1108 1106
1109 if (!SetRtcpMux_n(content->rtcp_mux(), action, src, error_desc)) { 1107 if (!SetRtcpMux_n(content->rtcp_mux(), action, src, error_desc)) {
1110 return false; 1108 return false;
1111 } 1109 }
1112 1110
1113 return true; 1111 return true;
1114 } 1112 }
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
1463 RTC_DCHECK(worker_thread_->IsCurrent()); 1461 RTC_DCHECK(worker_thread_->IsCurrent());
1464 SignalSentPacket(sent_packet); 1462 SignalSentPacket(sent_packet);
1465 } 1463 }
1466 1464
1467 VoiceChannel::VoiceChannel(rtc::Thread* worker_thread, 1465 VoiceChannel::VoiceChannel(rtc::Thread* worker_thread,
1468 rtc::Thread* network_thread, 1466 rtc::Thread* network_thread,
1469 MediaEngineInterface* media_engine, 1467 MediaEngineInterface* media_engine,
1470 VoiceMediaChannel* media_channel, 1468 VoiceMediaChannel* media_channel,
1471 TransportController* transport_controller, 1469 TransportController* transport_controller,
1472 const std::string& content_name, 1470 const std::string& content_name,
1473 bool rtcp) 1471 bool rtcp,
1472 bool secure_required)
1474 : BaseChannel(worker_thread, 1473 : BaseChannel(worker_thread,
1475 network_thread, 1474 network_thread,
1476 media_channel, 1475 media_channel,
1477 transport_controller, 1476 transport_controller,
1478 content_name, 1477 content_name,
1479 rtcp), 1478 rtcp,
1479 secure_required),
1480 media_engine_(media_engine), 1480 media_engine_(media_engine),
1481 received_media_(false) {} 1481 received_media_(false) {}
1482 1482
1483 VoiceChannel::~VoiceChannel() { 1483 VoiceChannel::~VoiceChannel() {
1484 TRACE_EVENT0("webrtc", "VoiceChannel::~VoiceChannel"); 1484 TRACE_EVENT0("webrtc", "VoiceChannel::~VoiceChannel");
1485 StopAudioMonitor(); 1485 StopAudioMonitor();
1486 StopMediaMonitor(); 1486 StopMediaMonitor();
1487 // this can't be done in the base class, since it calls a virtual 1487 // this can't be done in the base class, since it calls a virtual
1488 DisableMedia_w(); 1488 DisableMedia_w();
1489 Deinit(); 1489 Deinit();
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
1876 void VoiceChannel::GetSrtpCryptoSuites_n( 1876 void VoiceChannel::GetSrtpCryptoSuites_n(
1877 std::vector<int>* crypto_suites) const { 1877 std::vector<int>* crypto_suites) const {
1878 GetSupportedAudioCryptoSuites(crypto_options(), crypto_suites); 1878 GetSupportedAudioCryptoSuites(crypto_options(), crypto_suites);
1879 } 1879 }
1880 1880
1881 VideoChannel::VideoChannel(rtc::Thread* worker_thread, 1881 VideoChannel::VideoChannel(rtc::Thread* worker_thread,
1882 rtc::Thread* network_thread, 1882 rtc::Thread* network_thread,
1883 VideoMediaChannel* media_channel, 1883 VideoMediaChannel* media_channel,
1884 TransportController* transport_controller, 1884 TransportController* transport_controller,
1885 const std::string& content_name, 1885 const std::string& content_name,
1886 bool rtcp) 1886 bool rtcp,
1887 bool secure_required)
1887 : BaseChannel(worker_thread, 1888 : BaseChannel(worker_thread,
1888 network_thread, 1889 network_thread,
1889 media_channel, 1890 media_channel,
1890 transport_controller, 1891 transport_controller,
1891 content_name, 1892 content_name,
1892 rtcp) {} 1893 rtcp,
1894 secure_required) {}
1893 1895
1894 bool VideoChannel::Init_w(const std::string* bundle_transport_name) { 1896 bool VideoChannel::Init_w(const std::string* bundle_transport_name) {
1895 if (!BaseChannel::Init_w(bundle_transport_name)) { 1897 if (!BaseChannel::Init_w(bundle_transport_name)) {
1896 return false; 1898 return false;
1897 } 1899 }
1898 return true; 1900 return true;
1899 } 1901 }
1900 1902
1901 VideoChannel::~VideoChannel() { 1903 VideoChannel::~VideoChannel() {
1902 TRACE_EVENT0("webrtc", "VideoChannel::~VideoChannel"); 1904 TRACE_EVENT0("webrtc", "VideoChannel::~VideoChannel");
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
2137 void VideoChannel::GetSrtpCryptoSuites_n( 2139 void VideoChannel::GetSrtpCryptoSuites_n(
2138 std::vector<int>* crypto_suites) const { 2140 std::vector<int>* crypto_suites) const {
2139 GetSupportedVideoCryptoSuites(crypto_options(), crypto_suites); 2141 GetSupportedVideoCryptoSuites(crypto_options(), crypto_suites);
2140 } 2142 }
2141 2143
2142 DataChannel::DataChannel(rtc::Thread* worker_thread, 2144 DataChannel::DataChannel(rtc::Thread* worker_thread,
2143 rtc::Thread* network_thread, 2145 rtc::Thread* network_thread,
2144 DataMediaChannel* media_channel, 2146 DataMediaChannel* media_channel,
2145 TransportController* transport_controller, 2147 TransportController* transport_controller,
2146 const std::string& content_name, 2148 const std::string& content_name,
2147 bool rtcp) 2149 bool rtcp,
2150 bool secure_required)
2148 : BaseChannel(worker_thread, 2151 : BaseChannel(worker_thread,
2149 network_thread, 2152 network_thread,
2150 media_channel, 2153 media_channel,
2151 transport_controller, 2154 transport_controller,
2152 content_name, 2155 content_name,
2153 rtcp), 2156 rtcp,
2157 secure_required),
2154 data_channel_type_(cricket::DCT_NONE), 2158 data_channel_type_(cricket::DCT_NONE),
2155 ready_to_send_data_(false) {} 2159 ready_to_send_data_(false) {}
2156 2160
2157 DataChannel::~DataChannel() { 2161 DataChannel::~DataChannel() {
2158 TRACE_EVENT0("webrtc", "DataChannel::~DataChannel"); 2162 TRACE_EVENT0("webrtc", "DataChannel::~DataChannel");
2159 StopMediaMonitor(); 2163 StopMediaMonitor();
2160 // this can't be done in the base class, since it calls a virtual 2164 // this can't be done in the base class, since it calls a virtual
2161 DisableMedia_w(); 2165 DisableMedia_w();
2162 2166
2163 Deinit(); 2167 Deinit();
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
2457 } 2461 }
2458 2462
2459 void DataChannel::OnStreamClosedRemotely(uint32_t sid) { 2463 void DataChannel::OnStreamClosedRemotely(uint32_t sid) {
2460 rtc::TypedMessageData<uint32_t>* message = 2464 rtc::TypedMessageData<uint32_t>* message =
2461 new rtc::TypedMessageData<uint32_t>(sid); 2465 new rtc::TypedMessageData<uint32_t>(sid);
2462 signaling_thread()->Post(RTC_FROM_HERE, this, MSG_STREAMCLOSEDREMOTELY, 2466 signaling_thread()->Post(RTC_FROM_HERE, this, MSG_STREAMCLOSEDREMOTELY,
2463 message); 2467 message);
2464 } 2468 }
2465 2469
2466 } // namespace cricket 2470 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698