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"
12 class DecompressorZlib
;
14 class DecoderZlib
: public Decoder
{
18 // Decoder implementations.
19 virtual bool BeginDecode(scoped_refptr
<media::VideoFrame
> frame
,
20 UpdatedRects
* update_rects
,
21 Task
* partial_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
; }
30 bool HandleBeginRect(HostMessage
* message
);
31 bool HandleRectData(HostMessage
* message
);
32 bool HandleEndRect(HostMessage
* message
);
34 // The internal state of the decoder.
37 // Keeps track of the updating rect.
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.
58 // The row number in the rect that we are updaing.
61 // True if we should decode the image upside down.
64 DISALLOW_COPY_AND_ASSIGN(DecoderZlib
);
67 } // namespace remoting
69 #endif // REMOTING_BASE_DECODER_ZLIB_H_