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

Unified Diff: remoting/protocol/protobuf_video_reader.cc

Issue 4229003: Add VideoReader and VideoWriter interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/protocol/protobuf_video_reader.h ('k') | remoting/protocol/protobuf_video_writer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/protobuf_video_reader.cc
diff --git a/remoting/protocol/protobuf_video_reader.cc b/remoting/protocol/protobuf_video_reader.cc
new file mode 100644
index 0000000000000000000000000000000000000000..70ac3cf713ebf091f0a258bff8fec1f010e6c312
--- /dev/null
+++ b/remoting/protocol/protobuf_video_reader.cc
@@ -0,0 +1,30 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "remoting/protocol/protobuf_video_reader.h"
+
+#include "base/task.h"
+#include "remoting/protocol/chromotocol_connection.h"
+
+namespace remoting {
+
+ProtobufVideoReader::ProtobufVideoReader() { }
+ProtobufVideoReader::~ProtobufVideoReader() { }
+
+void ProtobufVideoReader::Init(ChromotocolConnection* connection,
+ VideoStub* video_stub) {
+ reader_.Init<VideoPacket>(connection->video_channel(),
+ NewCallback(this, &ProtobufVideoReader::OnNewData));
+ video_stub_ = video_stub;
+}
+
+void ProtobufVideoReader::Close() {
+ reader_.Close();
+}
+
+void ProtobufVideoReader::OnNewData(VideoPacket* packet) {
+ video_stub_->ProcessVideoPacket(packet, new DeleteTask<VideoPacket>(packet));
+}
+
+} // namespace remoting
« no previous file with comments | « remoting/protocol/protobuf_video_reader.h ('k') | remoting/protocol/protobuf_video_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698