| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "media/base/video_frame.h" | 10 #include "media/base/video_frame.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 // Initializes decoder with the infromation from the protocol config. | 33 // Initializes decoder with the infromation from the protocol config. |
| 34 void Initialize(const protocol::SessionConfig& config); | 34 void Initialize(const protocol::SessionConfig& config); |
| 35 | 35 |
| 36 // Decodes the contents of |packet| calling OnPartialFrameOutput() in the | 36 // Decodes the contents of |packet| calling OnPartialFrameOutput() in the |
| 37 // regsitered as data is avaialable. DecodePacket may keep a reference to | 37 // regsitered as data is avaialable. DecodePacket may keep a reference to |
| 38 // |packet| so the |packet| must remain alive and valid until |done| is | 38 // |packet| so the |packet| must remain alive and valid until |done| is |
| 39 // executed. | 39 // executed. |
| 40 void DecodePacket(const VideoPacket* packet, const base::Closure& done); | 40 void DecodePacket(const VideoPacket* packet, const base::Closure& done); |
| 41 | 41 |
| 42 // Set the scale ratio for the decoded video frame. Scale ratio greater | 42 // Set the output dimensions to scale video output to. |
| 43 // than 1.0 is not supported. | 43 void SetOutputSize(const SkISize& size); |
| 44 void SetScaleRatios(double horizontal_ratio, double vertical_ratio); | |
| 45 | 44 |
| 46 // Set a new clipping rectangle for the decoder. Decoder should respect | 45 // Set a new clipping rectangle for the decoder. Decoder should respect |
| 47 // this clipping rectangle and only decode content in this rectangle and | 46 // this clipping rectangle and only decode content in this rectangle and |
| 48 // report dirty rectangles accordingly to enhance performance. | 47 // report dirty rectangles accordingly to enhance performance. |
| 49 // | |
| 50 // If scale ratio is not 1.0 then clipping rectangle is ignored. | |
| 51 void UpdateClipRect(const SkIRect& clip_rect); | 48 void UpdateClipRect(const SkIRect& clip_rect); |
| 52 | 49 |
| 53 // Force the decoder to output the last decoded video frame without any | 50 // Force the decoder to output the last decoded video frame without any |
| 54 // clipping. | 51 // clipping. |
| 55 void RefreshFullFrame(); | 52 void RefreshFullFrame(); |
| 56 | 53 |
| 57 private: | 54 private: |
| 58 friend class base::RefCountedThreadSafe<RectangleUpdateDecoder>; | 55 friend class base::RefCountedThreadSafe<RectangleUpdateDecoder>; |
| 59 friend class PartialFrameCleanup; | 56 friend class PartialFrameCleanup; |
| 60 | 57 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 87 scoped_refptr<media::VideoFrame> frame_; | 84 scoped_refptr<media::VideoFrame> frame_; |
| 88 bool frame_is_new_; | 85 bool frame_is_new_; |
| 89 | 86 |
| 90 // True if |consumer_| is currently using the frame. | 87 // True if |consumer_| is currently using the frame. |
| 91 bool frame_is_consuming_; | 88 bool frame_is_consuming_; |
| 92 }; | 89 }; |
| 93 | 90 |
| 94 } // namespace remoting | 91 } // namespace remoting |
| 95 | 92 |
| 96 #endif // REMOTING_CLIENT_RECTANGLE_UPDATE_DECODER_H_ | 93 #endif // REMOTING_CLIENT_RECTANGLE_UPDATE_DECODER_H_ |
| OLD | NEW |