Chromium Code Reviews

Unified Diff: remoting/base/decoder_zlib.cc

Issue 3124005: Move UpdateStreamEncoding value into the BeginUpdateStreamMessage since we... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « remoting/base/decoder_verbatim.cc ('k') | remoting/base/protocol/chromotocol.proto » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/decoder_zlib.cc
===================================================================
--- remoting/base/decoder_zlib.cc (revision 57131)
+++ remoting/base/decoder_zlib.cc (working copy)
@@ -23,6 +23,7 @@
// to determine whether we should reverse the rows or not.
// But for simplicity we set to be always true.
reverse_rows_(true) {
+ encoding_ = EncodingZlib;
}
bool DecoderZlib::BeginDecode(scoped_refptr<media::VideoFrame> frame,
@@ -33,6 +34,7 @@
DCHECK(!decode_done_.get());
DCHECK(!updated_rects_);
DCHECK_EQ(kWaitingForBeginRect, state_);
+ DCHECK(!started_);
if (static_cast<PixelFormat>(frame->format()) != PixelFormatRgb32) {
LOG(INFO) << "DecoderZlib only supports RGB32.";
@@ -46,12 +48,15 @@
// Create the decompressor.
decompressor_.reset(new DecompressorZlib());
+
+ started_ = true;
return true;
}
bool DecoderZlib::PartialDecode(HostMessage* message) {
scoped_ptr<HostMessage> msg_deleter(message);
DCHECK(message->has_update_stream_packet());
+ DCHECK(started_);
bool ret = true;
if (message->update_stream_packet().has_begin_rect())
@@ -65,6 +70,8 @@
void DecoderZlib::EndDecode() {
DCHECK_EQ(kWaitingForBeginRect, state_);
+ DCHECK(started_);
+
decode_done_->Run();
partial_decode_done_.reset();
@@ -72,6 +79,7 @@
updated_rects_ = NULL;
frame_ = NULL;
decompressor_.reset();
+ started_ = false;
}
bool DecoderZlib::HandleBeginRect(HostMessage* message) {
Property changes on: remoting/base/decoder_zlib.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « remoting/base/decoder_verbatim.cc ('k') | remoting/base/protocol/chromotocol.proto » ('j') | no next file with comments »

Powered by Google App Engine