From d656b8af5feef13c5d8550e27261f945c563f676 Mon Sep 17 00:00:00 2001
From: "hclam@chromium.org"
 <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Tue, 27 Jul 2010 01:49:50 +0000
Subject: [chromoting] Use zlib as the default encoder and decoder

Use EncoderZlib / DecoderZlib as default encoder and decoder.

BUG=50246

Review URL: http://codereview.chromium.org/3034035

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53742 0039d316-1c4b-4281-b951-d872f2087c98
---
 remoting/base/decoder_zlib.cc         | 13 ++++++++-----
 remoting/client/plugin/pepper_view.cc |  4 ++--
 remoting/host/simple_host_process.cc  |  4 ++--
 remoting/remoting.gyp                 |  1 -
 4 files changed, 12 insertions(+), 10 deletions(-)

(limited to 'remoting')

diff --git a/remoting/base/decoder_zlib.cc b/remoting/base/decoder_zlib.cc
index 59f9852..3e23f95 100644
--- a/remoting/base/decoder_zlib.cc
+++ b/remoting/base/decoder_zlib.cc
@@ -22,15 +22,18 @@ DecoderZlib::DecoderZlib()
 }
 
 bool DecoderZlib::BeginDecode(scoped_refptr<media::VideoFrame> frame,
-                                  UpdatedRects* updated_rects,
-                                  Task* partial_decode_done,
-                                  Task* decode_done) {
+                              UpdatedRects* updated_rects,
+                              Task* partial_decode_done,
+                              Task* decode_done) {
   DCHECK(!partial_decode_done_.get());
   DCHECK(!decode_done_.get());
   DCHECK(!updated_rects_);
   DCHECK_EQ(kWaitingForBeginRect, state_);
-  CHECK(static_cast<PixelFormat>(frame->format()) == PixelFormatRgb32)
-      << "Only RGB32 is supported";
+
+  if (static_cast<PixelFormat>(frame->format()) != PixelFormatRgb32) {
+    LOG(INFO) << "DecoderZlib only supports RGB32.";
+    return false;
+  }
 
   partial_decode_done_.reset(partial_decode_done);
   decode_done_.reset(decode_done);
diff --git a/remoting/client/plugin/pepper_view.cc b/remoting/client/plugin/pepper_view.cc
index 5b96226..c2f3538 100644
--- a/remoting/client/plugin/pepper_view.cc
+++ b/remoting/client/plugin/pepper_view.cc
@@ -5,7 +5,7 @@
 #include "remoting/client/plugin/pepper_view.h"
 
 #include "base/message_loop.h"
-#include "remoting/base/decoder_verbatim.h"
+#include "remoting/base/decoder_zlib.h"
 #include "remoting/client/plugin/chromoting_plugin.h"
 #include "remoting/client/plugin/pepper_util.h"
 #include "third_party/ppapi/cpp/device_context_2d.h"
@@ -150,7 +150,7 @@ void PepperView::HandleBeginUpdateStream(HostMessage* msg) {
   // TODO(hclam): Use the information from the message to create the decoder.
   // We lazily construct the decoder.
   if (!decoder_.get()) {
-    decoder_.reset(new DecoderVerbatim());
+    decoder_.reset(new DecoderZlib());
   }
 
   if (!frame_) {
diff --git a/remoting/host/simple_host_process.cc b/remoting/host/simple_host_process.cc
index 1c89fa3..7f0b6bd 100644
--- a/remoting/host/simple_host_process.cc
+++ b/remoting/host/simple_host_process.cc
@@ -26,7 +26,7 @@
 #include "base/nss_util.h"
 #include "base/scoped_nsautorelease_pool.h"
 #include "base/thread.h"
-#include "remoting/base/encoder_verbatim.h"
+#include "remoting/base/encoder_zlib.h"
 #include "remoting/host/capturer_fake.h"
 #include "remoting/host/chromoting_host.h"
 #include "remoting/host/chromoting_host_context.h"
@@ -84,7 +84,7 @@ int main(int argc, char** argv) {
   capturer.reset(new remoting::CapturerMac());
   executor.reset(new remoting::EventExecutorMac());
 #endif
-  encoder.reset(new remoting::EncoderVerbatim());
+  encoder.reset(new remoting::EncoderZlib());
 
   // Check the argument to see if we should use a fake capturer and encoder.
   bool fake = cmd_line->HasSwitch(kFakeSwitchName);
diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp
index a0f3ea1..10dccf7 100644
--- a/remoting/remoting.gyp
+++ b/remoting/remoting.gyp
@@ -74,7 +74,6 @@
         'chromoting_client',
         'chromoting_jingle_glue',
         '../third_party/ppapi/ppapi.gyp:ppapi_cpp_objects',
-        '../third_party/zlib/zlib.gyp:zlib',
       ],
       'sources': [
         'client/plugin/chromoting_plugin.cc',
-- 
cgit v1.1