diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-09 23:22:20 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-09 23:22:20 +0000 |
commit | 3adf1b2a65a85ff7d4b55cd57a4e400f104d27dd (patch) | |
tree | 235aee1f595583297e057b058a29d2ed24d9da92 /remoting/base/decoder_row_based.h | |
parent | 9db9173baebf27623ce30770696f84a3fec74259 (diff) | |
download | chromium_src-3adf1b2a65a85ff7d4b55cd57a4e400f104d27dd.zip chromium_src-3adf1b2a65a85ff7d4b55cd57a4e400f104d27dd.tar.gz chromium_src-3adf1b2a65a85ff7d4b55cd57a4e400f104d27dd.tar.bz2 |
Add VideoPacket struct for video packets. Refactor Decode interface to use it.
Various cleanups.
BUG=None
TEST=Unittests.
Review URL: http://codereview.chromium.org/4476003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65590 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/base/decoder_row_based.h')
-rw-r--r-- | remoting/base/decoder_row_based.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/remoting/base/decoder_row_based.h b/remoting/base/decoder_row_based.h index 2deb897..da05c05 100644 --- a/remoting/base/decoder_row_based.h +++ b/remoting/base/decoder_row_based.h @@ -19,12 +19,12 @@ class DecoderRowBased : public Decoder { static DecoderRowBased* CreateVerbatimDecoder(); // Decoder implementation. - virtual void Reset(); virtual bool IsReadyForData(); - virtual void Initialize(scoped_refptr<media::VideoFrame> frame, - const gfx::Rect& clip, int bytes_per_src_pixel); - virtual void DecodeBytes(const std::string& encoded_bytes); - virtual VideoPacketFormat::Encoding Encoding() { return encoding_; } + virtual void Initialize(scoped_refptr<media::VideoFrame> frame); + virtual DecodeResult DecodePacket(const VideoPacket* packet); + virtual void GetUpdatedRects(UpdatedRects* rects); + virtual void Reset(); + virtual VideoPacketFormat::Encoding Encoding(); // TODO(hclam): Should make this into the Decoder interface. // TODO(ajwong): Before putting into the interface, we should decide if the @@ -32,15 +32,20 @@ class DecoderRowBased : public Decoder { void set_reverse_rows(bool reverse) { reverse_rows_ = reverse; } private: - DecoderRowBased(Decompressor* decompressor, - VideoPacketFormat::Encoding encoding); - enum State { kUninitialized, kReady, + kProcessing, + kDone, kError, }; + DecoderRowBased(Decompressor* decompressor, + VideoPacketFormat::Encoding encoding); + + // Helper method. Called from DecodePacket to updated state of the decoder. + void UpdateStateForPacket(const VideoPacket* packet); + // The internal state of the decoder. State state_; @@ -56,9 +61,6 @@ class DecoderRowBased : public Decoder { // The encoding of the incoming stream. VideoPacketFormat::Encoding encoding_; - // Number of bytes per pixel from source stream. - int bytes_per_src_pixel_; - // The position in the row that we are updating. int row_pos_; |