Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: remoting/base/compressor_verbatim.cc

Issue 9331003: Improving the decoder pipeline. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Integer ScaleRect Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/base/codec_test.cc ('k') | remoting/base/decoder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/logging.h" 5 #include "base/logging.h"
6 #include "remoting/base/compressor_verbatim.h" 6 #include "remoting/base/compressor_verbatim.h"
7 7
8 namespace remoting { 8 namespace remoting {
9 9
10 CompressorVerbatim::CompressorVerbatim() { 10 CompressorVerbatim::CompressorVerbatim() {
11 } 11 }
12 12
13 CompressorVerbatim::~CompressorVerbatim() { 13 CompressorVerbatim::~CompressorVerbatim() {
14 } 14 }
15 15
16 void CompressorVerbatim::Reset() { 16 void CompressorVerbatim::Reset() {
17 } 17 }
18 18
19 bool CompressorVerbatim::Process(const uint8* input_data, int input_size, 19 bool CompressorVerbatim::Process(const uint8* input_data, int input_size,
20 uint8* output_data, int output_size, 20 uint8* output_data, int output_size,
21 CompressorFlush flush, int* consumed, 21 CompressorFlush flush, int* consumed,
22 int* written) { 22 int* written) {
23 DCHECK_GT(output_size, 0); 23 DCHECK_GT(output_size, 0);
24 int bytes_to_copy = std::min(input_size, output_size); 24 int bytes_to_copy = std::min(input_size, output_size);
25 memcpy(output_data, input_data, bytes_to_copy); 25 memcpy(output_data, input_data, bytes_to_copy);
26 26
27 // Since we're just a memcpy, consumed and written are the same. 27 // Since we're just a memcpy, consumed and written are the same.
28 *consumed = *written = bytes_to_copy; 28 *consumed = *written = bytes_to_copy;
29 return true; 29 return (flush != CompressorFinish) || (output_size < bytes_to_copy);
30 } 30 }
31 31
32 } // namespace remoting 32 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/base/codec_test.cc ('k') | remoting/base/decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698