| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/task.h" | 8 #include "base/task.h" |
| 9 #include "net/base/io_buffer.h" | 9 #include "net/base/io_buffer.h" |
| 10 #include "remoting/base/compound_buffer.h" | 10 #include "remoting/base/compound_buffer.h" |
| 11 #include "remoting/base/constants.h" | 11 #include "remoting/base/constants.h" |
| 12 #include "remoting/proto/video.pb.h" | 12 #include "remoting/proto/video.pb.h" |
| 13 #include "remoting/protocol/rtp_writer.h" | 13 #include "remoting/protocol/rtp_writer.h" |
| 14 #include "remoting/protocol/session.h" | 14 #include "remoting/protocol/session.h" |
| 15 | 15 |
| 16 namespace remoting { | 16 namespace remoting { |
| 17 namespace protocol { | 17 namespace protocol { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 const int kMtu = 1200; | 20 const int kMtu = 1200; |
| 21 } // namespace | 21 } // namespace |
| 22 | 22 |
| 23 RtpVideoWriter::RtpVideoWriter() | 23 RtpVideoWriter::RtpVideoWriter(base::MessageLoopProxy* message_loop) |
| 24 : initialized_(false) { | 24 : initialized_(false), |
| 25 rtp_writer_(message_loop) { |
| 25 } | 26 } |
| 26 | 27 |
| 27 RtpVideoWriter::~RtpVideoWriter() { | 28 RtpVideoWriter::~RtpVideoWriter() { |
| 28 Close(); | 29 Close(); |
| 29 } | 30 } |
| 30 | 31 |
| 31 void RtpVideoWriter::Init(protocol::Session* session, | 32 void RtpVideoWriter::Init(protocol::Session* session, |
| 32 const InitializedCallback& callback) { | 33 const InitializedCallback& callback) { |
| 33 initialized_callback_ = callback; | 34 initialized_callback_ = callback; |
| 34 session->CreateDatagramChannel( | 35 session->CreateDatagramChannel( |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 done->Run(); | 131 done->Run(); |
| 131 delete done; | 132 delete done; |
| 132 } | 133 } |
| 133 | 134 |
| 134 int RtpVideoWriter::GetPendingPackets() { | 135 int RtpVideoWriter::GetPendingPackets() { |
| 135 return rtp_writer_.GetPendingPackets(); | 136 return rtp_writer_.GetPendingPackets(); |
| 136 } | 137 } |
| 137 | 138 |
| 138 } // namespace protocol | 139 } // namespace protocol |
| 139 } // namespace remoting | 140 } // namespace remoting |
| OLD | NEW |