diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-01 22:23:08 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-01 22:23:08 +0000 |
commit | 4e758b649512b9e6ab5c6c67f38572894062139d (patch) | |
tree | 5322a791926a0218d78c8d41afe03705a8a95e54 /remoting/base/decoder_vp8.h | |
parent | 715126056fa8080cd3c5b21e513dd417ddd6c66f (diff) | |
download | chromium_src-4e758b649512b9e6ab5c6c67f38572894062139d.zip chromium_src-4e758b649512b9e6ab5c6c67f38572894062139d.tar.gz chromium_src-4e758b649512b9e6ab5c6c67f38572894062139d.tar.bz2 |
Cleanups in the video encoding decoding code. Reenable VP8.
1. Moved video-related protobuf messages from event.proto to video.proto. Removed those that we don't need anymore
2. Fixed naming for enums and some types.
3. Reenabled VP8.
4. Proper RGB-YUV converter for VP8 encoder.
5. Changed the capturer_fake to show more meaningful picture.
BUG=57374
TEST=unittests
Review URL: http://codereview.chromium.org/4136010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64672 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/base/decoder_vp8.h')
-rw-r--r-- | remoting/base/decoder_vp8.h | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/remoting/base/decoder_vp8.h b/remoting/base/decoder_vp8.h index 5fe0169..dfef0b7 100644 --- a/remoting/base/decoder_vp8.h +++ b/remoting/base/decoder_vp8.h @@ -14,37 +14,34 @@ namespace remoting { class DecoderVp8 : public Decoder { public: DecoderVp8(); - ~DecoderVp8(); + virtual ~DecoderVp8(); // Decoder implementations. - virtual bool BeginDecode(scoped_refptr<media::VideoFrame> frame, - UpdatedRects* update_rects, - Task* partial_decode_done, - Task* decode_done); - virtual bool PartialDecode(ChromotingHostMessage* message); - virtual void EndDecode(); + virtual void Initialize(scoped_refptr<media::VideoFrame> frame, + const gfx::Rect& clip, int bytes_per_src_pixel); + + virtual void Reset(); + + // Feeds more data into the decoder. + virtual void DecodeBytes(const std::string& encoded_bytes); + + // Returns true if decoder is ready to accept data via ProcessRectangleData. + virtual bool IsReadyForData(); + + virtual VideoPacketFormat::Encoding Encoding(); private: - bool HandleBeginRect(ChromotingHostMessage* message); - bool HandleRectData(ChromotingHostMessage* message); - bool HandleEndRect(ChromotingHostMessage* message); + enum State { + kUninitialized, + kReady, + kError, + }; // The internal state of the decoder. State state_; - // Keeps track of the updating rect. - int rect_x_; - int rect_y_; - int rect_width_; - int rect_height_; - - // Tasks to call when decode is done. - scoped_ptr<Task> partial_decode_done_; - scoped_ptr<Task> decode_done_; - // The video frame to write to. scoped_refptr<media::VideoFrame> frame_; - UpdatedRects* updated_rects_; vpx_codec_ctx_t* codec_; |