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

Unified Diff: remoting/host/capture_scheduler.h

Issue 850983002: Implement video frame acknowledgements in the chromoting protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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: remoting/host/capture_scheduler.h
diff --git a/remoting/host/capture_scheduler.h b/remoting/host/capture_scheduler.h
index 610b35ba490b9cb1ef4b5bcedbde46bd6d28c624..29c2c5703d47b0a9c35a5bfc47375078f39087c0 100644
--- a/remoting/host/capture_scheduler.h
+++ b/remoting/host/capture_scheduler.h
@@ -22,7 +22,7 @@ namespace remoting {
// taking into account capture delay, encoder delay, network bandwidth, etc.
class CaptureScheduler : public base::NonThreadSafe {
public:
- explicit CaptureScheduler(const base::Closure& capture_closure);
+ CaptureScheduler(const base::Closure& capture_closure, bool acks_supported);
~CaptureScheduler();
// Starts the scheduler.
@@ -40,6 +40,16 @@ class CaptureScheduler : public base::NonThreadSafe {
// Notifies the scheduler than a frame has been sent.
void OnFrameSent();
+ // Notifies the scheduler than a frame has been acknowledged.
+ void OnFrameAck();
+
+ // Sets maximum number of pending frames in the sending queue. When ACKs are
+ // supported frames is considered to be pending until ACK message is received,
Wez 2015/02/03 00:54:32 s/is/are
Sergey Ulanov 2015/02/09 19:14:54 Removed this function now
+ // otherwise it's pending until it's sent (OnFrameSent() is called).
Wez 2015/02/03 00:54:32 If the two things are treated equivalently, simply
Sergey Ulanov 2015/02/09 19:14:54 Removed this function now
+ void set_maximum_pending_frames(int max_pending_frames) {
+ max_pending_frames_ = max_pending_frames;
+ }
+
// Sets minimum interval between frames.
void set_minimum_interval(base::TimeDelta minimum_interval) {
minimum_interval_ = minimum_interval;
@@ -68,6 +78,12 @@ class CaptureScheduler : public base::NonThreadSafe {
base::Closure capture_closure_;
+ // Set to true if the connection supports video frame acknowledgments.
+ bool acks_supported_;
+
+ // Maximum number of pending frames.
+ int max_pending_frames_;
+
scoped_ptr<base::TickClock> tick_clock_;
// Timer used to schedule CaptureNextFrame().
@@ -81,7 +97,9 @@ class CaptureScheduler : public base::NonThreadSafe {
RunningAverage capture_time_;
RunningAverage encode_time_;
- int pending_frames_;
+ int num_encoding_frames_;
+ int num_sending_frames_;
+
bool capture_pending_;
base::TimeTicks last_capture_started_time_;
bool is_paused_;

Powered by Google App Engine
This is Rietveld 408576698