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

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

Issue 2689503002: Removing unnecessary parameters from CreateXChannel methods. (Closed)
Patch Set: Rebase onto master Created 3 years, 10 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
« no previous file with comments | « webrtc/pc/channelmanager.h ('k') | webrtc/pc/channelmanager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 DestroyVoiceChannel_w(voice_channels_.back()); 201 DestroyVoiceChannel_w(voice_channels_.back());
202 } 202 }
203 } 203 }
204 204
205 VoiceChannel* ChannelManager::CreateVoiceChannel( 205 VoiceChannel* ChannelManager::CreateVoiceChannel(
206 webrtc::MediaControllerInterface* media_controller, 206 webrtc::MediaControllerInterface* media_controller,
207 DtlsTransportInternal* rtp_transport, 207 DtlsTransportInternal* rtp_transport,
208 DtlsTransportInternal* rtcp_transport, 208 DtlsTransportInternal* rtcp_transport,
209 rtc::Thread* signaling_thread, 209 rtc::Thread* signaling_thread,
210 const std::string& content_name, 210 const std::string& content_name,
211 const std::string* bundle_transport_name,
212 bool rtcp_mux_required,
213 bool srtp_required, 211 bool srtp_required,
214 const AudioOptions& options) { 212 const AudioOptions& options) {
215 return worker_thread_->Invoke<VoiceChannel*>( 213 return worker_thread_->Invoke<VoiceChannel*>(
216 RTC_FROM_HERE, 214 RTC_FROM_HERE,
217 Bind(&ChannelManager::CreateVoiceChannel_w, this, media_controller, 215 Bind(&ChannelManager::CreateVoiceChannel_w, this, media_controller,
218 rtp_transport, rtcp_transport, signaling_thread, content_name, 216 rtp_transport, rtcp_transport, signaling_thread, content_name,
219 bundle_transport_name, rtcp_mux_required, srtp_required, options)); 217 srtp_required, options));
220 } 218 }
221 219
222 VoiceChannel* ChannelManager::CreateVoiceChannel_w( 220 VoiceChannel* ChannelManager::CreateVoiceChannel_w(
223 webrtc::MediaControllerInterface* media_controller, 221 webrtc::MediaControllerInterface* media_controller,
224 DtlsTransportInternal* rtp_transport, 222 DtlsTransportInternal* rtp_transport,
225 DtlsTransportInternal* rtcp_transport, 223 DtlsTransportInternal* rtcp_transport,
226 rtc::Thread* signaling_thread, 224 rtc::Thread* signaling_thread,
227 const std::string& content_name, 225 const std::string& content_name,
228 const std::string* bundle_transport_name,
229 bool rtcp_mux_required,
230 bool srtp_required, 226 bool srtp_required,
231 const AudioOptions& options) { 227 const AudioOptions& options) {
232 RTC_DCHECK(initialized_); 228 RTC_DCHECK(initialized_);
233 RTC_DCHECK(worker_thread_ == rtc::Thread::Current()); 229 RTC_DCHECK(worker_thread_ == rtc::Thread::Current());
234 RTC_DCHECK(nullptr != media_controller); 230 RTC_DCHECK(nullptr != media_controller);
235 231
236 VoiceMediaChannel* media_channel = media_engine_->CreateChannel( 232 VoiceMediaChannel* media_channel = media_engine_->CreateChannel(
237 media_controller->call_w(), media_controller->config(), options); 233 media_controller->call_w(), media_controller->config(), options);
238 if (!media_channel) 234 if (!media_channel)
239 return nullptr; 235 return nullptr;
240 236
241 VoiceChannel* voice_channel = new VoiceChannel( 237 VoiceChannel* voice_channel = new VoiceChannel(
242 worker_thread_, network_thread_, signaling_thread, media_engine_.get(), 238 worker_thread_, network_thread_, signaling_thread, media_engine_.get(),
243 media_channel, content_name, rtcp_mux_required, srtp_required); 239 media_channel, content_name, rtcp_transport == nullptr, srtp_required);
244 voice_channel->SetCryptoOptions(crypto_options_); 240 voice_channel->SetCryptoOptions(crypto_options_);
245 241
246 if (!voice_channel->Init_w(rtp_transport, rtcp_transport, rtp_transport, 242 if (!voice_channel->Init_w(rtp_transport, rtcp_transport, rtp_transport,
247 rtcp_transport)) { 243 rtcp_transport)) {
248 delete voice_channel; 244 delete voice_channel;
249 return nullptr; 245 return nullptr;
250 } 246 }
251 voice_channels_.push_back(voice_channel); 247 voice_channels_.push_back(voice_channel);
252 return voice_channel; 248 return voice_channel;
253 } 249 }
(...skipping 20 matching lines...) Expand all
274 voice_channels_.erase(it); 270 voice_channels_.erase(it);
275 delete voice_channel; 271 delete voice_channel;
276 } 272 }
277 273
278 VideoChannel* ChannelManager::CreateVideoChannel( 274 VideoChannel* ChannelManager::CreateVideoChannel(
279 webrtc::MediaControllerInterface* media_controller, 275 webrtc::MediaControllerInterface* media_controller,
280 DtlsTransportInternal* rtp_transport, 276 DtlsTransportInternal* rtp_transport,
281 DtlsTransportInternal* rtcp_transport, 277 DtlsTransportInternal* rtcp_transport,
282 rtc::Thread* signaling_thread, 278 rtc::Thread* signaling_thread,
283 const std::string& content_name, 279 const std::string& content_name,
284 const std::string* bundle_transport_name,
285 bool rtcp_mux_required,
286 bool srtp_required, 280 bool srtp_required,
287 const VideoOptions& options) { 281 const VideoOptions& options) {
288 return worker_thread_->Invoke<VideoChannel*>( 282 return worker_thread_->Invoke<VideoChannel*>(
289 RTC_FROM_HERE, 283 RTC_FROM_HERE,
290 Bind(&ChannelManager::CreateVideoChannel_w, this, media_controller, 284 Bind(&ChannelManager::CreateVideoChannel_w, this, media_controller,
291 rtp_transport, rtcp_transport, signaling_thread, content_name, 285 rtp_transport, rtcp_transport, signaling_thread, content_name,
292 bundle_transport_name, rtcp_mux_required, srtp_required, options)); 286 srtp_required, options));
293 } 287 }
294 288
295 VideoChannel* ChannelManager::CreateVideoChannel_w( 289 VideoChannel* ChannelManager::CreateVideoChannel_w(
296 webrtc::MediaControllerInterface* media_controller, 290 webrtc::MediaControllerInterface* media_controller,
297 DtlsTransportInternal* rtp_transport, 291 DtlsTransportInternal* rtp_transport,
298 DtlsTransportInternal* rtcp_transport, 292 DtlsTransportInternal* rtcp_transport,
299 rtc::Thread* signaling_thread, 293 rtc::Thread* signaling_thread,
300 const std::string& content_name, 294 const std::string& content_name,
301 const std::string* bundle_transport_name,
302 bool rtcp_mux_required,
303 bool srtp_required, 295 bool srtp_required,
304 const VideoOptions& options) { 296 const VideoOptions& options) {
305 RTC_DCHECK(initialized_); 297 RTC_DCHECK(initialized_);
306 RTC_DCHECK(worker_thread_ == rtc::Thread::Current()); 298 RTC_DCHECK(worker_thread_ == rtc::Thread::Current());
307 RTC_DCHECK(nullptr != media_controller); 299 RTC_DCHECK(nullptr != media_controller);
308 VideoMediaChannel* media_channel = media_engine_->CreateVideoChannel( 300 VideoMediaChannel* media_channel = media_engine_->CreateVideoChannel(
309 media_controller->call_w(), media_controller->config(), options); 301 media_controller->call_w(), media_controller->config(), options);
310 if (media_channel == NULL) { 302 if (media_channel == NULL) {
311 return NULL; 303 return NULL;
312 } 304 }
313 305
314 VideoChannel* video_channel = new VideoChannel( 306 VideoChannel* video_channel = new VideoChannel(
315 worker_thread_, network_thread_, signaling_thread, media_channel, 307 worker_thread_, network_thread_, signaling_thread, media_channel,
316 content_name, rtcp_mux_required, srtp_required); 308 content_name, rtcp_transport == nullptr, srtp_required);
317 video_channel->SetCryptoOptions(crypto_options_); 309 video_channel->SetCryptoOptions(crypto_options_);
318 if (!video_channel->Init_w(rtp_transport, rtcp_transport, rtp_transport, 310 if (!video_channel->Init_w(rtp_transport, rtcp_transport, rtp_transport,
319 rtcp_transport)) { 311 rtcp_transport)) {
320 delete video_channel; 312 delete video_channel;
321 return NULL; 313 return NULL;
322 } 314 }
323 video_channels_.push_back(video_channel); 315 video_channels_.push_back(video_channel);
324 return video_channel; 316 return video_channel;
325 } 317 }
326 318
(...skipping 20 matching lines...) Expand all
347 video_channels_.erase(it); 339 video_channels_.erase(it);
348 delete video_channel; 340 delete video_channel;
349 } 341 }
350 342
351 RtpDataChannel* ChannelManager::CreateRtpDataChannel( 343 RtpDataChannel* ChannelManager::CreateRtpDataChannel(
352 webrtc::MediaControllerInterface* media_controller, 344 webrtc::MediaControllerInterface* media_controller,
353 DtlsTransportInternal* rtp_transport, 345 DtlsTransportInternal* rtp_transport,
354 DtlsTransportInternal* rtcp_transport, 346 DtlsTransportInternal* rtcp_transport,
355 rtc::Thread* signaling_thread, 347 rtc::Thread* signaling_thread,
356 const std::string& content_name, 348 const std::string& content_name,
357 const std::string* bundle_transport_name,
358 bool rtcp_mux_required,
359 bool srtp_required) { 349 bool srtp_required) {
360 return worker_thread_->Invoke<RtpDataChannel*>( 350 return worker_thread_->Invoke<RtpDataChannel*>(
361 RTC_FROM_HERE, 351 RTC_FROM_HERE, Bind(&ChannelManager::CreateRtpDataChannel_w, this,
362 Bind(&ChannelManager::CreateRtpDataChannel_w, this, media_controller, 352 media_controller, rtp_transport, rtcp_transport,
363 rtp_transport, rtcp_transport, signaling_thread, content_name, 353 signaling_thread, content_name, srtp_required));
364 bundle_transport_name, rtcp_mux_required, srtp_required));
365 } 354 }
366 355
367 RtpDataChannel* ChannelManager::CreateRtpDataChannel_w( 356 RtpDataChannel* ChannelManager::CreateRtpDataChannel_w(
368 webrtc::MediaControllerInterface* media_controller, 357 webrtc::MediaControllerInterface* media_controller,
369 DtlsTransportInternal* rtp_transport, 358 DtlsTransportInternal* rtp_transport,
370 DtlsTransportInternal* rtcp_transport, 359 DtlsTransportInternal* rtcp_transport,
371 rtc::Thread* signaling_thread, 360 rtc::Thread* signaling_thread,
372 const std::string& content_name, 361 const std::string& content_name,
373 const std::string* bundle_transport_name,
374 bool rtcp_mux_required,
375 bool srtp_required) { 362 bool srtp_required) {
376 // This is ok to alloc from a thread other than the worker thread. 363 // This is ok to alloc from a thread other than the worker thread.
377 RTC_DCHECK(initialized_); 364 RTC_DCHECK(initialized_);
378 MediaConfig config; 365 MediaConfig config;
379 if (media_controller) { 366 if (media_controller) {
380 config = media_controller->config(); 367 config = media_controller->config();
381 } 368 }
382 DataMediaChannel* media_channel = data_media_engine_->CreateChannel(config); 369 DataMediaChannel* media_channel = data_media_engine_->CreateChannel(config);
383 if (!media_channel) { 370 if (!media_channel) {
384 LOG(LS_WARNING) << "Failed to create RTP data channel."; 371 LOG(LS_WARNING) << "Failed to create RTP data channel.";
385 return nullptr; 372 return nullptr;
386 } 373 }
387 374
388 RtpDataChannel* data_channel = new RtpDataChannel( 375 RtpDataChannel* data_channel = new RtpDataChannel(
389 worker_thread_, network_thread_, signaling_thread, media_channel, 376 worker_thread_, network_thread_, signaling_thread, media_channel,
390 content_name, rtcp_mux_required, srtp_required); 377 content_name, rtcp_transport == nullptr, srtp_required);
391 data_channel->SetCryptoOptions(crypto_options_); 378 data_channel->SetCryptoOptions(crypto_options_);
392 if (!data_channel->Init_w(rtp_transport, rtcp_transport, rtp_transport, 379 if (!data_channel->Init_w(rtp_transport, rtcp_transport, rtp_transport,
393 rtcp_transport)) { 380 rtcp_transport)) {
394 LOG(LS_WARNING) << "Failed to init data channel."; 381 LOG(LS_WARNING) << "Failed to init data channel.";
395 delete data_channel; 382 delete data_channel;
396 return nullptr; 383 return nullptr;
397 } 384 }
398 data_channels_.push_back(data_channel); 385 data_channels_.push_back(data_channel);
399 return data_channel; 386 return data_channel;
400 } 387 }
(...skipping 28 matching lines...) Expand all
429 media_engine_.get(), file, max_size_bytes)); 416 media_engine_.get(), file, max_size_bytes));
430 } 417 }
431 418
432 void ChannelManager::StopAecDump() { 419 void ChannelManager::StopAecDump() {
433 worker_thread_->Invoke<void>( 420 worker_thread_->Invoke<void>(
434 RTC_FROM_HERE, 421 RTC_FROM_HERE,
435 Bind(&MediaEngineInterface::StopAecDump, media_engine_.get())); 422 Bind(&MediaEngineInterface::StopAecDump, media_engine_.get()));
436 } 423 }
437 424
438 } // namespace cricket 425 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/pc/channelmanager.h ('k') | webrtc/pc/channelmanager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698