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

Unified Diff: remoting/host/video_scheduler.cc

Issue 477103004: Send empty video frames when screen is not changing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/video_scheduler.cc
diff --git a/remoting/host/video_scheduler.cc b/remoting/host/video_scheduler.cc
index 7dc7f8ab3ea73d1dde8183b349a82ae113f7e88c..b9f1276c4639c953cc866baa24dd793294879f83 100644
--- a/remoting/host/video_scheduler.cc
+++ b/remoting/host/video_scheduler.cc
@@ -31,10 +31,10 @@ namespace remoting {
// TODO(hclam): Move this value to CaptureScheduler.
static const int kMaxPendingFrames = 2;
-// Interval between empty keep-alive frames. These frames are sent only
-// when there are no real video frames being sent. To prevent PseudoTCP from
-// resetting congestion window this value must be smaller than the minimum
-// RTO used in PseudoTCP, which is 250ms.
+// Interval between empty keep-alive frames. These frames are sent only when the
+// stream is paused or inactive for some other reason (e.g. when blocked on
+// capturer). To prevent PseudoTCP from resetting congestion window this value
+// must be smaller than the minimum RTO used in PseudoTCP, which is 250ms.
static const int kKeepAlivePacketIntervalMs = 200;
static bool g_enable_timestamps = false;
@@ -374,11 +374,15 @@ void VideoScheduler::EncodeFrame(
base::TimeTicks timestamp) {
DCHECK(encode_task_runner_->BelongsToCurrentThread());
- // Drop the frame if there were no changes.
+ // If there is nothing to encode then send an empty packet.
if (!frame || frame->updated_region().is_empty()) {
capture_task_runner_->DeleteSoon(FROM_HERE, frame.release());
- capture_task_runner_->PostTask(
- FROM_HERE, base::Bind(&VideoScheduler::FrameCaptureCompleted, this));
+ scoped_ptr<VideoPacket> packet(new VideoPacket());
+ packet->set_client_sequence_number(sequence_number);
+ network_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(
+ &VideoScheduler::SendVideoPacket, this, base::Passed(&packet)));
return;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698