| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_RECTANGLE_UPDATE_DECODER_H_ | 5 #ifndef REMOTING_CLIENT_RECTANGLE_UPDATE_DECODER_H_ |
| 6 #define REMOTING_CLIENT_RECTANGLE_UPDATE_DECODER_H_ | 6 #define REMOTING_CLIENT_RECTANGLE_UPDATE_DECODER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "remoting/codec/video_decoder.h" | 13 #include "remoting/codec/video_decoder.h" |
| 14 #include "remoting/client/chromoting_stats.h" | 14 #include "remoting/client/chromoting_stats.h" |
| 15 #include "remoting/client/frame_consumer_proxy.h" | 15 #include "remoting/client/frame_consumer_proxy.h" |
| 16 #include "remoting/client/frame_producer.h" | 16 #include "remoting/client/frame_producer.h" |
| 17 #include "remoting/protocol/video_stub.h" | 17 #include "remoting/protocol/video_stub.h" |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 class SingleThreadTaskRunner; | 20 class SingleThreadTaskRunner; |
| 21 } // namespace base | 21 } // namespace base |
| 22 | 22 |
| 23 namespace pp { | |
| 24 class ImageData; | |
| 25 } // namespace pp | |
| 26 | |
| 27 namespace remoting { | 23 namespace remoting { |
| 28 | 24 |
| 29 class ChromotingStats; | 25 class ChromotingStats; |
| 30 | 26 |
| 31 namespace protocol { | 27 namespace protocol { |
| 32 class SessionConfig; | 28 class SessionConfig; |
| 33 } // namespace protocol | 29 } // namespace protocol |
| 34 | 30 |
| 35 // TODO(ajwong): Re-examine this API, especially with regards to how error | 31 // TODO(ajwong): Re-examine this API, especially with regards to how error |
| 36 // conditions on each step are reported. Should they be CHECKs? Logs? Other? | 32 // conditions on each step are reported. Should they be CHECKs? Logs? Other? |
| (...skipping 11 matching lines...) Expand all Loading... |
| 48 RectangleUpdateDecoder( | 44 RectangleUpdateDecoder( |
| 49 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 45 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 50 scoped_refptr<base::SingleThreadTaskRunner> decode_task_runner, | 46 scoped_refptr<base::SingleThreadTaskRunner> decode_task_runner, |
| 51 scoped_refptr<FrameConsumerProxy> consumer); | 47 scoped_refptr<FrameConsumerProxy> consumer); |
| 52 | 48 |
| 53 // Initializes decoder with the information from the protocol config. | 49 // Initializes decoder with the information from the protocol config. |
| 54 void Initialize(const protocol::SessionConfig& config); | 50 void Initialize(const protocol::SessionConfig& config); |
| 55 | 51 |
| 56 // FrameProducer implementation. These methods may be called before we are | 52 // FrameProducer implementation. These methods may be called before we are |
| 57 // Initialize()d, or we know the source screen size. | 53 // Initialize()d, or we know the source screen size. |
| 58 virtual void DrawBuffer(pp::ImageData* buffer) OVERRIDE; | 54 virtual void DrawBuffer(webrtc::DesktopFrame* buffer) OVERRIDE; |
| 59 virtual void InvalidateRegion(const SkRegion& region) OVERRIDE; | 55 virtual void InvalidateRegion(const SkRegion& region) OVERRIDE; |
| 60 virtual void RequestReturnBuffers(const base::Closure& done) OVERRIDE; | 56 virtual void RequestReturnBuffers(const base::Closure& done) OVERRIDE; |
| 61 virtual void SetOutputSizeAndClip(const SkISize& view_size, | 57 virtual void SetOutputSizeAndClip(const SkISize& view_size, |
| 62 const SkIRect& clip_area) OVERRIDE; | 58 const SkIRect& clip_area) OVERRIDE; |
| 63 virtual const SkRegion* GetBufferShape() OVERRIDE; | 59 virtual const SkRegion* GetBufferShape() OVERRIDE; |
| 64 | 60 |
| 65 // VideoStub implementation. | 61 // VideoStub implementation. |
| 66 virtual void ProcessVideoPacket(scoped_ptr<VideoPacket> packet, | 62 virtual void ProcessVideoPacket(scoped_ptr<VideoPacket> packet, |
| 67 const base::Closure& done) OVERRIDE; | 63 const base::Closure& done) OVERRIDE; |
| 68 | 64 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 99 SkISize source_size_; | 95 SkISize source_size_; |
| 100 | 96 |
| 101 // Vertical and horizontal DPI of the remote screen. | 97 // Vertical and horizontal DPI of the remote screen. |
| 102 SkIPoint source_dpi_; | 98 SkIPoint source_dpi_; |
| 103 | 99 |
| 104 // The current dimensions of the frame consumer view. | 100 // The current dimensions of the frame consumer view. |
| 105 SkISize view_size_; | 101 SkISize view_size_; |
| 106 SkIRect clip_area_; | 102 SkIRect clip_area_; |
| 107 | 103 |
| 108 // The drawing buffers supplied by the frame consumer. | 104 // The drawing buffers supplied by the frame consumer. |
| 109 std::list<pp::ImageData*> buffers_; | 105 std::list<webrtc::DesktopFrame*> buffers_; |
| 110 | 106 |
| 111 // Flag used to coalesce runs of SchedulePaint()s into a single DoPaint(). | 107 // Flag used to coalesce runs of SchedulePaint()s into a single DoPaint(). |
| 112 bool paint_scheduled_; | 108 bool paint_scheduled_; |
| 113 | 109 |
| 114 ChromotingStats stats_; | 110 ChromotingStats stats_; |
| 115 | 111 |
| 116 // Keep track of the most recent sequence number bounced back from the host. | 112 // Keep track of the most recent sequence number bounced back from the host. |
| 117 int64 latest_sequence_number_; | 113 int64 latest_sequence_number_; |
| 118 }; | 114 }; |
| 119 | 115 |
| 120 } // namespace remoting | 116 } // namespace remoting |
| 121 | 117 |
| 122 #endif // REMOTING_CLIENT_RECTANGLE_UPDATE_DECODER_H_ | 118 #endif // REMOTING_CLIENT_RECTANGLE_UPDATE_DECODER_H_ |
| OLD | NEW |