| OLD | NEW |
| (Empty) |
| 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_VERBATIM_H_ | |
| 6 #define REMOTING_BASE_DECODER_VERBATIM_H_ | |
| 7 | |
| 8 #include "remoting/base/decoder.h" | |
| 9 | |
| 10 namespace remoting { | |
| 11 | |
| 12 class DecoderVerbatim : public Decoder { | |
| 13 public: | |
| 14 DecoderVerbatim(); | |
| 15 | |
| 16 // Decoder implementations. | |
| 17 virtual bool BeginDecode(scoped_refptr<media::VideoFrame> frame, | |
| 18 UpdatedRects* update_rects, | |
| 19 Task* partial_decode_done, | |
| 20 Task* decode_done); | |
| 21 virtual bool PartialDecode(ChromotingHostMessage* message); | |
| 22 virtual void EndDecode(); | |
| 23 | |
| 24 void set_reverse_rows(bool reverse) { reverse_rows_ = reverse; } | |
| 25 | |
| 26 private: | |
| 27 bool HandleBeginRect(ChromotingHostMessage* message); | |
| 28 bool HandleRectData(ChromotingHostMessage* message); | |
| 29 bool HandleEndRect(ChromotingHostMessage* message); | |
| 30 | |
| 31 // The internal state of the decoder. | |
| 32 State state_; | |
| 33 | |
| 34 // Keeps track of the updating rect. | |
| 35 int rect_x_; | |
| 36 int rect_y_; | |
| 37 int rect_width_; | |
| 38 int rect_height_; | |
| 39 int bytes_per_pixel_; | |
| 40 | |
| 41 // Tasks to call when decode is done. | |
| 42 scoped_ptr<Task> partial_decode_done_; | |
| 43 scoped_ptr<Task> decode_done_; | |
| 44 | |
| 45 // The video frame to write to. | |
| 46 scoped_refptr<media::VideoFrame> frame_; | |
| 47 UpdatedRects* updated_rects_; | |
| 48 | |
| 49 // True if we should reverse the rows when copying data into the target | |
| 50 // frame buffer. | |
| 51 bool reverse_rows_; | |
| 52 | |
| 53 DISALLOW_COPY_AND_ASSIGN(DecoderVerbatim); | |
| 54 }; | |
| 55 | |
| 56 } // namespace remoting | |
| 57 | |
| 58 #endif // REMOTING_BASE_DECODER_VERBATIM_H_ | |
| OLD | NEW |