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

Side by Side Diff: webrtc/voice_engine/channel.cc

Issue 2589743002: Make OverheadObserver::OnOverheadChanged count RTP headers only (Closed)
Patch Set: Address easy nits. Created 4 years 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
« webrtc/voice_engine/channel.h ('K') | « webrtc/voice_engine/channel.h ('k') | no next file » | 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 (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 896 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 _externalMixing(false), 907 _externalMixing(false),
908 _mixFileWithMicrophone(false), 908 _mixFileWithMicrophone(false),
909 input_mute_(false), 909 input_mute_(false),
910 previous_frame_muted_(false), 910 previous_frame_muted_(false),
911 _panLeft(1.0f), 911 _panLeft(1.0f),
912 _panRight(1.0f), 912 _panRight(1.0f),
913 _outputGain(1.0f), 913 _outputGain(1.0f),
914 _lastLocalTimeStamp(0), 914 _lastLocalTimeStamp(0),
915 _lastPayloadType(0), 915 _lastPayloadType(0),
916 _includeAudioLevelIndication(false), 916 _includeAudioLevelIndication(false),
917 _transport_overhead_per_packet(0),
918 _rtp_overhead_per_packet(0),
917 _outputSpeechType(AudioFrame::kNormalSpeech), 919 _outputSpeechType(AudioFrame::kNormalSpeech),
918 restored_packet_in_use_(false), 920 restored_packet_in_use_(false),
919 rtcp_observer_(new VoERtcpObserver(this)), 921 rtcp_observer_(new VoERtcpObserver(this)),
920 associate_send_channel_(ChannelOwner(nullptr)), 922 associate_send_channel_(ChannelOwner(nullptr)),
921 pacing_enabled_(config.enable_voice_pacing), 923 pacing_enabled_(config.enable_voice_pacing),
922 feedback_observer_proxy_(new TransportFeedbackProxy()), 924 feedback_observer_proxy_(new TransportFeedbackProxy()),
923 seq_num_allocator_proxy_(new TransportSequenceNumberProxy()), 925 seq_num_allocator_proxy_(new TransportSequenceNumberProxy()),
924 rtp_packet_sender_proxy_(new RtpPacketSenderProxy()), 926 rtp_packet_sender_proxy_(new RtpPacketSenderProxy()),
925 retransmission_rate_limiter_(new RateLimiter(Clock::GetRealTimeClock(), 927 retransmission_rate_limiter_(new RateLimiter(Clock::GetRealTimeClock(),
926 kMaxRetransmissionWindowMs)), 928 kMaxRetransmissionWindowMs)),
(...skipping 1944 matching lines...) Expand 10 before | Expand all | Expand 10 after
2871 } 2873 }
2872 2874
2873 void Channel::SetRtcEventLog(RtcEventLog* event_log) { 2875 void Channel::SetRtcEventLog(RtcEventLog* event_log) {
2874 event_log_proxy_->SetEventLog(event_log); 2876 event_log_proxy_->SetEventLog(event_log);
2875 } 2877 }
2876 2878
2877 void Channel::SetRtcpRttStats(RtcpRttStats* rtcp_rtt_stats) { 2879 void Channel::SetRtcpRttStats(RtcpRttStats* rtcp_rtt_stats) {
2878 rtcp_rtt_stats_proxy_->SetRtcpRttStats(rtcp_rtt_stats); 2880 rtcp_rtt_stats_proxy_->SetRtcpRttStats(rtcp_rtt_stats);
2879 } 2881 }
2880 2882
2881 void Channel::SetTransportOverhead(int transport_overhead_per_packet) { 2883 void Channel::UpdateOverheadForEncoder() {
2882 _rtpRtcpModule->SetTransportOverhead(transport_overhead_per_packet); 2884 audio_coding_->ModifyEncoder([&](std::unique_ptr<AudioEncoder>* encoder) {
2885 if (*encoder) {
2886 (*encoder)->OnReceivedOverhead(
2887 _transport_overhead_per_packet + _rtp_overhead_per_packet);
2888 }
2889 });
2883 } 2890 }
2884 2891
2892 void Channel::SetTransportOverhead(int transport_overhead_per_packet) {
2893 _transport_overhead_per_packet = transport_overhead_per_packet;
2894 UpdateOverheadForEncoder();
2895 }
2896
2897
2885 void Channel::OnOverheadChanged(size_t overhead_bytes_per_packet) { 2898 void Channel::OnOverheadChanged(size_t overhead_bytes_per_packet) {
the sun 2016/12/21 10:33:02 Not strictly part of this CL, but... "transport_ov
stefan-webrtc 2016/12/21 11:31:43 It's important for really low bitrates where the o
2886 audio_coding_->ModifyEncoder([&](std::unique_ptr<AudioEncoder>* encoder) { 2899 _rtp_overhead_per_packet = overhead_bytes_per_packet;
2887 if (*encoder) { 2900 UpdateOverheadForEncoder();
2888 (*encoder)->OnReceivedOverhead(overhead_bytes_per_packet);
2889 }
2890 });
2891 } 2901 }
2892 2902
2893 int Channel::RegisterExternalMediaProcessing(ProcessingTypes type, 2903 int Channel::RegisterExternalMediaProcessing(ProcessingTypes type,
2894 VoEMediaProcess& processObject) { 2904 VoEMediaProcess& processObject) {
2895 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), 2905 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId),
2896 "Channel::RegisterExternalMediaProcessing()"); 2906 "Channel::RegisterExternalMediaProcessing()");
2897 2907
2898 rtc::CritScope cs(&_callbackCritSect); 2908 rtc::CritScope cs(&_callbackCritSect);
2899 2909
2900 if (kPlaybackPerChannel == type) { 2910 if (kPlaybackPerChannel == type) {
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
3288 int64_t min_rtt = 0; 3298 int64_t min_rtt = 0;
3289 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != 3299 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) !=
3290 0) { 3300 0) {
3291 return 0; 3301 return 0;
3292 } 3302 }
3293 return rtt; 3303 return rtt;
3294 } 3304 }
3295 3305
3296 } // namespace voe 3306 } // namespace voe
3297 } // namespace webrtc 3307 } // namespace webrtc
OLDNEW
« webrtc/voice_engine/channel.h ('K') | « webrtc/voice_engine/channel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698