blob: 5fe01694a7a6d143321eea7a8c01593f0151f29b [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]f2333df02010-11-01 23:02:4117 ~DecoderVp8();
[email protected]622b7882010-09-29 17:34:3218
19 // Decoder implementations.
[email protected]f2333df02010-11-01 23:02:4120 virtual bool BeginDecode(scoped_refptr<media::VideoFrame> frame,
21 UpdatedRects* update_rects,
22 Task* partial_decode_done,
23 Task* decode_done);
24 virtual bool PartialDecode(ChromotingHostMessage* message);
25 virtual void EndDecode();
[email protected]622b7882010-09-29 17:34:3226
27 private:
[email protected]f2333df02010-11-01 23:02:4128 bool HandleBeginRect(ChromotingHostMessage* message);
29 bool HandleRectData(ChromotingHostMessage* message);
30 bool HandleEndRect(ChromotingHostMessage* message);
[email protected]622b7882010-09-29 17:34:3231
32 // The internal state of the decoder.
33 State state_;
34
[email protected]f2333df02010-11-01 23:02:4135 // Keeps track of the updating rect.
36 int rect_x_;
37 int rect_y_;
38 int rect_width_;
39 int rect_height_;
40
41 // Tasks to call when decode is done.
42 scoped_ptr<Task> partial_decode_done_;
43 scoped_ptr<Task> decode_done_;
44
[email protected]622b7882010-09-29 17:34:3245 // The video frame to write to.
46 scoped_refptr<media::VideoFrame> frame_;
[email protected]f2333df02010-11-01 23:02:4147 UpdatedRects* updated_rects_;
[email protected]622b7882010-09-29 17:34:3248
49 vpx_codec_ctx_t* codec_;
50
51 DISALLOW_COPY_AND_ASSIGN(DecoderVp8);
52};
53
54} // namespace remoting
55
56#endif // REMOTING_BASE_DECODER_VP8_H_