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

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

Issue 4476003: Add VideoPacket struct for video packets. Refactor Decode interface to use it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged Created 10 years, 1 month 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/protobuf_video_reader.h ('k') | remoting/protocol/protobuf_video_writer.cc » ('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/protobuf_video_reader.h" 5 #include "remoting/protocol/protobuf_video_reader.h"
6 6
7 #include "base/task.h" 7 #include "base/task.h"
8 #include "remoting/proto/video.pb.h"
8 #include "remoting/protocol/session.h" 9 #include "remoting/protocol/session.h"
9 10
10 namespace remoting { 11 namespace remoting {
11 namespace protocol { 12 namespace protocol {
12 13
13 ProtobufVideoReader::ProtobufVideoReader() { } 14 ProtobufVideoReader::ProtobufVideoReader(VideoPacketFormat::Encoding encoding)
15 : encoding_(encoding) {
16 }
17
14 ProtobufVideoReader::~ProtobufVideoReader() { } 18 ProtobufVideoReader::~ProtobufVideoReader() { }
15 19
16 void ProtobufVideoReader::Init(protocol::Session* session, 20 void ProtobufVideoReader::Init(protocol::Session* session,
17 VideoStub* video_stub) { 21 VideoStub* video_stub) {
18 reader_.Init<VideoPacket>(session->video_channel(), 22 reader_.Init<VideoPacket>(
19 NewCallback(this, &ProtobufVideoReader::OnNewData)); 23 session->video_channel(),
24 NewCallback(this, &ProtobufVideoReader::OnNewData));
20 video_stub_ = video_stub; 25 video_stub_ = video_stub;
21 } 26 }
22 27
23 void ProtobufVideoReader::Close() { 28 void ProtobufVideoReader::Close() {
24 reader_.Close(); 29 reader_.Close();
25 } 30 }
26 31
27 void ProtobufVideoReader::OnNewData(VideoPacket* packet) { 32 void ProtobufVideoReader::OnNewData(VideoPacket* packet) {
28 video_stub_->ProcessVideoPacket(packet, new DeleteTask<VideoPacket>(packet)); 33 video_stub_->ProcessVideoPacket(packet, new DeleteTask<VideoPacket>(packet));
29 } 34 }
30 35
31 } // namespace protocol 36 } // namespace protocol
32 } // namespace remoting 37 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/protobuf_video_reader.h ('k') | remoting/protocol/protobuf_video_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698