[email protected] | 622b788 | 2010-09-29 17:34:32 | [diff] [blame] | 1 | // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 | // Use of this source code is governed by a BSD-style license that can be | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #ifndef REMOTING_BASE_DECODER_VP8_H_ | ||||
6 | #define REMOTING_BASE_DECODER_VP8_H_ | ||||
7 | |||||
8 | #include "remoting/base/decoder.h" | ||||
9 | |||||
10 | typedef struct vpx_codec_ctx vpx_codec_ctx_t; | ||||
11 | |||||
12 | namespace remoting { | ||||
13 | |||||
14 | class DecoderVp8 : public Decoder { | ||||
15 | public: | ||||
16 | DecoderVp8(); | ||||
[email protected] | 04b3614 | 2010-11-02 01:08:19 | [diff] [blame^] | 17 | virtual ~DecoderVp8(); |
[email protected] | 622b788 | 2010-09-29 17:34:32 | [diff] [blame] | 18 | |
19 | // Decoder implementations. | ||||
[email protected] | 04b3614 | 2010-11-02 01:08:19 | [diff] [blame^] | 20 | virtual void Initialize(scoped_refptr<media::VideoFrame> frame, |
21 | const gfx::Rect& clip, int bytes_per_src_pixel); | ||||
22 | |||||
23 | virtual void Reset(); | ||||
24 | |||||
25 | // Feeds more data into the decoder. | ||||
26 | virtual void DecodeBytes(const std::string& encoded_bytes); | ||||
27 | |||||
28 | // Returns true if decoder is ready to accept data via ProcessRectangleData. | ||||
29 | virtual bool IsReadyForData(); | ||||
30 | |||||
31 | virtual VideoPacketFormat::Encoding Encoding(); | ||||
[email protected] | 622b788 | 2010-09-29 17:34:32 | [diff] [blame] | 32 | |
33 | private: | ||||
[email protected] | 04b3614 | 2010-11-02 01:08:19 | [diff] [blame^] | 34 | enum State { |
35 | kUninitialized, | ||||
36 | kReady, | ||||
37 | kError, | ||||
38 | }; | ||||
[email protected] | 622b788 | 2010-09-29 17:34:32 | [diff] [blame] | 39 | |
40 | // The internal state of the decoder. | ||||
41 | State state_; | ||||
42 | |||||
[email protected] | 622b788 | 2010-09-29 17:34:32 | [diff] [blame] | 43 | // The video frame to write to. |
44 | scoped_refptr<media::VideoFrame> frame_; | ||||
[email protected] | 622b788 | 2010-09-29 17:34:32 | [diff] [blame] | 45 | |
46 | vpx_codec_ctx_t* codec_; | ||||
47 | |||||
48 | DISALLOW_COPY_AND_ASSIGN(DecoderVp8); | ||||
49 | }; | ||||
50 | |||||
51 | } // namespace remoting | ||||
52 | |||||
53 | #endif // REMOTING_BASE_DECODER_VP8_H_ |