OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_WEBRTC_FRAME_SCHEDULER_H_ | 5 #ifndef REMOTING_PROTOCOL_WEBRTC_FRAME_SCHEDULER_H_ |
6 #define REMOTING_PROTOCOL_WEBRTC_FRAME_SCHEDULER_H_ | 6 #define REMOTING_PROTOCOL_WEBRTC_FRAME_SCHEDULER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 void Start(); | 38 void Start(); |
39 // Stops scheduling frames. | 39 // Stops scheduling frames. |
40 void Stop(); | 40 void Stop(); |
41 | 41 |
42 void Pause(bool pause); | 42 void Pause(bool pause); |
43 | 43 |
44 void SetSizeCallback(const VideoStream::SizeCallback& size_callback); | 44 void SetSizeCallback(const VideoStream::SizeCallback& size_callback); |
45 | 45 |
46 private: | 46 private: |
47 // webrtc::DesktopCapturer::Callback interface. | 47 // webrtc::DesktopCapturer::Callback interface. |
48 void OnCaptureCompleted(webrtc::DesktopFrame* frame) override; | 48 void OnCaptureResult(webrtc::DesktopCapturer::Result result, |
| 49 std::unique_ptr<webrtc::DesktopFrame> frame) override; |
49 | 50 |
50 // Starts |capture_timer_|. | 51 // Starts |capture_timer_|. |
51 void StartCaptureTimer(); | 52 void StartCaptureTimer(); |
52 | 53 |
53 // Called by |capture_timer_|. | 54 // Called by |capture_timer_|. |
54 void CaptureNextFrame(); | 55 void CaptureNextFrame(); |
55 | 56 |
56 // Task running on the encoder thread to encode the |frame|. | 57 // Task running on the encoder thread to encode the |frame|. |
57 static std::unique_ptr<VideoPacket> EncodeFrame( | 58 static std::unique_ptr<VideoPacket> EncodeFrame( |
58 VideoEncoder* encoder, | 59 VideoEncoder* encoder, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 108 |
108 base::WeakPtrFactory<WebrtcFrameScheduler> weak_factory_; | 109 base::WeakPtrFactory<WebrtcFrameScheduler> weak_factory_; |
109 | 110 |
110 DISALLOW_COPY_AND_ASSIGN(WebrtcFrameScheduler); | 111 DISALLOW_COPY_AND_ASSIGN(WebrtcFrameScheduler); |
111 }; | 112 }; |
112 | 113 |
113 } // namespace protocol | 114 } // namespace protocol |
114 } // namespace remoting | 115 } // namespace remoting |
115 | 116 |
116 #endif // REMOTING_PROTOCOL_WEBRTC_FRAME_SCHEDULER_H_ | 117 #endif // REMOTING_PROTOCOL_WEBRTC_FRAME_SCHEDULER_H_ |
OLD | NEW |