blob: dfef0b7293af428f484d386ac85d311258a9dedd [file] [log] [blame]
[email protected]622b7882010-09-29 17:34:321// 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
10typedef struct vpx_codec_ctx vpx_codec_ctx_t;
11
12namespace remoting {
13
14class DecoderVp8 : public Decoder {
15 public:
16 DecoderVp8();
[email protected]04b36142010-11-02 01:08:1917 virtual ~DecoderVp8();
[email protected]622b7882010-09-29 17:34:3218
19 // Decoder implementations.
[email protected]04b36142010-11-02 01:08:1920 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]622b7882010-09-29 17:34:3232
33 private:
[email protected]04b36142010-11-02 01:08:1934 enum State {
35 kUninitialized,
36 kReady,
37 kError,
38 };
[email protected]622b7882010-09-29 17:34:3239
40 // The internal state of the decoder.
41 State state_;
42
[email protected]622b7882010-09-29 17:34:3243 // The video frame to write to.
44 scoped_refptr<media::VideoFrame> frame_;
[email protected]622b7882010-09-29 17:34:3245
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_