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

Side by Side Diff: remoting/protocol/video_reader.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/protocol/video_reader.h ('k') | remoting/protocol/video_writer.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 "remoting/protocol/video_reader.h" 5 #include "remoting/protocol/video_reader.h"
6 6
7 #include "remoting/protocol/session_config.h" 7 #include "remoting/protocol/session_config.h"
8 #include "remoting/protocol/protobuf_video_reader.h" 8 #include "remoting/protocol/protobuf_video_reader.h"
9 #include "remoting/protocol/rtp_video_reader.h" 9 #include "remoting/protocol/rtp_video_reader.h"
10 10
11 namespace remoting { 11 namespace remoting {
12 namespace protocol { 12 namespace protocol {
13 13
14 VideoReader::~VideoReader() { } 14 VideoReader::~VideoReader() { }
15 15
16 // static 16 // static
17 VideoReader* VideoReader::Create(base::MessageLoopProxy* message_loop, 17 VideoReader* VideoReader::Create(base::MessageLoopProxy* message_loop,
18 const SessionConfig* config) { 18 const SessionConfig& config) {
19 const ChannelConfig& video_config = config->video_config(); 19 const ChannelConfig& video_config = config.video_config();
20 if (video_config.transport == ChannelConfig::TRANSPORT_SRTP) { 20 if (video_config.transport == ChannelConfig::TRANSPORT_SRTP) {
21 return new RtpVideoReader(message_loop); 21 return new RtpVideoReader(message_loop);
22 } else if (video_config.transport == ChannelConfig::TRANSPORT_STREAM) { 22 } else if (video_config.transport == ChannelConfig::TRANSPORT_STREAM) {
23 if (video_config.codec == ChannelConfig::CODEC_VP8) { 23 if (video_config.codec == ChannelConfig::CODEC_VP8) {
24 return new ProtobufVideoReader(VideoPacketFormat::ENCODING_VP8); 24 return new ProtobufVideoReader(VideoPacketFormat::ENCODING_VP8);
25 } else if (video_config.codec == ChannelConfig::CODEC_ZIP) { 25 } else if (video_config.codec == ChannelConfig::CODEC_ZIP) {
26 return new ProtobufVideoReader(VideoPacketFormat::ENCODING_ZLIB); 26 return new ProtobufVideoReader(VideoPacketFormat::ENCODING_ZLIB);
27 } else if (video_config.codec == ChannelConfig::CODEC_VERBATIM) { 27 } else if (video_config.codec == ChannelConfig::CODEC_VERBATIM) {
28 return new ProtobufVideoReader(VideoPacketFormat::ENCODING_VERBATIM); 28 return new ProtobufVideoReader(VideoPacketFormat::ENCODING_VERBATIM);
29 } 29 }
30 } 30 }
31 NOTREACHED(); 31 NOTREACHED();
32 return NULL; 32 return NULL;
33 } 33 }
34 34
35 } // namespace protocol 35 } // namespace protocol
36 } // namespace remoting 36 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/video_reader.h ('k') | remoting/protocol/video_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698