[email protected] | a9c88d1 | 2012-01-29 03:45:17 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 622b788 | 2010-09-29 17:34:32 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | 3860983 | 2012-08-23 01:36:10 | [diff] [blame^] | 5 | #ifndef REMOTING_CODEC_VIDEO_DECODER_VP8_H_ |
6 | #define REMOTING_CODEC_VIDEO_DECODER_VP8_H_ | ||||
[email protected] | 622b788 | 2010-09-29 17:34:32 | [diff] [blame] | 7 | |
[email protected] | 71f40a7 | 2012-05-16 07:26:59 | [diff] [blame] | 8 | #include "base/compiler_specific.h" |
[email protected] | 3860983 | 2012-08-23 01:36:10 | [diff] [blame^] | 9 | #include "remoting/codec/video_decoder.h" |
[email protected] | 622b788 | 2010-09-29 17:34:32 | [diff] [blame] | 10 | |
11 | typedef struct vpx_codec_ctx vpx_codec_ctx_t; | ||||
[email protected] | 47379e9 | 2011-07-26 15:33:15 | [diff] [blame] | 12 | typedef struct vpx_image vpx_image_t; |
[email protected] | 622b788 | 2010-09-29 17:34:32 | [diff] [blame] | 13 | |
14 | namespace remoting { | ||||
15 | |||||
16 | class DecoderVp8 : public Decoder { | ||||
17 | public: | ||||
18 | DecoderVp8(); | ||||
[email protected] | 04b3614 | 2010-11-02 01:08:19 | [diff] [blame] | 19 | virtual ~DecoderVp8(); |
[email protected] | 622b788 | 2010-09-29 17:34:32 | [diff] [blame] | 20 | |
21 | // Decoder implementations. | ||||
[email protected] | 55d3688e | 2012-02-24 23:05:56 | [diff] [blame] | 22 | virtual void Initialize(const SkISize& screen_size) OVERRIDE; |
[email protected] | bcad268 | 2011-09-30 20:35:26 | [diff] [blame] | 23 | virtual DecodeResult DecodePacket(const VideoPacket* packet) OVERRIDE; |
[email protected] | bcad268 | 2011-09-30 20:35:26 | [diff] [blame] | 24 | virtual bool IsReadyForData() OVERRIDE; |
[email protected] | bcad268 | 2011-09-30 20:35:26 | [diff] [blame] | 25 | virtual VideoPacketFormat::Encoding Encoding() OVERRIDE; |
[email protected] | 55d3688e | 2012-02-24 23:05:56 | [diff] [blame] | 26 | virtual void Invalidate(const SkISize& view_size, |
27 | const SkRegion& region) OVERRIDE; | ||||
28 | virtual void RenderFrame(const SkISize& view_size, | ||||
29 | const SkIRect& clip_area, | ||||
30 | uint8* image_buffer, | ||||
31 | int image_stride, | ||||
32 | SkRegion* output_region) OVERRIDE; | ||||
[email protected] | 622b788 | 2010-09-29 17:34:32 | [diff] [blame] | 33 | |
34 | private: | ||||
[email protected] | 04b3614 | 2010-11-02 01:08:19 | [diff] [blame] | 35 | enum State { |
36 | kUninitialized, | ||||
37 | kReady, | ||||
38 | kError, | ||||
39 | }; | ||||
[email protected] | 622b788 | 2010-09-29 17:34:32 | [diff] [blame] | 40 | |
41 | // The internal state of the decoder. | ||||
42 | State state_; | ||||
43 | |||||
[email protected] | 622b788 | 2010-09-29 17:34:32 | [diff] [blame] | 44 | vpx_codec_ctx_t* codec_; |
45 | |||||
[email protected] | 47379e9 | 2011-07-26 15:33:15 | [diff] [blame] | 46 | // Pointer to the last decoded image. |
47 | vpx_image_t* last_image_; | ||||
48 | |||||
[email protected] | 55d3688e | 2012-02-24 23:05:56 | [diff] [blame] | 49 | // The region updated that hasn't been copied to the screen yet. |
[email protected] | a9c88d1 | 2012-01-29 03:45:17 | [diff] [blame] | 50 | SkRegion updated_region_; |
[email protected] | 5068614 | 2011-02-04 02:08:32 | [diff] [blame] | 51 | |
[email protected] | 15e7b6c | 2011-12-22 10:20:33 | [diff] [blame] | 52 | // Output dimensions. |
[email protected] | 55d3688e | 2012-02-24 23:05:56 | [diff] [blame] | 53 | SkISize screen_size_; |
[email protected] | 47379e9 | 2011-07-26 15:33:15 | [diff] [blame] | 54 | |
[email protected] | 622b788 | 2010-09-29 17:34:32 | [diff] [blame] | 55 | DISALLOW_COPY_AND_ASSIGN(DecoderVp8); |
56 | }; | ||||
57 | |||||
58 | } // namespace remoting | ||||
59 | |||||
[email protected] | 3860983 | 2012-08-23 01:36:10 | [diff] [blame^] | 60 | #endif // REMOTING_CODEC_VIDEO_DECODER_VP8_H_ |