OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 vie_encoder_( | 375 vie_encoder_( |
376 num_cpu_cores, | 376 num_cpu_cores, |
377 config_.rtp.ssrcs, | 377 config_.rtp.ssrcs, |
378 module_process_thread_, | 378 module_process_thread_, |
379 &stats_proxy_, | 379 &stats_proxy_, |
380 config.pre_encode_callback, | 380 config.pre_encode_callback, |
381 &overuse_detector_, | 381 &overuse_detector_, |
382 congestion_controller_->pacer(), | 382 congestion_controller_->pacer(), |
383 &payload_router_, | 383 &payload_router_, |
384 config.post_encode_callback ? &encoded_frame_proxy_ : nullptr), | 384 config.post_encode_callback ? &encoded_frame_proxy_ : nullptr), |
385 vcm_(vie_encoder_.vcm()), | 385 video_sender_(vie_encoder_.video_sender()), |
386 bandwidth_observer_(congestion_controller_->GetBitrateController() | 386 bandwidth_observer_(congestion_controller_->GetBitrateController() |
387 ->CreateRtcpBandwidthObserver()), | 387 ->CreateRtcpBandwidthObserver()), |
388 rtp_rtcp_modules_(CreateRtpRtcpModules( | 388 rtp_rtcp_modules_(CreateRtpRtcpModules( |
389 config.send_transport, | 389 config.send_transport, |
390 &encoder_feedback_, | 390 &encoder_feedback_, |
391 bandwidth_observer_.get(), | 391 bandwidth_observer_.get(), |
392 congestion_controller_->GetTransportFeedbackObserver(), | 392 congestion_controller_->GetTransportFeedbackObserver(), |
393 call_stats_->rtcp_rtt_stats(), | 393 call_stats_->rtcp_rtt_stats(), |
394 congestion_controller_->pacer(), | 394 congestion_controller_->pacer(), |
395 congestion_controller_->packet_router(), | 395 congestion_controller_->packet_router(), |
(...skipping 14 matching lines...) Expand all Loading... |
410 | 410 |
411 RTC_CHECK(vie_encoder_.Init()); | 411 RTC_CHECK(vie_encoder_.Init()); |
412 encoder_feedback_.Init(config_.rtp.ssrcs, &vie_encoder_); | 412 encoder_feedback_.Init(config_.rtp.ssrcs, &vie_encoder_); |
413 | 413 |
414 // RTP/RTCP initialization. | 414 // RTP/RTCP initialization. |
415 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { | 415 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { |
416 module_process_thread_->RegisterModule(rtp_rtcp); | 416 module_process_thread_->RegisterModule(rtp_rtcp); |
417 congestion_controller_->packet_router()->AddRtpModule(rtp_rtcp); | 417 congestion_controller_->packet_router()->AddRtpModule(rtp_rtcp); |
418 } | 418 } |
419 | 419 |
420 vcm_->RegisterProtectionCallback(this); | 420 video_sender_->RegisterProtectionCallback(this); |
421 | 421 |
422 for (size_t i = 0; i < config_.rtp.extensions.size(); ++i) { | 422 for (size_t i = 0; i < config_.rtp.extensions.size(); ++i) { |
423 const std::string& extension = config_.rtp.extensions[i].name; | 423 const std::string& extension = config_.rtp.extensions[i].name; |
424 int id = config_.rtp.extensions[i].id; | 424 int id = config_.rtp.extensions[i].id; |
425 // One-byte-extension local identifiers are in the range 1-14 inclusive. | 425 // One-byte-extension local identifiers are in the range 1-14 inclusive. |
426 RTC_DCHECK_GE(id, 1); | 426 RTC_DCHECK_GE(id, 1); |
427 RTC_DCHECK_LE(id, 14); | 427 RTC_DCHECK_LE(id, 14); |
428 RTC_DCHECK(RtpExtension::IsSupportedForVideo(extension)); | 428 RTC_DCHECK(RtpExtension::IsSupportedForVideo(extension)); |
429 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { | 429 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { |
430 RTC_CHECK_EQ(0, rtp_rtcp->RegisterSendRtpHeaderExtension( | 430 RTC_CHECK_EQ(0, rtp_rtcp->RegisterSendRtpHeaderExtension( |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 } | 540 } |
541 if (encoder_settings) { | 541 if (encoder_settings) { |
542 encoder_settings->video_codec.startBitrate = | 542 encoder_settings->video_codec.startBitrate = |
543 bitrate_allocator_->AddObserver( | 543 bitrate_allocator_->AddObserver( |
544 this, encoder_settings->video_codec.minBitrate * 1000, | 544 this, encoder_settings->video_codec.minBitrate * 1000, |
545 encoder_settings->video_codec.maxBitrate * 1000) / | 545 encoder_settings->video_codec.maxBitrate * 1000) / |
546 1000; | 546 1000; |
547 vie_encoder_.SetEncoder(encoder_settings->video_codec, | 547 vie_encoder_.SetEncoder(encoder_settings->video_codec, |
548 encoder_settings->min_transmit_bitrate_bps); | 548 encoder_settings->min_transmit_bitrate_bps); |
549 if (config_.suspend_below_min_bitrate) { | 549 if (config_.suspend_below_min_bitrate) { |
550 vcm_->SuspendBelowMinBitrate(); | 550 video_sender_->SuspendBelowMinBitrate(); |
551 bitrate_allocator_->EnforceMinBitrate(false); | 551 bitrate_allocator_->EnforceMinBitrate(false); |
552 } | 552 } |
553 // We might've gotten new settings while configuring the encoder settings, | 553 // We might've gotten new settings while configuring the encoder settings, |
554 // restart from the top to see if that's the case before trying to encode | 554 // restart from the top to see if that's the case before trying to encode |
555 // a frame (which might correspond to the last frame size). | 555 // a frame (which might correspond to the last frame size). |
556 encoder_wakeup_event_.Set(); | 556 encoder_wakeup_event_.Set(); |
557 continue; | 557 continue; |
558 } | 558 } |
559 | 559 |
560 VideoFrame frame; | 560 VideoFrame frame; |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 &module_nack_rate); | 757 &module_nack_rate); |
758 *sent_video_rate_bps += module_video_rate; | 758 *sent_video_rate_bps += module_video_rate; |
759 *sent_nack_rate_bps += module_nack_rate; | 759 *sent_nack_rate_bps += module_nack_rate; |
760 *sent_fec_rate_bps += module_fec_rate; | 760 *sent_fec_rate_bps += module_fec_rate; |
761 } | 761 } |
762 return 0; | 762 return 0; |
763 } | 763 } |
764 | 764 |
765 } // namespace internal | 765 } // namespace internal |
766 } // namespace webrtc | 766 } // namespace webrtc |
OLD | NEW |