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

Side by Side Diff: webrtc/video/video_send_stream.cc

Issue 2061423003: Refactor NACK bitrate allocation (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Moved rate limiter and addressed comments Created 4 years, 5 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
OLDNEW
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
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 NackRateLimiter* nack_rate_limiter,
55 size_t num_modules) { 56 size_t num_modules) {
56 RTC_DCHECK_GT(num_modules, 0u); 57 RTC_DCHECK_GT(num_modules, 0u);
57 RtpRtcp::Configuration configuration; 58 RtpRtcp::Configuration configuration;
58 ReceiveStatistics* null_receive_statistics = configuration.receive_statistics; 59 ReceiveStatistics* null_receive_statistics = configuration.receive_statistics;
59 configuration.audio = false; 60 configuration.audio = false;
60 configuration.receiver_only = false; 61 configuration.receiver_only = false;
61 configuration.receive_statistics = null_receive_statistics; 62 configuration.receive_statistics = null_receive_statistics;
62 configuration.outgoing_transport = outgoing_transport; 63 configuration.outgoing_transport = outgoing_transport;
63 configuration.intra_frame_callback = intra_frame_callback; 64 configuration.intra_frame_callback = intra_frame_callback;
64 configuration.bandwidth_callback = bandwidth_callback; 65 configuration.bandwidth_callback = bandwidth_callback;
65 configuration.transport_feedback_callback = transport_feedback_callback; 66 configuration.transport_feedback_callback = transport_feedback_callback;
66 configuration.rtt_stats = rtt_stats; 67 configuration.rtt_stats = rtt_stats;
67 configuration.rtcp_packet_type_counter_observer = stats_proxy; 68 configuration.rtcp_packet_type_counter_observer = stats_proxy;
68 configuration.paced_sender = paced_sender; 69 configuration.paced_sender = paced_sender;
69 configuration.transport_sequence_number_allocator = 70 configuration.transport_sequence_number_allocator =
70 transport_sequence_number_allocator; 71 transport_sequence_number_allocator;
71 configuration.send_bitrate_observer = stats_proxy; 72 configuration.send_bitrate_observer = stats_proxy;
72 configuration.send_frame_count_observer = stats_proxy; 73 configuration.send_frame_count_observer = stats_proxy;
73 configuration.send_side_delay_observer = stats_proxy; 74 configuration.send_side_delay_observer = stats_proxy;
74 configuration.send_packet_observer = send_delay_stats; 75 configuration.send_packet_observer = send_delay_stats;
75 configuration.event_log = event_log; 76 configuration.event_log = event_log;
77 configuration.nack_rate_limiter = nack_rate_limiter;
76 78
77 std::vector<RtpRtcp*> modules; 79 std::vector<RtpRtcp*> modules;
78 for (size_t i = 0; i < num_modules; ++i) { 80 for (size_t i = 0; i < num_modules; ++i) {
79 RtpRtcp* rtp_rtcp = RtpRtcp::CreateRtpRtcp(configuration); 81 RtpRtcp* rtp_rtcp = RtpRtcp::CreateRtpRtcp(configuration);
80 rtp_rtcp->SetSendingStatus(false); 82 rtp_rtcp->SetSendingStatus(false);
81 rtp_rtcp->SetSendingMediaStatus(false); 83 rtp_rtcp->SetSendingMediaStatus(false);
82 rtp_rtcp->SetRTCPStatus(RtcpMode::kCompound); 84 rtp_rtcp->SetRTCPStatus(RtcpMode::kCompound);
83 modules.push_back(rtp_rtcp); 85 modules.push_back(rtp_rtcp);
84 } 86 }
85 return modules; 87 return modules;
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 config.send_transport, 421 config.send_transport,
420 &encoder_feedback_, 422 &encoder_feedback_,
421 bandwidth_observer_.get(), 423 bandwidth_observer_.get(),
422 congestion_controller_->GetTransportFeedbackObserver(), 424 congestion_controller_->GetTransportFeedbackObserver(),
423 call_stats_->rtcp_rtt_stats(), 425 call_stats_->rtcp_rtt_stats(),
424 congestion_controller_->pacer(), 426 congestion_controller_->pacer(),
425 congestion_controller_->packet_router(), 427 congestion_controller_->packet_router(),
426 &stats_proxy_, 428 &stats_proxy_,
427 send_delay_stats, 429 send_delay_stats,
428 event_log, 430 event_log,
431 congestion_controller_->GetNackRateLimiter(),
429 config_.rtp.ssrcs.size())), 432 config_.rtp.ssrcs.size())),
430 payload_router_(rtp_rtcp_modules_, config.encoder_settings.payload_type), 433 payload_router_(rtp_rtcp_modules_, config.encoder_settings.payload_type),
431 input_(&encoder_wakeup_event_, 434 input_(&encoder_wakeup_event_,
432 config_.local_renderer, 435 config_.local_renderer,
433 &stats_proxy_, 436 &stats_proxy_,
434 &overuse_detector_) { 437 &overuse_detector_) {
435 LOG(LS_INFO) << "VideoSendStream: " << config_.ToString(); 438 LOG(LS_INFO) << "VideoSendStream: " << config_.ToString();
436 439
437 RTC_DCHECK(!config_.rtp.ssrcs.empty()); 440 RTC_DCHECK(!config_.rtp.ssrcs.empty());
438 RTC_DCHECK(module_process_thread_); 441 RTC_DCHECK(module_process_thread_);
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 &module_nack_rate); 898 &module_nack_rate);
896 *sent_video_rate_bps += module_video_rate; 899 *sent_video_rate_bps += module_video_rate;
897 *sent_nack_rate_bps += module_nack_rate; 900 *sent_nack_rate_bps += module_nack_rate;
898 *sent_fec_rate_bps += module_fec_rate; 901 *sent_fec_rate_bps += module_fec_rate;
899 } 902 }
900 return 0; 903 return 0;
901 } 904 }
902 905
903 } // namespace internal 906 } // namespace internal
904 } // namespace webrtc 907 } // namespace webrtc
OLDNEW
« webrtc/video/end_to_end_tests.cc ('K') | « webrtc/video/send_statistics_proxy_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698