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 |
11 #include "webrtc/video/video_receive_stream.h" | 11 #include "webrtc/video/video_receive_stream.h" |
12 | 12 |
13 #include <stdlib.h> | 13 #include <stdlib.h> |
14 | 14 |
15 #include <string> | 15 #include <string> |
16 | 16 |
17 #include "webrtc/base/checks.h" | 17 #include "webrtc/base/checks.h" |
18 #include "webrtc/base/logging.h" | 18 #include "webrtc/base/logging.h" |
19 #include "webrtc/call/congestion_controller.h" | 19 #include "webrtc/call/congestion_controller.h" |
20 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 20 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
21 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" | |
22 #include "webrtc/system_wrappers/include/clock.h" | 21 #include "webrtc/system_wrappers/include/clock.h" |
23 #include "webrtc/video/receive_statistics_proxy.h" | 22 #include "webrtc/video/receive_statistics_proxy.h" |
24 #include "webrtc/video_engine/call_stats.h" | 23 #include "webrtc/video_engine/call_stats.h" |
25 #include "webrtc/video_receive_stream.h" | 24 #include "webrtc/video_receive_stream.h" |
26 | 25 |
27 namespace webrtc { | 26 namespace webrtc { |
28 | 27 |
29 static bool UseSendSideBwe(const std::vector<RtpExtension>& extensions) { | 28 static bool UseSendSideBwe(const std::vector<RtpExtension>& extensions) { |
30 for (const auto& extension : extensions) { | 29 for (const auto& extension : extensions) { |
31 if (extension.name == RtpExtension::kTransportSequenceNumber) | 30 if (extension.name == RtpExtension::kTransportSequenceNumber) |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 call_stats_(call_stats) { | 153 call_stats_(call_stats) { |
155 LOG(LS_INFO) << "VideoReceiveStream: " << config_.ToString(); | 154 LOG(LS_INFO) << "VideoReceiveStream: " << config_.ToString(); |
156 | 155 |
157 bool send_side_bwe = UseSendSideBwe(config_.rtp.extensions); | 156 bool send_side_bwe = UseSendSideBwe(config_.rtp.extensions); |
158 | 157 |
159 RemoteBitrateEstimator* bitrate_estimator = | 158 RemoteBitrateEstimator* bitrate_estimator = |
160 congestion_controller_->GetRemoteBitrateEstimator(send_side_bwe); | 159 congestion_controller_->GetRemoteBitrateEstimator(send_side_bwe); |
161 | 160 |
162 vie_channel_.reset(new ViEChannel( | 161 vie_channel_.reset(new ViEChannel( |
163 num_cpu_cores, &transport_adapter_, process_thread, nullptr, | 162 num_cpu_cores, &transport_adapter_, process_thread, nullptr, |
164 congestion_controller_->GetBitrateController()-> | 163 nullptr, nullptr, bitrate_estimator, call_stats_->rtcp_rtt_stats(), |
165 CreateRtcpBandwidthObserver(), | |
166 nullptr, bitrate_estimator, call_stats_->rtcp_rtt_stats(), | |
167 congestion_controller_->pacer(), congestion_controller_->packet_router(), | 164 congestion_controller_->pacer(), congestion_controller_->packet_router(), |
168 1, false)); | 165 1, false)); |
169 | 166 |
170 RTC_CHECK(vie_channel_->Init() == 0); | 167 RTC_CHECK(vie_channel_->Init() == 0); |
171 | 168 |
172 // Register the channel to receive stats updates. | 169 // Register the channel to receive stats updates. |
173 call_stats_->RegisterStatsObserver(vie_channel_->GetStatsObserver()); | 170 call_stats_->RegisterStatsObserver(vie_channel_->GetStatsObserver()); |
174 | 171 |
175 // TODO(pbos): This is not fine grained enough... | 172 // TODO(pbos): This is not fine grained enough... |
176 vie_channel_->SetProtectionMode(config_.rtp.nack.rtp_history_ms > 0, false, | 173 vie_channel_->SetProtectionMode(config_.rtp.nack.rtp_history_ms > 0, false, |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 return 0; | 376 return 0; |
380 } | 377 } |
381 | 378 |
382 void VideoReceiveStream::SignalNetworkState(NetworkState state) { | 379 void VideoReceiveStream::SignalNetworkState(NetworkState state) { |
383 vie_channel_->SetRTCPMode(state == kNetworkUp ? config_.rtp.rtcp_mode | 380 vie_channel_->SetRTCPMode(state == kNetworkUp ? config_.rtp.rtcp_mode |
384 : RtcpMode::kOff); | 381 : RtcpMode::kOff); |
385 } | 382 } |
386 | 383 |
387 } // namespace internal | 384 } // namespace internal |
388 } // namespace webrtc | 385 } // namespace webrtc |
OLD | NEW |