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_CODEC_VIDEO_DECODER_VP8_H_ | 5 #ifndef REMOTING_CODEC_VIDEO_DECODER_VP8_H_ |
6 #define REMOTING_CODEC_VIDEO_DECODER_VP8_H_ | 6 #define REMOTING_CODEC_VIDEO_DECODER_VP8_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "remoting/codec/video_decoder.h" | 9 #include "remoting/codec/video_decoder.h" |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 virtual DecodeResult DecodePacket(const VideoPacket* packet) OVERRIDE; | 23 virtual DecodeResult DecodePacket(const VideoPacket* packet) OVERRIDE; |
24 virtual bool IsReadyForData() OVERRIDE; | 24 virtual bool IsReadyForData() OVERRIDE; |
25 virtual VideoPacketFormat::Encoding Encoding() OVERRIDE; | 25 virtual VideoPacketFormat::Encoding Encoding() OVERRIDE; |
26 virtual void Invalidate(const SkISize& view_size, | 26 virtual void Invalidate(const SkISize& view_size, |
27 const SkRegion& region) OVERRIDE; | 27 const SkRegion& region) OVERRIDE; |
28 virtual void RenderFrame(const SkISize& view_size, | 28 virtual void RenderFrame(const SkISize& view_size, |
29 const SkIRect& clip_area, | 29 const SkIRect& clip_area, |
30 uint8* image_buffer, | 30 uint8* image_buffer, |
31 int image_stride, | 31 int image_stride, |
32 SkRegion* output_region) OVERRIDE; | 32 SkRegion* output_region) OVERRIDE; |
| 33 virtual const SkRegion* GetImageShape() OVERRIDE; |
33 | 34 |
34 private: | 35 private: |
35 enum State { | 36 enum State { |
36 kUninitialized, | 37 kUninitialized, |
37 kReady, | 38 kReady, |
38 kError, | 39 kError, |
39 }; | 40 }; |
40 | 41 |
| 42 // Fills the rectangle |rect| with the given ARGB color |color| in |buffer|. |
| 43 void FillRect(uint8* buffer, int stride, const SkIRect& rect, uint32 color); |
| 44 |
| 45 // Calculates the difference between the desktop shape regions in two |
| 46 // consecutive frames and updates |updated_region_| and |transparent_region_| |
| 47 // accordingly. |
| 48 void UpdateDesktopShapeRegion(SkRegion* new_desktop_shape_region); |
| 49 |
41 // The internal state of the decoder. | 50 // The internal state of the decoder. |
42 State state_; | 51 State state_; |
43 | 52 |
44 vpx_codec_ctx_t* codec_; | 53 vpx_codec_ctx_t* codec_; |
45 | 54 |
46 // Pointer to the last decoded image. | 55 // Pointer to the last decoded image. |
47 vpx_image_t* last_image_; | 56 vpx_image_t* last_image_; |
48 | 57 |
49 // The region updated that hasn't been copied to the screen yet. | 58 // The region updated that hasn't been copied to the screen yet. |
50 SkRegion updated_region_; | 59 SkRegion updated_region_; |
51 | 60 |
52 // Output dimensions. | 61 // Output dimensions. |
53 SkISize screen_size_; | 62 SkISize screen_size_; |
54 | 63 |
| 64 // The region occupied by the top level windows. |
| 65 SkRegion desktop_shape_region_; |
| 66 |
| 67 // The region that should be make transparent. |
| 68 SkRegion transparent_region_; |
| 69 |
55 DISALLOW_COPY_AND_ASSIGN(VideoDecoderVp8); | 70 DISALLOW_COPY_AND_ASSIGN(VideoDecoderVp8); |
56 }; | 71 }; |
57 | 72 |
58 } // namespace remoting | 73 } // namespace remoting |
59 | 74 |
60 #endif // REMOTING_CODEC_VIDEO_DECODER_VP8_H_ | 75 #endif // REMOTING_CODEC_VIDEO_DECODER_VP8_H_ |
OLD | NEW |