OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "remoting/protocol/protobuf_video_reader.h" |
| 6 |
| 7 #include "base/task.h" |
| 8 #include "remoting/protocol/chromotocol_connection.h" |
| 9 |
| 10 namespace remoting { |
| 11 |
| 12 ProtobufVideoReader::ProtobufVideoReader() { } |
| 13 ProtobufVideoReader::~ProtobufVideoReader() { } |
| 14 |
| 15 void ProtobufVideoReader::Init(ChromotocolConnection* connection, |
| 16 VideoStub* video_stub) { |
| 17 reader_.Init<VideoPacket>(connection->video_channel(), |
| 18 NewCallback(this, &ProtobufVideoReader::OnNewData)); |
| 19 video_stub_ = video_stub; |
| 20 } |
| 21 |
| 22 void ProtobufVideoReader::Close() { |
| 23 reader_.Close(); |
| 24 } |
| 25 |
| 26 void ProtobufVideoReader::OnNewData(VideoPacket* packet) { |
| 27 video_stub_->ProcessVideoPacket(packet, new DeleteTask<VideoPacket>(packet)); |
| 28 } |
| 29 |
| 30 } // namespace remoting |
OLD | NEW |