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/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/task.h" | 9 #include "base/task.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 SetOutputDimensions(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 27 matching lines...) Expand all Loading... |
88 scoped_refptr<media::VideoFrame> frame_; | 85 scoped_refptr<media::VideoFrame> frame_; |
89 bool frame_is_new_; | 86 bool frame_is_new_; |
90 | 87 |
91 // True if |consumer_| is currently using the frame. | 88 // True if |consumer_| is currently using the frame. |
92 bool frame_is_consuming_; | 89 bool frame_is_consuming_; |
93 }; | 90 }; |
94 | 91 |
95 } // namespace remoting | 92 } // namespace remoting |
96 | 93 |
97 #endif // REMOTING_CLIENT_RECTANGLE_UPDATE_DECODER_H_ | 94 #endif // REMOTING_CLIENT_RECTANGLE_UPDATE_DECODER_H_ |
OLD | NEW |