| OLD | NEW |
| 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/rtp_video_writer.h" | 5 #include "remoting/protocol/rtp_video_writer.h" |
| 6 | 6 |
| 7 #include "net/base/io_buffer.h" |
| 8 #include "remoting/base/compound_buffer.h" |
| 7 #include "remoting/proto/video.pb.h" | 9 #include "remoting/proto/video.pb.h" |
| 10 #include "remoting/protocol/rtp_writer.h" |
| 8 #include "remoting/protocol/session.h" | 11 #include "remoting/protocol/session.h" |
| 9 #include "remoting/protocol/rtp_writer.h" | |
| 10 | 12 |
| 11 namespace remoting { | 13 namespace remoting { |
| 12 namespace protocol { | 14 namespace protocol { |
| 13 | 15 |
| 14 RtpVideoWriter::RtpVideoWriter() { } | 16 RtpVideoWriter::RtpVideoWriter() { } |
| 15 | 17 |
| 16 RtpVideoWriter::~RtpVideoWriter() { } | 18 RtpVideoWriter::~RtpVideoWriter() { } |
| 17 | 19 |
| 18 void RtpVideoWriter::Init(protocol::Session* session) { | 20 void RtpVideoWriter::Init(protocol::Session* session) { |
| 19 rtp_writer_.Init(session->video_rtp_channel(), session->video_rtcp_channel()); | 21 rtp_writer_.Init(session->video_rtp_channel(), session->video_rtcp_channel()); |
| 20 } | 22 } |
| 21 | 23 |
| 22 void RtpVideoWriter::SendPacket(const VideoPacket& packet) { | 24 void RtpVideoWriter::SendPacket(const VideoPacket& packet) { |
| 23 rtp_writer_.SendPacket(packet.data().data(), packet.data().size(), | 25 CompoundBuffer payload; |
| 24 packet.timestamp()); | 26 payload.AppendCopyOf(packet.data().data(), packet.data().size()); |
| 27 |
| 28 rtp_writer_.SendPacket(payload, packet.timestamp()); |
| 25 } | 29 } |
| 26 | 30 |
| 27 int RtpVideoWriter::GetPendingPackets() { | 31 int RtpVideoWriter::GetPendingPackets() { |
| 28 return rtp_writer_.GetPendingPackets(); | 32 return rtp_writer_.GetPendingPackets(); |
| 29 } | 33 } |
| 30 | 34 |
| 31 | 35 |
| 32 void RtpVideoWriter::Close() { | 36 void RtpVideoWriter::Close() { |
| 33 rtp_writer_.Close(); | 37 rtp_writer_.Close(); |
| 34 } | 38 } |
| 35 | 39 |
| 36 } // namespace protocol | 40 } // namespace protocol |
| 37 } // namespace remoting | 41 } // namespace remoting |
| OLD | NEW |