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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 Transport* outgoing_transport, | 45 Transport* outgoing_transport, |
46 RtcpIntraFrameObserver* intra_frame_callback, | 46 RtcpIntraFrameObserver* intra_frame_callback, |
47 RtcpBandwidthObserver* bandwidth_callback, | 47 RtcpBandwidthObserver* bandwidth_callback, |
48 TransportFeedbackObserver* transport_feedback_callback, | 48 TransportFeedbackObserver* transport_feedback_callback, |
49 RtcpRttStats* rtt_stats, | 49 RtcpRttStats* rtt_stats, |
50 RtpPacketSender* paced_sender, | 50 RtpPacketSender* paced_sender, |
51 TransportSequenceNumberAllocator* transport_sequence_number_allocator, | 51 TransportSequenceNumberAllocator* transport_sequence_number_allocator, |
52 SendStatisticsProxy* stats_proxy, | 52 SendStatisticsProxy* stats_proxy, |
53 SendDelayStats* send_delay_stats, | 53 SendDelayStats* send_delay_stats, |
54 RtcEventLog* event_log, | 54 RtcEventLog* event_log, |
55 RateLimiter* retransmission_rate_limiter, | |
56 size_t num_modules) { | 55 size_t num_modules) { |
57 RTC_DCHECK_GT(num_modules, 0u); | 56 RTC_DCHECK_GT(num_modules, 0u); |
58 RtpRtcp::Configuration configuration; | 57 RtpRtcp::Configuration configuration; |
59 ReceiveStatistics* null_receive_statistics = configuration.receive_statistics; | 58 ReceiveStatistics* null_receive_statistics = configuration.receive_statistics; |
60 configuration.audio = false; | 59 configuration.audio = false; |
61 configuration.receiver_only = false; | 60 configuration.receiver_only = false; |
62 configuration.receive_statistics = null_receive_statistics; | 61 configuration.receive_statistics = null_receive_statistics; |
63 configuration.outgoing_transport = outgoing_transport; | 62 configuration.outgoing_transport = outgoing_transport; |
64 configuration.intra_frame_callback = intra_frame_callback; | 63 configuration.intra_frame_callback = intra_frame_callback; |
65 configuration.bandwidth_callback = bandwidth_callback; | 64 configuration.bandwidth_callback = bandwidth_callback; |
66 configuration.transport_feedback_callback = transport_feedback_callback; | 65 configuration.transport_feedback_callback = transport_feedback_callback; |
67 configuration.rtt_stats = rtt_stats; | 66 configuration.rtt_stats = rtt_stats; |
68 configuration.rtcp_packet_type_counter_observer = stats_proxy; | 67 configuration.rtcp_packet_type_counter_observer = stats_proxy; |
69 configuration.paced_sender = paced_sender; | 68 configuration.paced_sender = paced_sender; |
70 configuration.transport_sequence_number_allocator = | 69 configuration.transport_sequence_number_allocator = |
71 transport_sequence_number_allocator; | 70 transport_sequence_number_allocator; |
72 configuration.send_bitrate_observer = stats_proxy; | 71 configuration.send_bitrate_observer = stats_proxy; |
73 configuration.send_frame_count_observer = stats_proxy; | 72 configuration.send_frame_count_observer = stats_proxy; |
74 configuration.send_side_delay_observer = stats_proxy; | 73 configuration.send_side_delay_observer = stats_proxy; |
75 configuration.send_packet_observer = send_delay_stats; | 74 configuration.send_packet_observer = send_delay_stats; |
76 configuration.event_log = event_log; | 75 configuration.event_log = event_log; |
77 configuration.retransmission_rate_limiter = retransmission_rate_limiter; | |
78 | 76 |
79 std::vector<RtpRtcp*> modules; | 77 std::vector<RtpRtcp*> modules; |
80 for (size_t i = 0; i < num_modules; ++i) { | 78 for (size_t i = 0; i < num_modules; ++i) { |
81 RtpRtcp* rtp_rtcp = RtpRtcp::CreateRtpRtcp(configuration); | 79 RtpRtcp* rtp_rtcp = RtpRtcp::CreateRtpRtcp(configuration); |
82 rtp_rtcp->SetSendingStatus(false); | 80 rtp_rtcp->SetSendingStatus(false); |
83 rtp_rtcp->SetSendingMediaStatus(false); | 81 rtp_rtcp->SetSendingMediaStatus(false); |
84 rtp_rtcp->SetRTCPStatus(RtcpMode::kCompound); | 82 rtp_rtcp->SetRTCPStatus(RtcpMode::kCompound); |
85 modules.push_back(rtp_rtcp); | 83 modules.push_back(rtp_rtcp); |
86 } | 84 } |
87 return modules; | 85 return modules; |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 config.send_transport, | 421 config.send_transport, |
424 &encoder_feedback_, | 422 &encoder_feedback_, |
425 bandwidth_observer_.get(), | 423 bandwidth_observer_.get(), |
426 congestion_controller_->GetTransportFeedbackObserver(), | 424 congestion_controller_->GetTransportFeedbackObserver(), |
427 call_stats_->rtcp_rtt_stats(), | 425 call_stats_->rtcp_rtt_stats(), |
428 congestion_controller_->pacer(), | 426 congestion_controller_->pacer(), |
429 congestion_controller_->packet_router(), | 427 congestion_controller_->packet_router(), |
430 &stats_proxy_, | 428 &stats_proxy_, |
431 send_delay_stats, | 429 send_delay_stats, |
432 event_log, | 430 event_log, |
433 congestion_controller_->GetRetransmissionRateLimiter(), | |
434 config_.rtp.ssrcs.size())), | 431 config_.rtp.ssrcs.size())), |
435 payload_router_(rtp_rtcp_modules_, config.encoder_settings.payload_type), | 432 payload_router_(rtp_rtcp_modules_, config.encoder_settings.payload_type), |
436 input_(&encoder_wakeup_event_, | 433 input_(&encoder_wakeup_event_, |
437 config_.local_renderer, | 434 config_.local_renderer, |
438 &stats_proxy_, | 435 &stats_proxy_, |
439 &overuse_detector_) { | 436 &overuse_detector_) { |
440 LOG(LS_INFO) << "VideoSendStream: " << config_.ToString(); | 437 LOG(LS_INFO) << "VideoSendStream: " << config_.ToString(); |
441 | 438 |
442 RTC_DCHECK(!config_.rtp.ssrcs.empty()); | 439 RTC_DCHECK(!config_.rtp.ssrcs.empty()); |
443 RTC_DCHECK(module_process_thread_); | 440 RTC_DCHECK(module_process_thread_); |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 void VideoSendStream::SignalNetworkState(NetworkState state) { | 878 void VideoSendStream::SignalNetworkState(NetworkState state) { |
882 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { | 879 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { |
883 rtp_rtcp->SetRTCPStatus(state == kNetworkUp ? config_.rtp.rtcp_mode | 880 rtp_rtcp->SetRTCPStatus(state == kNetworkUp ? config_.rtp.rtcp_mode |
884 : RtcpMode::kOff); | 881 : RtcpMode::kOff); |
885 } | 882 } |
886 } | 883 } |
887 | 884 |
888 uint32_t VideoSendStream::OnBitrateUpdated(uint32_t bitrate_bps, | 885 uint32_t VideoSendStream::OnBitrateUpdated(uint32_t bitrate_bps, |
889 uint8_t fraction_loss, | 886 uint8_t fraction_loss, |
890 int64_t rtt) { | 887 int64_t rtt) { |
| 888 payload_router_.SetTargetSendBitrate(bitrate_bps); |
891 // Get the encoder target rate. It is the estimated network rate - | 889 // Get the encoder target rate. It is the estimated network rate - |
892 // protection overhead. | 890 // protection overhead. |
893 uint32_t encoder_target_rate_bps = | 891 uint32_t encoder_target_rate_bps = |
894 protection_bitrate_calculator_.SetTargetRates( | 892 protection_bitrate_calculator_.SetTargetRates( |
895 bitrate_bps, stats_proxy_.GetSendFrameRate(), fraction_loss, rtt); | 893 bitrate_bps, stats_proxy_.GetSendFrameRate(), fraction_loss, rtt); |
896 | 894 |
897 uint32_t protection_bitrate = bitrate_bps - encoder_target_rate_bps; | 895 uint32_t protection_bitrate = bitrate_bps - encoder_target_rate_bps; |
898 { | 896 { |
899 // Limit the target bitrate to the configured max bitrate. | 897 // Limit the target bitrate to the configured max bitrate. |
900 rtc::CritScope lock(&encoder_settings_crit_); | 898 rtc::CritScope lock(&encoder_settings_crit_); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 &module_nack_rate); | 930 &module_nack_rate); |
933 *sent_video_rate_bps += module_video_rate; | 931 *sent_video_rate_bps += module_video_rate; |
934 *sent_nack_rate_bps += module_nack_rate; | 932 *sent_nack_rate_bps += module_nack_rate; |
935 *sent_fec_rate_bps += module_fec_rate; | 933 *sent_fec_rate_bps += module_fec_rate; |
936 } | 934 } |
937 return 0; | 935 return 0; |
938 } | 936 } |
939 | 937 |
940 } // namespace internal | 938 } // namespace internal |
941 } // namespace webrtc | 939 } // namespace webrtc |
OLD | NEW |