blob: f7773632251d2646225ea08c390f7c2481ee94a0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
// 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/session.h"
namespace remoting {
namespace protocol {
ProtobufVideoReader::ProtobufVideoReader() { }
ProtobufVideoReader::~ProtobufVideoReader() { }
void ProtobufVideoReader::Init(protocol::Session* session,
VideoStub* video_stub) {
reader_.Init<VideoPacket>(session->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 protocol
} // namespace remoting
|