Make LoadObserver settable per video send stream. Gives client flexibility and makes the implementation slightly simpler. See discussion in: https://codereview.webrtc.org/1269863005/
BUG=webrtc:4690
Review URL: https://codereview.webrtc.org/1325263002
Cr-Commit-Position: refs/heads/master@{#9891}
diff --git a/webrtc/video/video_send_stream.cc b/webrtc/video/video_send_stream.cc
index 659fecb..42ad774 100644
--- a/webrtc/video/video_send_stream.cc
+++ b/webrtc/video/video_send_stream.cc
@@ -101,7 +101,6 @@
namespace internal {
VideoSendStream::VideoSendStream(
- CpuOveruseObserver* overuse_observer,
int num_cpu_cores,
ProcessThread* module_process_thread,
ChannelGroup* channel_group,
@@ -162,7 +161,7 @@
input_.reset(new internal::VideoCaptureInput(
module_process_thread_, vie_encoder_, config_.local_renderer,
- &stats_proxy_, overuse_observer));
+ &stats_proxy_, this));
// 28 to match packet overhead in ModuleRtpRtcpImpl.
DCHECK_LE(config_.rtp.max_packet_size, static_cast<size_t>(0xFFFF - 28));
@@ -390,6 +389,16 @@
return stats_proxy_.GetStats();
}
+void VideoSendStream::OveruseDetected() {
+ if (config_.overuse_callback)
+ config_.overuse_callback->OnLoadUpdate(LoadObserver::kOveruse);
+}
+
+void VideoSendStream::NormalUsage() {
+ if (config_.overuse_callback)
+ config_.overuse_callback->OnLoadUpdate(LoadObserver::kUnderuse);
+}
+
void VideoSendStream::ConfigureSsrcs() {
vie_channel_->SetSSRC(config_.rtp.ssrcs.front(), kViEStreamTypeNormal, 0);
for (size_t i = 0; i < config_.rtp.ssrcs.size(); ++i) {