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

Unified Diff: webrtc/video/video_send_stream.cc

Issue 2070343002: Remove ViEncoder::Pause / Start (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Remove from header file. Created 4 years, 6 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
Index: webrtc/video/video_send_stream.cc
diff --git a/webrtc/video/video_send_stream.cc b/webrtc/video/video_send_stream.cc
index df4b2955465045b4b9509628ad625271c8cdad1f..28da84091ed3acd16480cb9d3839bb740ff95193 100644
--- a/webrtc/video/video_send_stream.cc
+++ b/webrtc/video/video_send_stream.cc
@@ -529,16 +529,17 @@ void VideoSendStream::Start() {
return;
TRACE_EVENT_INSTANT0("webrtc", "VideoSendStream::Start");
payload_router_.set_active(true);
+ vie_encoder_.OnBitrateUpdated(
+ protection_bitrate_calculator_.GetEncoderTargetRate(), 0, 0);
pbos-webrtc 2016/06/16 13:16:28 What does it mean to put bogus values for fraction
perkj_webrtc 2016/06/16 18:42:18 There is no guarantee that the rtt and packet loss
// Was not already started, trigger a keyframe.
vie_encoder_.SendKeyFrame();
- vie_encoder_.Start();
}
void VideoSendStream::Stop() {
if (!payload_router_.active())
return;
TRACE_EVENT_INSTANT0("webrtc", "VideoSendStream::Stop");
- vie_encoder_.Pause();
+ vie_encoder_.OnBitrateUpdated(0, 0, 0);
payload_router_.set_active(false);
}
@@ -850,6 +851,8 @@ void VideoSendStream::OnBitrateUpdated(uint32_t bitrate_bps,
uint32_t encoder_target_rate = protection_bitrate_calculator_.SetTargetRates(
bitrate_bps, stats_proxy_.GetSendFrameRate(), fraction_loss, rtt);
+ if (!payload_router_.active())
+ return; // The send stream is currently not started.
pbos-webrtc 2016/06/16 13:16:28 Should the last fraction_loss and rtt be stored?
perkj_webrtc 2016/06/16 18:42:18 I dont' think they actually make sense. But we cou
vie_encoder_.OnBitrateUpdated(encoder_target_rate, fraction_loss, rtt);
}

Powered by Google App Engine
This is Rietveld 408576698