| OLD | NEW | 
|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #ifndef REMOTING_PROTOCOL_CAPTURE_SCHEDULER_H_ | 5 #ifndef REMOTING_PROTOCOL_CAPTURE_SCHEDULER_H_ | 
| 6 #define REMOTING_PROTOCOL_CAPTURE_SCHEDULER_H_ | 6 #define REMOTING_PROTOCOL_CAPTURE_SCHEDULER_H_ | 
| 7 | 7 | 
| 8 #include <stdint.h> | 8 #include <stdint.h> | 
| 9 | 9 | 
| 10 #include "base/callback.h" | 10 #include "base/callback.h" | 
| 11 #include "base/macros.h" | 11 #include "base/macros.h" | 
| 12 #include "base/threading/thread_checker.h" | 12 #include "base/threading/thread_checker.h" | 
| 13 #include "base/time/tick_clock.h" | 13 #include "base/time/tick_clock.h" | 
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" | 
| 15 #include "base/timer/timer.h" | 15 #include "base/timer/timer.h" | 
| 16 #include "remoting/base/running_average.h" | 16 #include "remoting/base/running_samples.h" | 
| 17 #include "remoting/protocol/video_feedback_stub.h" | 17 #include "remoting/protocol/video_feedback_stub.h" | 
| 18 | 18 | 
| 19 namespace remoting { | 19 namespace remoting { | 
| 20 | 20 | 
| 21 class VideoPacket; | 21 class VideoPacket; | 
| 22 | 22 | 
| 23 namespace protocol { | 23 namespace protocol { | 
| 24 | 24 | 
| 25 // CaptureScheduler is used by the VideoFramePump to schedule frame capturer, | 25 // CaptureScheduler is used by the VideoFramePump to schedule frame capturer, | 
| 26 // taking into account capture delay, encoder delay, network bandwidth, etc. | 26 // taking into account capture delay, encoder delay, network bandwidth, etc. | 
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 81   scoped_ptr<base::TickClock> tick_clock_; | 81   scoped_ptr<base::TickClock> tick_clock_; | 
| 82 | 82 | 
| 83   // Timer used to schedule CaptureNextFrame(). | 83   // Timer used to schedule CaptureNextFrame(). | 
| 84   scoped_ptr<base::Timer> capture_timer_; | 84   scoped_ptr<base::Timer> capture_timer_; | 
| 85 | 85 | 
| 86   // Minimum interval between frames that determines maximum possible framerate. | 86   // Minimum interval between frames that determines maximum possible framerate. | 
| 87   base::TimeDelta minimum_interval_; | 87   base::TimeDelta minimum_interval_; | 
| 88 | 88 | 
| 89   int num_of_processors_; | 89   int num_of_processors_; | 
| 90 | 90 | 
| 91   RunningAverage capture_time_; | 91   RunningSamples capture_time_; | 
| 92   RunningAverage encode_time_; | 92   RunningSamples encode_time_; | 
| 93 | 93 | 
| 94   // Number of frames pending encoding. | 94   // Number of frames pending encoding. | 
| 95   int num_encoding_frames_; | 95   int num_encoding_frames_; | 
| 96 | 96 | 
| 97   // Number of outgoing frames for which we haven't received an acknowledgment. | 97   // Number of outgoing frames for which we haven't received an acknowledgment. | 
| 98   int num_unacknowledged_frames_; | 98   int num_unacknowledged_frames_; | 
| 99 | 99 | 
| 100   // Set to true when capture is pending. | 100   // Set to true when capture is pending. | 
| 101   bool capture_pending_; | 101   bool capture_pending_; | 
| 102 | 102 | 
| 103   // Time at which the last capture started. Used to schedule |capture_timer_|. | 103   // Time at which the last capture started. Used to schedule |capture_timer_|. | 
| 104   base::TimeTicks last_capture_started_time_; | 104   base::TimeTicks last_capture_started_time_; | 
| 105 | 105 | 
| 106   bool is_paused_; | 106   bool is_paused_; | 
| 107 | 107 | 
| 108   // Frame ID to be assigned to the next outgoing video frame. | 108   // Frame ID to be assigned to the next outgoing video frame. | 
| 109   uint32_t next_frame_id_; | 109   uint32_t next_frame_id_; | 
| 110 | 110 | 
| 111   base::ThreadChecker thread_checker_; | 111   base::ThreadChecker thread_checker_; | 
| 112 | 112 | 
| 113   DISALLOW_COPY_AND_ASSIGN(CaptureScheduler); | 113   DISALLOW_COPY_AND_ASSIGN(CaptureScheduler); | 
| 114 }; | 114 }; | 
| 115 | 115 | 
| 116 }  // namespace protocol | 116 }  // namespace protocol | 
| 117 }  // namespace remoting | 117 }  // namespace remoting | 
| 118 | 118 | 
| 119 #endif  // REMOTING_PROTOCOL_CAPTURE_SCHEDULER_H_ | 119 #endif  // REMOTING_PROTOCOL_CAPTURE_SCHEDULER_H_ | 
| OLD | NEW | 
|---|