blob: 9bbd88b189410d0367f643be2926f2eaefd0b3c0 (
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
33
34
35
36
37
38
|
// 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_writer.h"
#include "remoting/protocol/rtp_writer.h"
#include "remoting/protocol/session.h"
#include "remoting/protocol/util.h"
namespace remoting {
namespace protocol {
ProtobufVideoWriter::ProtobufVideoWriter() { }
ProtobufVideoWriter::~ProtobufVideoWriter() { }
void ProtobufVideoWriter::Init(protocol::Session* session) {
buffered_writer_ = new BufferedSocketWriter();
// TODO(sergeyu): Provide WriteFailedCallback for the buffered writer.
buffered_writer_->Init(session->video_channel(), NULL);
}
void ProtobufVideoWriter::SendPacket(const VideoPacket& packet) {
buffered_writer_->Write(SerializeAndFrameMessage(packet));
}
int ProtobufVideoWriter::GetPendingPackets() {
return buffered_writer_->GetBufferChunks();
}
void ProtobufVideoWriter::Close() {
buffered_writer_->Close();
}
} // namespace protocol
} // namespace remoting
|