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

Side by Side Diff: webrtc/call/call.cc

Issue 1958053002: Revert "Reland of Remove SendPacer from ViEEncoder (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebased Created 4 years, 7 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 #include "webrtc/video/video_send_stream.h" 45 #include "webrtc/video/video_send_stream.h"
46 #include "webrtc/video/vie_remb.h" 46 #include "webrtc/video/vie_remb.h"
47 #include "webrtc/voice_engine/include/voe_codec.h" 47 #include "webrtc/voice_engine/include/voe_codec.h"
48 48
49 namespace webrtc { 49 namespace webrtc {
50 50
51 const int Call::Config::kDefaultStartBitrateBps = 300000; 51 const int Call::Config::kDefaultStartBitrateBps = 300000;
52 52
53 namespace internal { 53 namespace internal {
54 54
55 class Call : public webrtc::Call, 55 class Call : public webrtc::Call, public PacketReceiver,
56 public PacketReceiver, 56 public BitrateObserver {
57 public CongestionController::Observer {
58 public: 57 public:
59 explicit Call(const Call::Config& config); 58 explicit Call(const Call::Config& config);
60 virtual ~Call(); 59 virtual ~Call();
61 60
62 PacketReceiver* Receiver() override; 61 PacketReceiver* Receiver() override;
63 62
64 webrtc::AudioSendStream* CreateAudioSendStream( 63 webrtc::AudioSendStream* CreateAudioSendStream(
65 const webrtc::AudioSendStream::Config& config) override; 64 const webrtc::AudioSendStream::Config& config) override;
66 void DestroyAudioSendStream(webrtc::AudioSendStream* send_stream) override; 65 void DestroyAudioSendStream(webrtc::AudioSendStream* send_stream) override;
67 66
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 uint32_t pacer_bitrate_bps = 692 uint32_t pacer_bitrate_bps =
694 std::max(target_bitrate_bps, allocated_bitrate_bps); 693 std::max(target_bitrate_bps, allocated_bitrate_bps);
695 { 694 {
696 rtc::CritScope lock(&bitrate_crit_); 695 rtc::CritScope lock(&bitrate_crit_);
697 // We only update these stats if we have send streams, and assume that 696 // We only update these stats if we have send streams, and assume that
698 // OnNetworkChanged is called roughly with a fixed frequency. 697 // OnNetworkChanged is called roughly with a fixed frequency.
699 estimated_send_bitrate_sum_kbits_ += target_bitrate_bps / 1000; 698 estimated_send_bitrate_sum_kbits_ += target_bitrate_bps / 1000;
700 pacer_bitrate_sum_kbits_ += pacer_bitrate_bps / 1000; 699 pacer_bitrate_sum_kbits_ += pacer_bitrate_bps / 1000;
701 ++num_bitrate_updates_; 700 ++num_bitrate_updates_;
702 } 701 }
703 congestion_controller_->SetAllocatedSendBitrate(allocated_bitrate_bps, 702 congestion_controller_->UpdatePacerBitrate(
704 pad_up_to_bitrate_bps); 703 target_bitrate_bps / 1000,
704 PacedSender::kDefaultPaceMultiplier * pacer_bitrate_bps / 1000,
705 pad_up_to_bitrate_bps / 1000);
705 } 706 }
706 707
707 void Call::ConfigureSync(const std::string& sync_group) { 708 void Call::ConfigureSync(const std::string& sync_group) {
708 // Set sync only if there was no previous one. 709 // Set sync only if there was no previous one.
709 if (voice_engine() == nullptr || sync_group.empty()) 710 if (voice_engine() == nullptr || sync_group.empty())
710 return; 711 return;
711 712
712 AudioReceiveStream* sync_audio_stream = nullptr; 713 AudioReceiveStream* sync_audio_stream = nullptr;
713 // Find existing audio stream. 714 // Find existing audio stream.
714 const auto it = sync_stream_mapping_.find(sync_group); 715 const auto it = sync_stream_mapping_.find(sync_group);
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 // thread. Then this check can be enabled. 849 // thread. Then this check can be enabled.
849 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread()); 850 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread());
850 if (RtpHeaderParser::IsRtcp(packet, length)) 851 if (RtpHeaderParser::IsRtcp(packet, length))
851 return DeliverRtcp(media_type, packet, length); 852 return DeliverRtcp(media_type, packet, length);
852 853
853 return DeliverRtp(media_type, packet, length, packet_time); 854 return DeliverRtp(media_type, packet, length, packet_time);
854 } 855 }
855 856
856 } // namespace internal 857 } // namespace internal
857 } // namespace webrtc 858 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/call/bitrate_allocator_unittest.cc ('k') | webrtc/modules/bitrate_controller/bitrate_controller_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698