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_BASE_DECODER_VP8_H_ | 5 #ifndef REMOTING_BASE_DECODER_VP8_H_ |
6 #define REMOTING_BASE_DECODER_VP8_H_ | 6 #define REMOTING_BASE_DECODER_VP8_H_ |
7 | 7 |
8 #include "remoting/base/decoder.h" | 8 #include "remoting/base/decoder.h" |
9 | 9 |
10 typedef struct vpx_codec_ctx vpx_codec_ctx_t; | 10 typedef struct vpx_codec_ctx vpx_codec_ctx_t; |
(...skipping 17 matching lines...) Expand all Loading... |
28 virtual void SetClipRect(const SkIRect& clip_rect) OVERRIDE; | 28 virtual void SetClipRect(const SkIRect& clip_rect) OVERRIDE; |
29 virtual void RefreshRegion(const SkRegion& region) OVERRIDE; | 29 virtual void RefreshRegion(const SkRegion& region) OVERRIDE; |
30 | 30 |
31 private: | 31 private: |
32 enum State { | 32 enum State { |
33 kUninitialized, | 33 kUninitialized, |
34 kReady, | 34 kReady, |
35 kError, | 35 kError, |
36 }; | 36 }; |
37 | 37 |
38 // Return true if scaling is enabled | |
39 bool DoScaling() const; | |
40 | |
41 // Perform color space conversion on the specified region. | |
42 // Writes the updated region to |output_region|. | |
43 void ConvertRegion(const SkRegion& region, | |
44 SkRegion* output_region); | |
45 | |
46 // Perform scaling and color space conversion on the specified | |
47 // region. Writes the updated rectangles to |output_region|. | |
48 void ScaleAndConvertRegion(const SkRegion& region, | |
49 SkRegion* output_region); | |
50 | |
51 // The internal state of the decoder. | 38 // The internal state of the decoder. |
52 State state_; | 39 State state_; |
53 | 40 |
54 // The video frame to write to. | 41 // The video frame to write to. |
55 scoped_refptr<media::VideoFrame> frame_; | 42 scoped_refptr<media::VideoFrame> frame_; |
56 | 43 |
57 vpx_codec_ctx_t* codec_; | 44 vpx_codec_ctx_t* codec_; |
58 | 45 |
59 // Pointer to the last decoded image. | 46 // Pointer to the last decoded image. |
60 vpx_image_t* last_image_; | 47 vpx_image_t* last_image_; |
61 | 48 |
62 // The region updated by the most recent decode. | 49 // The region updated by the most recent decode. |
63 SkRegion updated_region_; | 50 SkRegion updated_region_; |
64 | 51 |
65 // Clipping rect for the output of the decoder. | 52 // Clipping rect for the output of the decoder. |
66 SkIRect clip_rect_; | 53 SkIRect clip_rect_; |
67 | 54 |
68 // Output dimensions. | 55 // Output dimensions. |
69 SkISize output_size_; | 56 SkISize output_size_; |
70 | 57 |
71 DISALLOW_COPY_AND_ASSIGN(DecoderVp8); | 58 DISALLOW_COPY_AND_ASSIGN(DecoderVp8); |
72 }; | 59 }; |
73 | 60 |
74 } // namespace remoting | 61 } // namespace remoting |
75 | 62 |
76 #endif // REMOTING_BASE_DECODER_VP8_H_ | 63 #endif // REMOTING_BASE_DECODER_VP8_H_ |
OLD | NEW |