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

Side by Side Diff: remoting/protocol/video_reader.cc

Issue 577473002: Simplify VideoReader and VideoWriter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« 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
(Empty)
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.
4
5 #include "remoting/protocol/video_reader.h"
6
7 #include "remoting/protocol/session_config.h"
8 #include "remoting/protocol/protobuf_video_reader.h"
9
10 namespace remoting {
11 namespace protocol {
12
13 VideoReader::~VideoReader() { }
14
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_VP9) {
23 return scoped_ptr<VideoReader>(
24 new ProtobufVideoReader(VideoPacketFormat::ENCODING_VP9));
25 } else if (video_config.codec == ChannelConfig::CODEC_ZIP) {
26 return scoped_ptr<VideoReader>(
27 new ProtobufVideoReader(VideoPacketFormat::ENCODING_ZLIB));
28 } else if (video_config.codec == ChannelConfig::CODEC_VERBATIM) {
29 return scoped_ptr<VideoReader>(
30 new ProtobufVideoReader(VideoPacketFormat::ENCODING_VERBATIM));
31 }
32 }
33 NOTREACHED();
34 return scoped_ptr<VideoReader>();
35 }
36
37 } // namespace protocol
38 } // 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