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

Side by Side Diff: remoting/client/rectangle_update_decoder.cc

Issue 7796026: Pass SessionConfig by reference instead of pointer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 3 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/client/rectangle_update_decoder.h ('k') | remoting/host/chromoting_host.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "remoting/client/rectangle_update_decoder.h" 5 #include "remoting/client/rectangle_update_decoder.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "remoting/base/decoder.h" 9 #include "remoting/base/decoder.h"
10 #include "remoting/base/decoder_row_based.h" 10 #include "remoting/base/decoder_row_based.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 FrameConsumer* consumer) 45 FrameConsumer* consumer)
46 : message_loop_(message_loop), 46 : message_loop_(message_loop),
47 consumer_(consumer), 47 consumer_(consumer),
48 frame_is_new_(false), 48 frame_is_new_(false),
49 frame_is_consuming_(false) { 49 frame_is_consuming_(false) {
50 } 50 }
51 51
52 RectangleUpdateDecoder::~RectangleUpdateDecoder() { 52 RectangleUpdateDecoder::~RectangleUpdateDecoder() {
53 } 53 }
54 54
55 void RectangleUpdateDecoder::Initialize(const SessionConfig* config) { 55 void RectangleUpdateDecoder::Initialize(const SessionConfig& config) {
56 initial_screen_size_ = gfx::Size(config->initial_resolution().width, 56 initial_screen_size_ = gfx::Size(config.initial_resolution().width,
57 config->initial_resolution().height); 57 config.initial_resolution().height);
58 58
59 // Initialize decoder based on the selected codec. 59 // Initialize decoder based on the selected codec.
60 ChannelConfig::Codec codec = config->video_config().codec; 60 ChannelConfig::Codec codec = config.video_config().codec;
61 if (codec == ChannelConfig::CODEC_VERBATIM) { 61 if (codec == ChannelConfig::CODEC_VERBATIM) {
62 TraceContext::tracer()->PrintString("Creating Verbatim decoder."); 62 TraceContext::tracer()->PrintString("Creating Verbatim decoder.");
63 decoder_.reset(DecoderRowBased::CreateVerbatimDecoder()); 63 decoder_.reset(DecoderRowBased::CreateVerbatimDecoder());
64 } else if (codec == ChannelConfig::CODEC_ZIP) { 64 } else if (codec == ChannelConfig::CODEC_ZIP) {
65 TraceContext::tracer()->PrintString("Creating Zlib decoder"); 65 TraceContext::tracer()->PrintString("Creating Zlib decoder");
66 decoder_.reset(DecoderRowBased::CreateZlibDecoder()); 66 decoder_.reset(DecoderRowBased::CreateZlibDecoder());
67 } else if (codec == ChannelConfig::CODEC_VP8) { 67 } else if (codec == ChannelConfig::CODEC_VP8) {
68 TraceContext::tracer()->PrintString("Creating VP8 decoder"); 68 TraceContext::tracer()->PrintString("Creating VP8 decoder");
69 decoder_.reset(new DecoderVp8()); 69 decoder_.reset(new DecoderVp8());
70 } else { 70 } else {
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 FROM_HERE, 288 FROM_HERE,
289 NewTracedMethod(this, &RectangleUpdateDecoder::OnFrameConsumed)); 289 NewTracedMethod(this, &RectangleUpdateDecoder::OnFrameConsumed));
290 return; 290 return;
291 } 291 }
292 292
293 frame_is_consuming_ = false; 293 frame_is_consuming_ = false;
294 DoRefresh(); 294 DoRefresh();
295 } 295 }
296 296
297 } // namespace remoting 297 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/rectangle_update_decoder.h ('k') | remoting/host/chromoting_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698