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_VIDEO_STREAM_H_ | 5 #ifndef REMOTING_PROTOCOL_VIDEO_STREAM_H_ |
6 #define REMOTING_PROTOCOL_VIDEO_STREAM_H_ | 6 #define REMOTING_PROTOCOL_VIDEO_STREAM_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <cstdint> | 10 #include <cstdint> |
11 | 11 |
12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
| 13 #include "remoting/protocol/input_event_timestamps.h" |
13 | 14 |
14 namespace webrtc { | 15 namespace webrtc { |
15 class DesktopSize; | 16 class DesktopSize; |
16 class DesktopVector; | 17 class DesktopVector; |
17 } // namespace webrtc | 18 } // namespace webrtc |
18 | 19 |
19 namespace remoting { | 20 namespace remoting { |
20 namespace protocol { | 21 namespace protocol { |
21 | 22 |
22 class VideoStream { | 23 class VideoStream { |
23 public: | 24 public: |
24 class Observer { | 25 class Observer { |
25 public: | 26 public: |
26 // Called to notify about screen size changes. The size is specified in | 27 // Called to notify about screen size changes. The size is specified in |
27 // physical pixels. | 28 // physical pixels. |
28 virtual void OnVideoSizeChanged(VideoStream* stream, | 29 virtual void OnVideoSizeChanged(VideoStream* stream, |
29 const webrtc::DesktopSize& size, | 30 const webrtc::DesktopSize& size, |
30 const webrtc::DesktopVector& dpi) = 0; | 31 const webrtc::DesktopVector& dpi) = 0; |
31 }; | 32 }; |
32 | 33 |
33 VideoStream() {} | 34 VideoStream() {} |
34 virtual ~VideoStream() {} | 35 virtual ~VideoStream() {} |
35 | 36 |
| 37 // Sets event timestamps source to be used for the video stream. |
| 38 virtual void SetEventTimestampsSource( |
| 39 scoped_refptr<InputEventTimestampsSource> event_timestamps_source) = 0; |
| 40 |
36 // Pauses or resumes scheduling of frame captures. Pausing/resuming captures | 41 // Pauses or resumes scheduling of frame captures. Pausing/resuming captures |
37 // only affects capture scheduling and does not stop/start the capturer. | 42 // only affects capture scheduling and does not stop/start the capturer. |
38 virtual void Pause(bool pause) = 0; | 43 virtual void Pause(bool pause) = 0; |
39 | 44 |
40 // Should be called whenever an input event is received. | |
41 virtual void OnInputEventReceived(int64_t event_timestamp) = 0; | |
42 | |
43 // Sets whether the video encoder should be requested to encode losslessly, | 45 // Sets whether the video encoder should be requested to encode losslessly, |
44 // or to use a lossless color space (typically requiring higher bandwidth). | 46 // or to use a lossless color space (typically requiring higher bandwidth). |
45 virtual void SetLosslessEncode(bool want_lossless) = 0; | 47 virtual void SetLosslessEncode(bool want_lossless) = 0; |
46 virtual void SetLosslessColor(bool want_lossless) = 0; | 48 virtual void SetLosslessColor(bool want_lossless) = 0; |
47 | 49 |
48 // Sets stream observer. | 50 // Sets stream observer. |
49 virtual void SetObserver(Observer* observer) = 0; | 51 virtual void SetObserver(Observer* observer) = 0; |
50 }; | 52 }; |
51 | 53 |
52 } // namespace protocol | 54 } // namespace protocol |
53 } // namespace remoting | 55 } // namespace remoting |
54 | 56 |
55 #endif // REMOTING_PROTOCOL_VIDEO_STREAM_H_ | 57 #endif // REMOTING_PROTOCOL_VIDEO_STREAM_H_ |
OLD | NEW |