OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CLIENT_SOFTWARE_VIDEO_RENDERER_H_ | 5 #ifndef REMOTING_CLIENT_SOFTWARE_VIDEO_RENDERER_H_ |
6 #define REMOTING_CLIENT_SOFTWARE_VIDEO_RENDERER_H_ | 6 #define REMOTING_CLIENT_SOFTWARE_VIDEO_RENDERER_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "remoting/client/chromoting_stats.h" | 10 #include "remoting/client/chromoting_stats.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 SoftwareVideoRenderer( | 38 SoftwareVideoRenderer( |
39 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 39 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
40 scoped_refptr<base::SingleThreadTaskRunner> decode_task_runner, | 40 scoped_refptr<base::SingleThreadTaskRunner> decode_task_runner, |
41 scoped_refptr<FrameConsumerProxy> consumer); | 41 scoped_refptr<FrameConsumerProxy> consumer); |
42 ~SoftwareVideoRenderer() override; | 42 ~SoftwareVideoRenderer() override; |
43 | 43 |
44 // VideoRenderer implementation. | 44 // VideoRenderer implementation. |
45 void OnSessionConfig(const protocol::SessionConfig& config) override; | 45 void OnSessionConfig(const protocol::SessionConfig& config) override; |
46 ChromotingStats* GetStats() override; | 46 ChromotingStats* GetStats() override; |
47 void ProcessVideoPacket(scoped_ptr<VideoPacket> packet, | 47 void ProcessVideoPacket(scoped_ptr<VideoPacket> packet, |
48 const base::Closure& done) override; | 48 const ProgressCallback& progress_callback) override; |
49 | 49 |
50 // FrameProducer implementation. These methods may be called before we are | 50 // FrameProducer implementation. These methods may be called before we are |
51 // Initialize()d, or we know the source screen size. These methods may be | 51 // Initialize()d, or we know the source screen size. These methods may be |
52 // called on any thread. | 52 // called on any thread. |
53 // | 53 // |
54 // TODO(sergeyu): On Android a separate display thread is used for drawing. | 54 // TODO(sergeyu): On Android a separate display thread is used for drawing. |
55 // FrameConsumer calls FrameProducer on that thread. Can we avoid having a | 55 // FrameConsumer calls FrameProducer on that thread. Can we avoid having a |
56 // separate display thread? E.g. can we do everything on the decode thread? | 56 // separate display thread? E.g. can we do everything on the decode thread? |
57 void DrawBuffer(webrtc::DesktopFrame* buffer) override; | 57 void DrawBuffer(webrtc::DesktopFrame* buffer) override; |
58 void InvalidateRegion(const webrtc::DesktopRegion& region) override; | 58 void InvalidateRegion(const webrtc::DesktopRegion& region) override; |
59 void RequestReturnBuffers(const base::Closure& done) override; | 59 void RequestReturnBuffers(const base::Closure& done) override; |
60 void SetOutputSizeAndClip(const webrtc::DesktopSize& view_size, | 60 void SetOutputSizeAndClip(const webrtc::DesktopSize& view_size, |
61 const webrtc::DesktopRect& clip_area) override; | 61 const webrtc::DesktopRect& clip_area) override; |
62 | 62 |
63 private: | 63 private: |
64 class Core; | 64 class Core; |
65 | 65 |
66 // Callback method when a VideoPacket is processed. |decode_start| contains | 66 // Callback method when a VideoPacket is processed. |decode_start| contains |
67 // the timestamp when the packet will start to be processed. | 67 // the timestamp when the packet will start to be processed. |
68 void OnPacketDone(base::Time decode_start, const base::Closure& done); | 68 void OnPacketDone(base::Time decode_start, |
| 69 const ProgressCallback& progress_callback); |
69 | 70 |
70 scoped_refptr<base::SingleThreadTaskRunner> decode_task_runner_; | 71 scoped_refptr<base::SingleThreadTaskRunner> decode_task_runner_; |
71 scoped_ptr<Core> core_; | 72 scoped_ptr<Core> core_; |
72 | 73 |
73 ChromotingStats stats_; | 74 ChromotingStats stats_; |
74 | 75 |
75 // Keep track of the latest event timestamp bounced back from the host. | 76 // Keep track of the latest event timestamp bounced back from the host. |
76 int64 latest_event_timestamp_; | 77 int64 latest_event_timestamp_; |
77 | 78 |
78 base::WeakPtrFactory<SoftwareVideoRenderer> weak_factory_; | 79 base::WeakPtrFactory<SoftwareVideoRenderer> weak_factory_; |
79 | 80 |
80 DISALLOW_COPY_AND_ASSIGN(SoftwareVideoRenderer); | 81 DISALLOW_COPY_AND_ASSIGN(SoftwareVideoRenderer); |
81 }; | 82 }; |
82 | 83 |
83 } // namespace remoting | 84 } // namespace remoting |
84 | 85 |
85 #endif // REMOTING_CLIENT_SOFTWARE_VIDEO_RENDERER_H_ | 86 #endif // REMOTING_CLIENT_SOFTWARE_VIDEO_RENDERER_H_ |
OLD | NEW |