OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef REMOTING_TEST_SCROLL_FRAME_GENERATOR_H_ |
| 6 #define REMOTING_TEST_SCROLL_FRAME_GENERATOR_H_ |
| 7 |
| 8 #include <memory> |
| 9 #include <unordered_map> |
| 10 |
| 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/time/time.h" |
| 13 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" |
| 14 |
| 15 namespace remoting { |
| 16 namespace test { |
| 17 |
| 18 class ScrollFrameGenerator |
| 19 : public base::RefCountedThreadSafe<ScrollFrameGenerator> { |
| 20 public: |
| 21 ScrollFrameGenerator(); |
| 22 |
| 23 std::unique_ptr<webrtc::DesktopFrame> GenerateFrame( |
| 24 webrtc::SharedMemoryFactory* shared_memory_factory); |
| 25 |
| 26 base::TimeDelta GetFrameLatency(const webrtc::DesktopFrame& frame); |
| 27 |
| 28 private: |
| 29 ~ScrollFrameGenerator(); |
| 30 friend class base::RefCountedThreadSafe<ScrollFrameGenerator>; |
| 31 |
| 32 std::unique_ptr<webrtc::DesktopFrame> base_frame_; |
| 33 base::TimeTicks start_time_; |
| 34 |
| 35 std::unordered_map<int, base::TimeTicks> frame_timestamp_; |
| 36 |
| 37 // Id of the last frame encoded on the barcode. |
| 38 int last_frame_id_ = -1; |
| 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(ScrollFrameGenerator); |
| 41 }; |
| 42 |
| 43 } // namespace test |
| 44 } // namespace remoting |
| 45 |
| 46 #endif // REMOTING_TEST_SCROLL_FRAME_GENERATOR_H_ |
OLD | NEW |