| 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_FRAME_PUMP_H_ | 5 #ifndef REMOTING_PROTOCOL_VIDEO_FRAME_PUMP_H_ |
| 6 #define REMOTING_PROTOCOL_VIDEO_FRAME_PUMP_H_ | 6 #define REMOTING_PROTOCOL_VIDEO_FRAME_PUMP_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 std::unique_ptr<webrtc::DesktopCapturer> capturer, | 80 std::unique_ptr<webrtc::DesktopCapturer> capturer, |
| 81 std::unique_ptr<VideoEncoder> encoder, | 81 std::unique_ptr<VideoEncoder> encoder, |
| 82 protocol::VideoStub* video_stub); | 82 protocol::VideoStub* video_stub); |
| 83 ~VideoFramePump() override; | 83 ~VideoFramePump() override; |
| 84 | 84 |
| 85 // VideoStream interface. | 85 // VideoStream interface. |
| 86 void Pause(bool pause) override; | 86 void Pause(bool pause) override; |
| 87 void OnInputEventReceived(int64_t event_timestamp) override; | 87 void OnInputEventReceived(int64_t event_timestamp) override; |
| 88 void SetLosslessEncode(bool want_lossless) override; | 88 void SetLosslessEncode(bool want_lossless) override; |
| 89 void SetLosslessColor(bool want_lossless) override; | 89 void SetLosslessColor(bool want_lossless) override; |
| 90 void SetSizeCallback(const SizeCallback& size_callback) override; | 90 void SetObserver(Observer* observer) override; |
| 91 | 91 |
| 92 protocol::VideoFeedbackStub* video_feedback_stub() { | 92 protocol::VideoFeedbackStub* video_feedback_stub() { |
| 93 return &capture_scheduler_; | 93 return &capture_scheduler_; |
| 94 } | 94 } |
| 95 | 95 |
| 96 private: | 96 private: |
| 97 struct FrameTimestamps { | 97 struct FrameTimestamps { |
| 98 FrameTimestamps(); | 98 FrameTimestamps(); |
| 99 ~FrameTimestamps(); | 99 ~FrameTimestamps(); |
| 100 | 100 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 158 |
| 159 // Capturer used to capture the screen. | 159 // Capturer used to capture the screen. |
| 160 std::unique_ptr<webrtc::DesktopCapturer> capturer_; | 160 std::unique_ptr<webrtc::DesktopCapturer> capturer_; |
| 161 | 161 |
| 162 // Used to encode captured frames. Always accessed on the encode thread. | 162 // Used to encode captured frames. Always accessed on the encode thread. |
| 163 std::unique_ptr<VideoEncoder> encoder_; | 163 std::unique_ptr<VideoEncoder> encoder_; |
| 164 | 164 |
| 165 // Interface through which video frames are passed to the client. | 165 // Interface through which video frames are passed to the client. |
| 166 protocol::VideoStub* video_stub_; | 166 protocol::VideoStub* video_stub_; |
| 167 | 167 |
| 168 SizeCallback size_callback_; | 168 Observer* observer_ = nullptr; |
| 169 webrtc::DesktopSize frame_size_; | 169 webrtc::DesktopSize frame_size_; |
| 170 webrtc::DesktopVector frame_dpi_; | 170 webrtc::DesktopVector frame_dpi_; |
| 171 | 171 |
| 172 // Timer used to ensure that we send empty keep-alive frames to the client | 172 // Timer used to ensure that we send empty keep-alive frames to the client |
| 173 // even when the video stream is paused or encoder is busy. | 173 // even when the video stream is paused or encoder is busy. |
| 174 base::Timer keep_alive_timer_; | 174 base::Timer keep_alive_timer_; |
| 175 | 175 |
| 176 // CaptureScheduler calls CaptureNextFrame() whenever a new frame needs to be | 176 // CaptureScheduler calls CaptureNextFrame() whenever a new frame needs to be |
| 177 // captured. | 177 // captured. |
| 178 CaptureScheduler capture_scheduler_; | 178 CaptureScheduler capture_scheduler_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 191 | 191 |
| 192 base::WeakPtrFactory<VideoFramePump> weak_factory_; | 192 base::WeakPtrFactory<VideoFramePump> weak_factory_; |
| 193 | 193 |
| 194 DISALLOW_COPY_AND_ASSIGN(VideoFramePump); | 194 DISALLOW_COPY_AND_ASSIGN(VideoFramePump); |
| 195 }; | 195 }; |
| 196 | 196 |
| 197 } // namespace protocol | 197 } // namespace protocol |
| 198 } // namespace remoting | 198 } // namespace remoting |
| 199 | 199 |
| 200 #endif // REMOTING_PROTOCOL_VIDEO_FRAME_PUMP_H_ | 200 #endif // REMOTING_PROTOCOL_VIDEO_FRAME_PUMP_H_ |
| OLD | NEW |