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