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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "webrtc/video/video_send_stream.h" | 44 #include "webrtc/video/video_send_stream.h" |
45 #include "webrtc/video/vie_remb.h" | 45 #include "webrtc/video/vie_remb.h" |
46 #include "webrtc/voice_engine/include/voe_codec.h" | 46 #include "webrtc/voice_engine/include/voe_codec.h" |
47 | 47 |
48 namespace webrtc { | 48 namespace webrtc { |
49 | 49 |
50 const int Call::Config::kDefaultStartBitrateBps = 300000; | 50 const int Call::Config::kDefaultStartBitrateBps = 300000; |
51 | 51 |
52 namespace internal { | 52 namespace internal { |
53 | 53 |
54 class Call : public webrtc::Call, | 54 class Call : public webrtc::Call, public PacketReceiver, |
55 public PacketReceiver, | 55 public BitrateObserver { |
56 public CongestionController::Observer { | |
57 public: | 56 public: |
58 explicit Call(const Call::Config& config); | 57 explicit Call(const Call::Config& config); |
59 virtual ~Call(); | 58 virtual ~Call(); |
60 | 59 |
61 PacketReceiver* Receiver() override; | 60 PacketReceiver* Receiver() override; |
62 | 61 |
63 webrtc::AudioSendStream* CreateAudioSendStream( | 62 webrtc::AudioSendStream* CreateAudioSendStream( |
64 const webrtc::AudioSendStream::Config& config) override; | 63 const webrtc::AudioSendStream::Config& config) override; |
65 void DestroyAudioSendStream(webrtc::AudioSendStream* send_stream) override; | 64 void DestroyAudioSendStream(webrtc::AudioSendStream* send_stream) override; |
66 | 65 |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 uint32_t pacer_bitrate_bps = | 685 uint32_t pacer_bitrate_bps = |
687 std::max(target_bitrate_bps, allocated_bitrate_bps); | 686 std::max(target_bitrate_bps, allocated_bitrate_bps); |
688 { | 687 { |
689 rtc::CritScope lock(&bitrate_crit_); | 688 rtc::CritScope lock(&bitrate_crit_); |
690 // We only update these stats if we have send streams, and assume that | 689 // We only update these stats if we have send streams, and assume that |
691 // OnNetworkChanged is called roughly with a fixed frequency. | 690 // OnNetworkChanged is called roughly with a fixed frequency. |
692 estimated_send_bitrate_sum_kbits_ += target_bitrate_bps / 1000; | 691 estimated_send_bitrate_sum_kbits_ += target_bitrate_bps / 1000; |
693 pacer_bitrate_sum_kbits_ += pacer_bitrate_bps / 1000; | 692 pacer_bitrate_sum_kbits_ += pacer_bitrate_bps / 1000; |
694 ++num_bitrate_updates_; | 693 ++num_bitrate_updates_; |
695 } | 694 } |
696 congestion_controller_->SetAllocatedSendBitrate(allocated_bitrate_bps, | 695 congestion_controller_->UpdatePacerBitrate( |
697 pad_up_to_bitrate_bps); | 696 target_bitrate_bps / 1000, |
| 697 PacedSender::kDefaultPaceMultiplier * pacer_bitrate_bps / 1000, |
| 698 pad_up_to_bitrate_bps / 1000); |
698 } | 699 } |
699 | 700 |
700 void Call::ConfigureSync(const std::string& sync_group) { | 701 void Call::ConfigureSync(const std::string& sync_group) { |
701 // Set sync only if there was no previous one. | 702 // Set sync only if there was no previous one. |
702 if (voice_engine() == nullptr || sync_group.empty()) | 703 if (voice_engine() == nullptr || sync_group.empty()) |
703 return; | 704 return; |
704 | 705 |
705 AudioReceiveStream* sync_audio_stream = nullptr; | 706 AudioReceiveStream* sync_audio_stream = nullptr; |
706 // Find existing audio stream. | 707 // Find existing audio stream. |
707 const auto it = sync_stream_mapping_.find(sync_group); | 708 const auto it = sync_stream_mapping_.find(sync_group); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 // thread. Then this check can be enabled. | 842 // thread. Then this check can be enabled. |
842 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread()); | 843 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread()); |
843 if (RtpHeaderParser::IsRtcp(packet, length)) | 844 if (RtpHeaderParser::IsRtcp(packet, length)) |
844 return DeliverRtcp(media_type, packet, length); | 845 return DeliverRtcp(media_type, packet, length); |
845 | 846 |
846 return DeliverRtp(media_type, packet, length, packet_time); | 847 return DeliverRtp(media_type, packet, length, packet_time); |
847 } | 848 } |
848 | 849 |
849 } // namespace internal | 850 } // namespace internal |
850 } // namespace webrtc | 851 } // namespace webrtc |
OLD | NEW |