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

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

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