| 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 #include "webrtc/video/video_send_stream.h" | 10 #include "webrtc/video/video_send_stream.h" |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 // arbitrary thread. | 287 // arbitrary thread. |
| 288 class VideoSendStreamImpl : public webrtc::BitrateAllocatorObserver, | 288 class VideoSendStreamImpl : public webrtc::BitrateAllocatorObserver, |
| 289 public webrtc::OverheadObserver, | 289 public webrtc::OverheadObserver, |
| 290 public webrtc::VCMProtectionCallback, | 290 public webrtc::VCMProtectionCallback, |
| 291 public ViEEncoder::EncoderSink { | 291 public ViEEncoder::EncoderSink { |
| 292 public: | 292 public: |
| 293 VideoSendStreamImpl(SendStatisticsProxy* stats_proxy, | 293 VideoSendStreamImpl(SendStatisticsProxy* stats_proxy, |
| 294 rtc::TaskQueue* worker_queue, | 294 rtc::TaskQueue* worker_queue, |
| 295 CallStats* call_stats, | 295 CallStats* call_stats, |
| 296 CongestionController* congestion_controller, | 296 CongestionController* congestion_controller, |
| 297 PacketRouter* packet_router, |
| 297 BitrateAllocator* bitrate_allocator, | 298 BitrateAllocator* bitrate_allocator, |
| 298 SendDelayStats* send_delay_stats, | 299 SendDelayStats* send_delay_stats, |
| 299 VieRemb* remb, | 300 VieRemb* remb, |
| 300 ViEEncoder* vie_encoder, | 301 ViEEncoder* vie_encoder, |
| 301 RtcEventLog* event_log, | 302 RtcEventLog* event_log, |
| 302 const VideoSendStream::Config* config, | 303 const VideoSendStream::Config* config, |
| 303 int initial_encoder_max_bitrate, | 304 int initial_encoder_max_bitrate, |
| 304 std::map<uint32_t, RtpState> suspended_ssrcs); | 305 std::map<uint32_t, RtpState> suspended_ssrcs); |
| 305 ~VideoSendStreamImpl() override; | 306 ~VideoSendStreamImpl() override; |
| 306 | 307 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 ProcessThread* module_process_thread_; | 367 ProcessThread* module_process_thread_; |
| 367 rtc::ThreadChecker module_process_thread_checker_; | 368 rtc::ThreadChecker module_process_thread_checker_; |
| 368 rtc::TaskQueue* const worker_queue_; | 369 rtc::TaskQueue* const worker_queue_; |
| 369 | 370 |
| 370 rtc::CriticalSection encoder_activity_crit_sect_; | 371 rtc::CriticalSection encoder_activity_crit_sect_; |
| 371 CheckEncoderActivityTask* check_encoder_activity_task_ | 372 CheckEncoderActivityTask* check_encoder_activity_task_ |
| 372 GUARDED_BY(encoder_activity_crit_sect_); | 373 GUARDED_BY(encoder_activity_crit_sect_); |
| 373 | 374 |
| 374 CallStats* const call_stats_; | 375 CallStats* const call_stats_; |
| 375 CongestionController* const congestion_controller_; | 376 CongestionController* const congestion_controller_; |
| 377 PacketRouter* const packet_router_; |
| 376 BitrateAllocator* const bitrate_allocator_; | 378 BitrateAllocator* const bitrate_allocator_; |
| 377 VieRemb* const remb_; | 379 VieRemb* const remb_; |
| 378 | 380 |
| 379 // TODO(brandtr): Consider moving this to a new FlexfecSendStream class. | 381 // TODO(brandtr): Consider moving this to a new FlexfecSendStream class. |
| 380 std::unique_ptr<FlexfecSender> flexfec_sender_; | 382 std::unique_ptr<FlexfecSender> flexfec_sender_; |
| 381 | 383 |
| 382 rtc::CriticalSection ivf_writers_crit_; | 384 rtc::CriticalSection ivf_writers_crit_; |
| 383 std::unique_ptr<IvfFileWriter> file_writers_[kMaxSimulcastStreams] GUARDED_BY( | 385 std::unique_ptr<IvfFileWriter> file_writers_[kMaxSimulcastStreams] GUARDED_BY( |
| 384 ivf_writers_crit_); | 386 ivf_writers_crit_); |
| 385 | 387 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 414 // an object on the correct task queue. | 416 // an object on the correct task queue. |
| 415 class VideoSendStream::ConstructionTask : public rtc::QueuedTask { | 417 class VideoSendStream::ConstructionTask : public rtc::QueuedTask { |
| 416 public: | 418 public: |
| 417 ConstructionTask(std::unique_ptr<VideoSendStreamImpl>* send_stream, | 419 ConstructionTask(std::unique_ptr<VideoSendStreamImpl>* send_stream, |
| 418 rtc::Event* done_event, | 420 rtc::Event* done_event, |
| 419 SendStatisticsProxy* stats_proxy, | 421 SendStatisticsProxy* stats_proxy, |
| 420 ViEEncoder* vie_encoder, | 422 ViEEncoder* vie_encoder, |
| 421 ProcessThread* module_process_thread, | 423 ProcessThread* module_process_thread, |
| 422 CallStats* call_stats, | 424 CallStats* call_stats, |
| 423 CongestionController* congestion_controller, | 425 CongestionController* congestion_controller, |
| 426 PacketRouter* packet_router, |
| 424 BitrateAllocator* bitrate_allocator, | 427 BitrateAllocator* bitrate_allocator, |
| 425 SendDelayStats* send_delay_stats, | 428 SendDelayStats* send_delay_stats, |
| 426 VieRemb* remb, | 429 VieRemb* remb, |
| 427 RtcEventLog* event_log, | 430 RtcEventLog* event_log, |
| 428 const VideoSendStream::Config* config, | 431 const VideoSendStream::Config* config, |
| 429 int initial_encoder_max_bitrate, | 432 int initial_encoder_max_bitrate, |
| 430 const std::map<uint32_t, RtpState>& suspended_ssrcs) | 433 const std::map<uint32_t, RtpState>& suspended_ssrcs) |
| 431 : send_stream_(send_stream), | 434 : send_stream_(send_stream), |
| 432 done_event_(done_event), | 435 done_event_(done_event), |
| 433 stats_proxy_(stats_proxy), | 436 stats_proxy_(stats_proxy), |
| 434 vie_encoder_(vie_encoder), | 437 vie_encoder_(vie_encoder), |
| 435 call_stats_(call_stats), | 438 call_stats_(call_stats), |
| 436 congestion_controller_(congestion_controller), | 439 congestion_controller_(congestion_controller), |
| 440 packet_router_(packet_router), |
| 437 bitrate_allocator_(bitrate_allocator), | 441 bitrate_allocator_(bitrate_allocator), |
| 438 send_delay_stats_(send_delay_stats), | 442 send_delay_stats_(send_delay_stats), |
| 439 remb_(remb), | 443 remb_(remb), |
| 440 event_log_(event_log), | 444 event_log_(event_log), |
| 441 config_(config), | 445 config_(config), |
| 442 initial_encoder_max_bitrate_(initial_encoder_max_bitrate), | 446 initial_encoder_max_bitrate_(initial_encoder_max_bitrate), |
| 443 suspended_ssrcs_(suspended_ssrcs) {} | 447 suspended_ssrcs_(suspended_ssrcs) {} |
| 444 | 448 |
| 445 ~ConstructionTask() override { done_event_->Set(); } | 449 ~ConstructionTask() override { done_event_->Set(); } |
| 446 | 450 |
| 447 private: | 451 private: |
| 448 bool Run() override { | 452 bool Run() override { |
| 449 send_stream_->reset(new VideoSendStreamImpl( | 453 send_stream_->reset(new VideoSendStreamImpl( |
| 450 stats_proxy_, rtc::TaskQueue::Current(), call_stats_, | 454 stats_proxy_, rtc::TaskQueue::Current(), call_stats_, |
| 451 congestion_controller_, bitrate_allocator_, send_delay_stats_, remb_, | 455 congestion_controller_, packet_router_, bitrate_allocator_, |
| 452 vie_encoder_, event_log_, config_, initial_encoder_max_bitrate_, | 456 send_delay_stats_, remb_, vie_encoder_, event_log_, config_, |
| 453 std::move(suspended_ssrcs_))); | 457 initial_encoder_max_bitrate_, std::move(suspended_ssrcs_))); |
| 454 return true; | 458 return true; |
| 455 } | 459 } |
| 456 | 460 |
| 457 std::unique_ptr<VideoSendStreamImpl>* const send_stream_; | 461 std::unique_ptr<VideoSendStreamImpl>* const send_stream_; |
| 458 rtc::Event* const done_event_; | 462 rtc::Event* const done_event_; |
| 459 SendStatisticsProxy* const stats_proxy_; | 463 SendStatisticsProxy* const stats_proxy_; |
| 460 ViEEncoder* const vie_encoder_; | 464 ViEEncoder* const vie_encoder_; |
| 461 CallStats* const call_stats_; | 465 CallStats* const call_stats_; |
| 462 CongestionController* const congestion_controller_; | 466 CongestionController* const congestion_controller_; |
| 467 PacketRouter* const packet_router_; |
| 463 BitrateAllocator* const bitrate_allocator_; | 468 BitrateAllocator* const bitrate_allocator_; |
| 464 SendDelayStats* const send_delay_stats_; | 469 SendDelayStats* const send_delay_stats_; |
| 465 VieRemb* const remb_; | 470 VieRemb* const remb_; |
| 466 RtcEventLog* const event_log_; | 471 RtcEventLog* const event_log_; |
| 467 const VideoSendStream::Config* config_; | 472 const VideoSendStream::Config* config_; |
| 468 int initial_encoder_max_bitrate_; | 473 int initial_encoder_max_bitrate_; |
| 469 std::map<uint32_t, RtpState> suspended_ssrcs_; | 474 std::map<uint32_t, RtpState> suspended_ssrcs_; |
| 470 }; | 475 }; |
| 471 | 476 |
| 472 class VideoSendStream::DestructAndGetRtpStateTask : public rtc::QueuedTask { | 477 class VideoSendStream::DestructAndGetRtpStateTask : public rtc::QueuedTask { |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 std::vector<VideoStream> streams_; | 572 std::vector<VideoStream> streams_; |
| 568 int min_transmit_bitrate_bps_; | 573 int min_transmit_bitrate_bps_; |
| 569 }; | 574 }; |
| 570 | 575 |
| 571 VideoSendStream::VideoSendStream( | 576 VideoSendStream::VideoSendStream( |
| 572 int num_cpu_cores, | 577 int num_cpu_cores, |
| 573 ProcessThread* module_process_thread, | 578 ProcessThread* module_process_thread, |
| 574 rtc::TaskQueue* worker_queue, | 579 rtc::TaskQueue* worker_queue, |
| 575 CallStats* call_stats, | 580 CallStats* call_stats, |
| 576 CongestionController* congestion_controller, | 581 CongestionController* congestion_controller, |
| 582 PacketRouter* packet_router, |
| 577 BitrateAllocator* bitrate_allocator, | 583 BitrateAllocator* bitrate_allocator, |
| 578 SendDelayStats* send_delay_stats, | 584 SendDelayStats* send_delay_stats, |
| 579 VieRemb* remb, | 585 VieRemb* remb, |
| 580 RtcEventLog* event_log, | 586 RtcEventLog* event_log, |
| 581 VideoSendStream::Config config, | 587 VideoSendStream::Config config, |
| 582 VideoEncoderConfig encoder_config, | 588 VideoEncoderConfig encoder_config, |
| 583 const std::map<uint32_t, RtpState>& suspended_ssrcs) | 589 const std::map<uint32_t, RtpState>& suspended_ssrcs) |
| 584 : worker_queue_(worker_queue), | 590 : worker_queue_(worker_queue), |
| 585 thread_sync_event_(false /* manual_reset */, false), | 591 thread_sync_event_(false /* manual_reset */, false), |
| 586 stats_proxy_(Clock::GetRealTimeClock(), | 592 stats_proxy_(Clock::GetRealTimeClock(), |
| 587 config, | 593 config, |
| 588 encoder_config.content_type), | 594 encoder_config.content_type), |
| 589 config_(std::move(config)) { | 595 config_(std::move(config)) { |
| 590 vie_encoder_.reset(new ViEEncoder( | 596 vie_encoder_.reset(new ViEEncoder( |
| 591 num_cpu_cores, &stats_proxy_, config_.encoder_settings, | 597 num_cpu_cores, &stats_proxy_, config_.encoder_settings, |
| 592 config_.pre_encode_callback, config_.post_encode_callback)); | 598 config_.pre_encode_callback, config_.post_encode_callback)); |
| 593 | 599 |
| 594 worker_queue_->PostTask(std::unique_ptr<rtc::QueuedTask>(new ConstructionTask( | 600 worker_queue_->PostTask(std::unique_ptr<rtc::QueuedTask>(new ConstructionTask( |
| 595 &send_stream_, &thread_sync_event_, &stats_proxy_, vie_encoder_.get(), | 601 &send_stream_, &thread_sync_event_, &stats_proxy_, vie_encoder_.get(), |
| 596 module_process_thread, call_stats, congestion_controller, | 602 module_process_thread, call_stats, congestion_controller, packet_router, |
| 597 bitrate_allocator, send_delay_stats, remb, event_log, &config_, | 603 bitrate_allocator, send_delay_stats, remb, event_log, &config_, |
| 598 encoder_config.max_bitrate_bps, suspended_ssrcs))); | 604 encoder_config.max_bitrate_bps, suspended_ssrcs))); |
| 599 | 605 |
| 600 // Wait for ConstructionTask to complete so that |send_stream_| can be used. | 606 // Wait for ConstructionTask to complete so that |send_stream_| can be used. |
| 601 // |module_process_thread| must be registered and deregistered on the thread | 607 // |module_process_thread| must be registered and deregistered on the thread |
| 602 // it was created on. | 608 // it was created on. |
| 603 thread_sync_event_.Wait(rtc::Event::kForever); | 609 thread_sync_event_.Wait(rtc::Event::kForever); |
| 604 send_stream_->RegisterProcessThread(module_process_thread); | 610 send_stream_->RegisterProcessThread(module_process_thread); |
| 605 | 611 |
| 606 vie_encoder_->RegisterProcessThread(module_process_thread); | 612 vie_encoder_->RegisterProcessThread(module_process_thread); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 const std::vector<rtc::PlatformFile>& files, | 700 const std::vector<rtc::PlatformFile>& files, |
| 695 size_t byte_limit) { | 701 size_t byte_limit) { |
| 696 send_stream_->EnableEncodedFrameRecording(files, byte_limit); | 702 send_stream_->EnableEncodedFrameRecording(files, byte_limit); |
| 697 } | 703 } |
| 698 | 704 |
| 699 VideoSendStreamImpl::VideoSendStreamImpl( | 705 VideoSendStreamImpl::VideoSendStreamImpl( |
| 700 SendStatisticsProxy* stats_proxy, | 706 SendStatisticsProxy* stats_proxy, |
| 701 rtc::TaskQueue* worker_queue, | 707 rtc::TaskQueue* worker_queue, |
| 702 CallStats* call_stats, | 708 CallStats* call_stats, |
| 703 CongestionController* congestion_controller, | 709 CongestionController* congestion_controller, |
| 710 PacketRouter* packet_router, |
| 704 BitrateAllocator* bitrate_allocator, | 711 BitrateAllocator* bitrate_allocator, |
| 705 SendDelayStats* send_delay_stats, | 712 SendDelayStats* send_delay_stats, |
| 706 VieRemb* remb, | 713 VieRemb* remb, |
| 707 ViEEncoder* vie_encoder, | 714 ViEEncoder* vie_encoder, |
| 708 RtcEventLog* event_log, | 715 RtcEventLog* event_log, |
| 709 const VideoSendStream::Config* config, | 716 const VideoSendStream::Config* config, |
| 710 int initial_encoder_max_bitrate, | 717 int initial_encoder_max_bitrate, |
| 711 std::map<uint32_t, RtpState> suspended_ssrcs) | 718 std::map<uint32_t, RtpState> suspended_ssrcs) |
| 712 : stats_proxy_(stats_proxy), | 719 : stats_proxy_(stats_proxy), |
| 713 config_(config), | 720 config_(config), |
| 714 suspended_ssrcs_(std::move(suspended_ssrcs)), | 721 suspended_ssrcs_(std::move(suspended_ssrcs)), |
| 715 module_process_thread_(nullptr), | 722 module_process_thread_(nullptr), |
| 716 worker_queue_(worker_queue), | 723 worker_queue_(worker_queue), |
| 717 check_encoder_activity_task_(nullptr), | 724 check_encoder_activity_task_(nullptr), |
| 718 call_stats_(call_stats), | 725 call_stats_(call_stats), |
| 719 congestion_controller_(congestion_controller), | 726 congestion_controller_(congestion_controller), |
| 727 packet_router_(packet_router), |
| 720 bitrate_allocator_(bitrate_allocator), | 728 bitrate_allocator_(bitrate_allocator), |
| 721 remb_(remb), | 729 remb_(remb), |
| 722 flexfec_sender_(MaybeCreateFlexfecSender(*config_)), | 730 flexfec_sender_(MaybeCreateFlexfecSender(*config_)), |
| 723 max_padding_bitrate_(0), | 731 max_padding_bitrate_(0), |
| 724 encoder_min_bitrate_bps_(0), | 732 encoder_min_bitrate_bps_(0), |
| 725 encoder_max_bitrate_bps_(initial_encoder_max_bitrate), | 733 encoder_max_bitrate_bps_(initial_encoder_max_bitrate), |
| 726 encoder_target_rate_bps_(0), | 734 encoder_target_rate_bps_(0), |
| 727 vie_encoder_(vie_encoder), | 735 vie_encoder_(vie_encoder), |
| 728 encoder_feedback_(Clock::GetRealTimeClock(), | 736 encoder_feedback_(Clock::GetRealTimeClock(), |
| 729 config_->rtp.ssrcs, | 737 config_->rtp.ssrcs, |
| 730 vie_encoder), | 738 vie_encoder), |
| 731 protection_bitrate_calculator_(Clock::GetRealTimeClock(), this), | 739 protection_bitrate_calculator_(Clock::GetRealTimeClock(), this), |
| 732 bandwidth_observer_(congestion_controller_->GetBitrateController() | 740 bandwidth_observer_(congestion_controller_->GetBitrateController() |
| 733 ->CreateRtcpBandwidthObserver()), | 741 ->CreateRtcpBandwidthObserver()), |
| 734 rtp_rtcp_modules_(CreateRtpRtcpModules( | 742 rtp_rtcp_modules_(CreateRtpRtcpModules( |
| 735 config_->send_transport, | 743 config_->send_transport, |
| 736 &encoder_feedback_, | 744 &encoder_feedback_, |
| 737 bandwidth_observer_.get(), | 745 bandwidth_observer_.get(), |
| 738 congestion_controller_->GetTransportFeedbackObserver(), | 746 congestion_controller_->GetTransportFeedbackObserver(), |
| 739 call_stats_->rtcp_rtt_stats(), | 747 call_stats_->rtcp_rtt_stats(), |
| 740 congestion_controller_->pacer(), | 748 congestion_controller_->pacer(), |
| 741 congestion_controller_->packet_router(), | 749 packet_router_, |
| 742 flexfec_sender_.get(), | 750 flexfec_sender_.get(), |
| 743 stats_proxy_, | 751 stats_proxy_, |
| 744 send_delay_stats, | 752 send_delay_stats, |
| 745 event_log, | 753 event_log, |
| 746 congestion_controller_->GetRetransmissionRateLimiter(), | 754 congestion_controller_->GetRetransmissionRateLimiter(), |
| 747 this, | 755 this, |
| 748 config_->rtp.ssrcs.size())), | 756 config_->rtp.ssrcs.size())), |
| 749 payload_router_(rtp_rtcp_modules_, | 757 payload_router_(rtp_rtcp_modules_, |
| 750 config_->encoder_settings.payload_type), | 758 config_->encoder_settings.payload_type), |
| 751 weak_ptr_factory_(this), | 759 weak_ptr_factory_(this), |
| 752 overhead_bytes_per_packet_(0), | 760 overhead_bytes_per_packet_(0), |
| 753 transport_overhead_bytes_per_packet_(0) { | 761 transport_overhead_bytes_per_packet_(0) { |
| 754 RTC_DCHECK_RUN_ON(worker_queue_); | 762 RTC_DCHECK_RUN_ON(worker_queue_); |
| 755 LOG(LS_INFO) << "VideoSendStreamInternal: " << config_->ToString(); | 763 LOG(LS_INFO) << "VideoSendStreamInternal: " << config_->ToString(); |
| 756 weak_ptr_ = weak_ptr_factory_.GetWeakPtr(); | 764 weak_ptr_ = weak_ptr_factory_.GetWeakPtr(); |
| 757 module_process_thread_checker_.DetachFromThread(); | 765 module_process_thread_checker_.DetachFromThread(); |
| 758 | 766 |
| 759 RTC_DCHECK(!config_->rtp.ssrcs.empty()); | 767 RTC_DCHECK(!config_->rtp.ssrcs.empty()); |
| 760 RTC_DCHECK(call_stats_); | 768 RTC_DCHECK(call_stats_); |
| 761 RTC_DCHECK(congestion_controller_); | 769 RTC_DCHECK(congestion_controller_); |
| 762 RTC_DCHECK(remb_); | 770 RTC_DCHECK(remb_); |
| 763 | 771 |
| 764 congestion_controller_->EnablePeriodicAlrProbing( | 772 congestion_controller_->EnablePeriodicAlrProbing( |
| 765 config_->periodic_alr_bandwidth_probing); | 773 config_->periodic_alr_bandwidth_probing); |
| 766 | 774 |
| 767 // RTP/RTCP initialization. | 775 // RTP/RTCP initialization. |
| 768 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { | 776 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { |
| 769 congestion_controller_->packet_router()->AddRtpModule(rtp_rtcp); | 777 packet_router_->AddRtpModule(rtp_rtcp); |
| 770 } | 778 } |
| 771 | 779 |
| 772 for (size_t i = 0; i < config_->rtp.extensions.size(); ++i) { | 780 for (size_t i = 0; i < config_->rtp.extensions.size(); ++i) { |
| 773 const std::string& extension = config_->rtp.extensions[i].uri; | 781 const std::string& extension = config_->rtp.extensions[i].uri; |
| 774 int id = config_->rtp.extensions[i].id; | 782 int id = config_->rtp.extensions[i].id; |
| 775 // One-byte-extension local identifiers are in the range 1-14 inclusive. | 783 // One-byte-extension local identifiers are in the range 1-14 inclusive. |
| 776 RTC_DCHECK_GE(id, 1); | 784 RTC_DCHECK_GE(id, 1); |
| 777 RTC_DCHECK_LE(id, 14); | 785 RTC_DCHECK_LE(id, 14); |
| 778 RTC_DCHECK(RtpExtension::IsSupportedForVideo(extension)); | 786 RTC_DCHECK(RtpExtension::IsSupportedForVideo(extension)); |
| 779 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { | 787 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 VideoSendStreamImpl::~VideoSendStreamImpl() { | 848 VideoSendStreamImpl::~VideoSendStreamImpl() { |
| 841 RTC_DCHECK_RUN_ON(worker_queue_); | 849 RTC_DCHECK_RUN_ON(worker_queue_); |
| 842 RTC_DCHECK(!payload_router_.active()) | 850 RTC_DCHECK(!payload_router_.active()) |
| 843 << "VideoSendStreamImpl::Stop not called"; | 851 << "VideoSendStreamImpl::Stop not called"; |
| 844 LOG(LS_INFO) << "~VideoSendStreamInternal: " << config_->ToString(); | 852 LOG(LS_INFO) << "~VideoSendStreamInternal: " << config_->ToString(); |
| 845 | 853 |
| 846 rtp_rtcp_modules_[0]->SetREMBStatus(false); | 854 rtp_rtcp_modules_[0]->SetREMBStatus(false); |
| 847 remb_->RemoveRembSender(rtp_rtcp_modules_[0]); | 855 remb_->RemoveRembSender(rtp_rtcp_modules_[0]); |
| 848 | 856 |
| 849 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { | 857 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { |
| 850 congestion_controller_->packet_router()->RemoveRtpModule(rtp_rtcp); | 858 packet_router_->RemoveRtpModule(rtp_rtcp); |
| 851 delete rtp_rtcp; | 859 delete rtp_rtcp; |
| 852 } | 860 } |
| 853 } | 861 } |
| 854 | 862 |
| 855 bool VideoSendStreamImpl::DeliverRtcp(const uint8_t* packet, size_t length) { | 863 bool VideoSendStreamImpl::DeliverRtcp(const uint8_t* packet, size_t length) { |
| 856 // Runs on a network thread. | 864 // Runs on a network thread. |
| 857 RTC_DCHECK(!worker_queue_->IsCurrent()); | 865 RTC_DCHECK(!worker_queue_->IsCurrent()); |
| 858 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) | 866 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) |
| 859 rtp_rtcp->IncomingRtcpPacket(packet, length); | 867 rtp_rtcp->IncomingRtcpPacket(packet, length); |
| 860 return true; | 868 return true; |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1250 const uint16_t mtu = static_cast<uint16_t>( | 1258 const uint16_t mtu = static_cast<uint16_t>( |
| 1251 config_->rtp.max_packet_size + transport_overhead_bytes_per_packet); | 1259 config_->rtp.max_packet_size + transport_overhead_bytes_per_packet); |
| 1252 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { | 1260 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { |
| 1253 rtp_rtcp->SetTransportOverhead(transport_overhead_bytes_per_packet); | 1261 rtp_rtcp->SetTransportOverhead(transport_overhead_bytes_per_packet); |
| 1254 rtp_rtcp->SetMaxTransferUnit(mtu); | 1262 rtp_rtcp->SetMaxTransferUnit(mtu); |
| 1255 } | 1263 } |
| 1256 } | 1264 } |
| 1257 | 1265 |
| 1258 } // namespace internal | 1266 } // namespace internal |
| 1259 } // namespace webrtc | 1267 } // namespace webrtc |
| OLD | NEW |