Revert 187554 "Implement IPC::ChannelFactory, a class that accep..."
[chromium-blink-merge.git] / remoting / protocol / video_reader.cc
blobadf7189d97ba428c5e2986afab86a12e66fb3f81
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "remoting/protocol/video_reader.h"
7 #include "remoting/protocol/session_config.h"
8 #include "remoting/protocol/protobuf_video_reader.h"
10 namespace remoting {
11 namespace protocol {
13 VideoReader::~VideoReader() { }
15 // static
16 scoped_ptr<VideoReader> VideoReader::Create(const SessionConfig& config) {
17 const ChannelConfig& video_config = config.video_config();
18 if (video_config.transport == ChannelConfig::TRANSPORT_STREAM) {
19 if (video_config.codec == ChannelConfig::CODEC_VP8) {
20 return scoped_ptr<VideoReader>(
21 new ProtobufVideoReader(VideoPacketFormat::ENCODING_VP8));
22 } else if (video_config.codec == ChannelConfig::CODEC_ZIP) {
23 return scoped_ptr<VideoReader>(
24 new ProtobufVideoReader(VideoPacketFormat::ENCODING_ZLIB));
25 } else if (video_config.codec == ChannelConfig::CODEC_VERBATIM) {
26 return scoped_ptr<VideoReader>(
27 new ProtobufVideoReader(VideoPacketFormat::ENCODING_VERBATIM));
30 NOTREACHED();
31 return scoped_ptr<VideoReader>(NULL);
34 } // namespace protocol
35 } // namespace remoting