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

Unified Diff: webrtc/video/video_send_stream.cc

Issue 1325263002: Make LoadObserver settable per video send stream. Gives client flexibility and makes the implementa… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/video/video_send_stream.h ('k') | webrtc/video_send_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/video_send_stream.cc
diff --git a/webrtc/video/video_send_stream.cc b/webrtc/video/video_send_stream.cc
index 659fecb4b51b9e55c9bcb509258682c10a44d9fc..42ad774a7c6e783a9ce1dda2d6e5bf4049d9f3c6 100644
--- a/webrtc/video/video_send_stream.cc
+++ b/webrtc/video/video_send_stream.cc
@@ -101,7 +101,6 @@ std::string VideoSendStream::Config::ToString() const {
namespace internal {
VideoSendStream::VideoSendStream(
- CpuOveruseObserver* overuse_observer,
int num_cpu_cores,
ProcessThread* module_process_thread,
ChannelGroup* channel_group,
@@ -162,7 +161,7 @@ VideoSendStream::VideoSendStream(
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 @@ VideoSendStream::Stats VideoSendStream::GetStats() {
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) {
« no previous file with comments | « webrtc/video/video_send_stream.h ('k') | webrtc/video_send_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698