| OLD | NEW |
| 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 | 9 |
| 10 namespace remoting { | 10 namespace remoting { |
| 11 namespace protocol { | 11 namespace protocol { |
| 12 | 12 |
| 13 VideoReader::~VideoReader() { } | 13 VideoReader::~VideoReader() { } |
| 14 | 14 |
| 15 // static | 15 // static |
| 16 VideoReader* VideoReader::Create(base::MessageLoopProxy* message_loop, | 16 VideoReader* VideoReader::Create(const SessionConfig& config) { |
| 17 const SessionConfig& config) { | |
| 18 const ChannelConfig& video_config = config.video_config(); | 17 const ChannelConfig& video_config = config.video_config(); |
| 19 if (video_config.transport == ChannelConfig::TRANSPORT_STREAM) { | 18 if (video_config.transport == ChannelConfig::TRANSPORT_STREAM) { |
| 20 if (video_config.codec == ChannelConfig::CODEC_VP8) { | 19 if (video_config.codec == ChannelConfig::CODEC_VP8) { |
| 21 return new ProtobufVideoReader(VideoPacketFormat::ENCODING_VP8); | 20 return new ProtobufVideoReader(VideoPacketFormat::ENCODING_VP8); |
| 22 } else if (video_config.codec == ChannelConfig::CODEC_ZIP) { | 21 } else if (video_config.codec == ChannelConfig::CODEC_ZIP) { |
| 23 return new ProtobufVideoReader(VideoPacketFormat::ENCODING_ZLIB); | 22 return new ProtobufVideoReader(VideoPacketFormat::ENCODING_ZLIB); |
| 24 } else if (video_config.codec == ChannelConfig::CODEC_VERBATIM) { | 23 } else if (video_config.codec == ChannelConfig::CODEC_VERBATIM) { |
| 25 return new ProtobufVideoReader(VideoPacketFormat::ENCODING_VERBATIM); | 24 return new ProtobufVideoReader(VideoPacketFormat::ENCODING_VERBATIM); |
| 26 } | 25 } |
| 27 } | 26 } |
| 28 NOTREACHED(); | 27 NOTREACHED(); |
| 29 return NULL; | 28 return NULL; |
| 30 } | 29 } |
| 31 | 30 |
| 32 } // namespace protocol | 31 } // namespace protocol |
| 33 } // namespace remoting | 32 } // namespace remoting |
| OLD | NEW |