Initialize all data members in HTTPResponseInfo's new ctor and remove the related...
[chromium-blink-merge.git] / remoting / base / decoder_zlib.h
blob05f8a99e34a8e15a99bcb8a5c5f612f869eadbde
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.
5 #ifndef REMOTING_BASE_DECODER_ZLIB_H_
6 #define REMOTING_BASE_DECODER_ZLIB_H_
8 #include "remoting/base/decoder.h"
10 namespace remoting {
12 class DecompressorZlib;
14 class DecoderZlib : public Decoder {
15 public:
16 DecoderZlib();
18 // Decoder implementations.
19 virtual bool BeginDecode(scoped_refptr<media::VideoFrame> frame,
20 UpdatedRects* update_rects,
21 Task* partial_decode_done,
22 Task* decode_done);
23 virtual bool PartialDecode(HostMessage* message);
24 virtual void EndDecode();
26 // TODO(hclam): Should make this into the Decoder interface.
27 void set_reverse_rows(bool reverse) { reverse_rows_ = reverse; }
29 private:
30 bool HandleBeginRect(HostMessage* message);
31 bool HandleRectData(HostMessage* message);
32 bool HandleEndRect(HostMessage* message);
34 // The internal state of the decoder.
35 State state_;
37 // Keeps track of the updating rect.
38 int rect_x_;
39 int rect_y_;
40 int rect_width_;
41 int rect_height_;
42 int bytes_per_pixel_;
44 // Tasks to call when decode is done.
45 scoped_ptr<Task> partial_decode_done_;
46 scoped_ptr<Task> decode_done_;
48 // The video frame to write to.
49 scoped_refptr<media::VideoFrame> frame_;
50 UpdatedRects* updated_rects_;
52 // A zlib decompressor used throughout one update sequence.
53 scoped_ptr<DecompressorZlib> decompressor_;
55 // The position in the row that we are updating.
56 int row_pos_;
58 // The row number in the rect that we are updaing.
59 int row_y_;
61 // True if we should decode the image upside down.
62 bool reverse_rows_;
64 DISALLOW_COPY_AND_ASSIGN(DecoderZlib);
67 } // namespace remoting
69 #endif // REMOTING_BASE_DECODER_ZLIB_H_