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_ROW_BASED_H_ | 5 #ifndef REMOTING_CODEC_VIDEO_DECODER_ROW_BASED_H_ |
6 #define REMOTING_CODEC_VIDEO_DECODER_ROW_BASED_H_ | 6 #define REMOTING_CODEC_VIDEO_DECODER_ROW_BASED_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "remoting/codec/video_decoder.h" | 10 #include "remoting/codec/video_decoder.h" |
11 | 11 |
12 namespace remoting { | 12 namespace remoting { |
13 | 13 |
14 class Decompressor; | 14 class Decompressor; |
15 | 15 |
16 class DecoderRowBased : public Decoder { | 16 class VideoDecoderRowBased : public VideoDecoder { |
17 public: | 17 public: |
18 virtual ~DecoderRowBased(); | 18 virtual ~VideoDecoderRowBased(); |
19 | 19 |
20 static DecoderRowBased* CreateZlibDecoder(); | 20 static VideoDecoderRowBased* CreateZlibDecoder(); |
21 static DecoderRowBased* CreateVerbatimDecoder(); | 21 static VideoDecoderRowBased* CreateVerbatimDecoder(); |
22 | 22 |
23 // Decoder implementation. | 23 // VideoDecoder implementation. |
24 virtual bool IsReadyForData() OVERRIDE; | 24 virtual bool IsReadyForData() OVERRIDE; |
25 virtual void Initialize(const SkISize& screen_size) OVERRIDE; | 25 virtual void Initialize(const SkISize& screen_size) OVERRIDE; |
26 virtual DecodeResult DecodePacket(const VideoPacket* packet) OVERRIDE; | 26 virtual DecodeResult DecodePacket(const VideoPacket* packet) OVERRIDE; |
27 virtual VideoPacketFormat::Encoding Encoding() OVERRIDE; | 27 virtual VideoPacketFormat::Encoding Encoding() OVERRIDE; |
28 virtual void Invalidate(const SkISize& view_size, | 28 virtual void Invalidate(const SkISize& view_size, |
29 const SkRegion& region) OVERRIDE; | 29 const SkRegion& region) OVERRIDE; |
30 virtual void RenderFrame(const SkISize& view_size, | 30 virtual void RenderFrame(const SkISize& view_size, |
31 const SkIRect& clip_area, | 31 const SkIRect& clip_area, |
32 uint8* image_buffer, | 32 uint8* image_buffer, |
33 int image_stride, | 33 int image_stride, |
34 SkRegion* output_region) OVERRIDE; | 34 SkRegion* output_region) OVERRIDE; |
35 | 35 |
36 private: | 36 private: |
37 enum State { | 37 enum State { |
38 kUninitialized, | 38 kUninitialized, |
39 kReady, | 39 kReady, |
40 kProcessing, | 40 kProcessing, |
41 kPartitionDone, | 41 kPartitionDone, |
42 kDone, | 42 kDone, |
43 kError, | 43 kError, |
44 }; | 44 }; |
45 | 45 |
46 DecoderRowBased(Decompressor* decompressor, | 46 VideoDecoderRowBased(Decompressor* decompressor, |
47 VideoPacketFormat::Encoding encoding); | 47 VideoPacketFormat::Encoding encoding); |
48 | 48 |
49 // Helper method. Called from DecodePacket to updated state of the decoder. | 49 // Helper method. Called from DecodePacket to updated state of the decoder. |
50 void UpdateStateForPacket(const VideoPacket* packet); | 50 void UpdateStateForPacket(const VideoPacket* packet); |
51 | 51 |
52 // The internal state of the decoder. | 52 // The internal state of the decoder. |
53 State state_; | 53 State state_; |
54 | 54 |
55 // Keeps track of the updating rect. | 55 // Keeps track of the updating rect. |
56 SkIRect clip_; | 56 SkIRect clip_; |
57 | 57 |
(...skipping 11 matching lines...) Expand all Loading... |
69 | 69 |
70 // The region updated that hasn't been copied to the screen yet. | 70 // The region updated that hasn't been copied to the screen yet. |
71 SkRegion updated_region_; | 71 SkRegion updated_region_; |
72 | 72 |
73 // Size of the remote screen. | 73 // Size of the remote screen. |
74 SkISize screen_size_; | 74 SkISize screen_size_; |
75 | 75 |
76 // The bitmap holding the remote screen bits. | 76 // The bitmap holding the remote screen bits. |
77 scoped_array<uint8> screen_buffer_; | 77 scoped_array<uint8> screen_buffer_; |
78 | 78 |
79 DISALLOW_COPY_AND_ASSIGN(DecoderRowBased); | 79 DISALLOW_COPY_AND_ASSIGN(VideoDecoderRowBased); |
80 }; | 80 }; |
81 | 81 |
82 } // namespace remoting | 82 } // namespace remoting |
83 | 83 |
84 #endif // REMOTING_CODEC_VIDEO_DECODER_ROW_BASED_H_ | 84 #endif // REMOTING_CODEC_VIDEO_DECODER_ROW_BASED_H_ |
OLD | NEW |