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

Side by Side Diff: remoting/protocol/capture_scheduler.h

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « remoting/protocol/authenticator_test_base.cc ('k') | remoting/protocol/capture_scheduler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 void OnCaptureCompleted(); 47 void OnCaptureCompleted();
48 48
49 // Notifies the scheduler that a frame has been encoded. The scheduler can 49 // Notifies the scheduler that a frame has been encoded. The scheduler can
50 // change |packet| if necessary, e.g. set |frame_id|. 50 // change |packet| if necessary, e.g. set |frame_id|.
51 void OnFrameEncoded(VideoPacket* packet); 51 void OnFrameEncoded(VideoPacket* packet);
52 52
53 // Notifies the scheduler that a frame has been sent. 53 // Notifies the scheduler that a frame has been sent.
54 void OnFrameSent(); 54 void OnFrameSent();
55 55
56 // VideoFeedbackStub interface. 56 // VideoFeedbackStub interface.
57 void ProcessVideoAck(scoped_ptr<VideoAck> video_ack) override; 57 void ProcessVideoAck(std::unique_ptr<VideoAck> video_ack) override;
58 58
59 // Sets minimum interval between frames. 59 // Sets minimum interval between frames.
60 void set_minimum_interval(base::TimeDelta minimum_interval) { 60 void set_minimum_interval(base::TimeDelta minimum_interval) {
61 minimum_interval_ = minimum_interval; 61 minimum_interval_ = minimum_interval;
62 } 62 }
63 63
64 // Helper functions for tests. 64 // Helper functions for tests.
65 void SetTickClockForTest(scoped_ptr<base::TickClock> tick_clock); 65 void SetTickClockForTest(std::unique_ptr<base::TickClock> tick_clock);
66 void SetTimerForTest(scoped_ptr<base::Timer> timer); 66 void SetTimerForTest(std::unique_ptr<base::Timer> timer);
67 void SetNumOfProcessorsForTest(int num_of_processors); 67 void SetNumOfProcessorsForTest(int num_of_processors);
68 68
69 private: 69 private:
70 // Schedules |capture_timer_| to call CaptureNextFrame() at appropriate time. 70 // Schedules |capture_timer_| to call CaptureNextFrame() at appropriate time.
71 // Doesn't do anything if next frame cannot be captured yet (e.g. because 71 // Doesn't do anything if next frame cannot be captured yet (e.g. because
72 // there are too many frames being processed). 72 // there are too many frames being processed).
73 void ScheduleNextCapture(); 73 void ScheduleNextCapture();
74 74
75 // Called by |capture_timer_|. Calls |capture_closure_| to start capturing a 75 // Called by |capture_timer_|. Calls |capture_closure_| to start capturing a
76 // new frame. 76 // new frame.
77 void CaptureNextFrame(); 77 void CaptureNextFrame();
78 78
79 base::Closure capture_closure_; 79 base::Closure capture_closure_;
80 80
81 scoped_ptr<base::TickClock> tick_clock_; 81 std::unique_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 std::unique_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 RunningSamples capture_time_; 91 RunningSamples capture_time_;
92 RunningSamples encode_time_; 92 RunningSamples encode_time_;
93 93
94 // Number of frames pending encoding. 94 // Number of frames pending encoding.
(...skipping 15 matching lines...) Expand all
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_
OLDNEW
« no previous file with comments | « remoting/protocol/authenticator_test_base.cc ('k') | remoting/protocol/capture_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698