OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/protobuf_video_writer.h" | 5 #include "remoting/protocol/protobuf_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/socket/stream_socket.h" | 9 #include "net/socket/stream_socket.h" |
10 #include "remoting/base/constants.h" | 10 #include "remoting/base/constants.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 void ProtobufVideoWriter::Close() { | 51 void ProtobufVideoWriter::Close() { |
52 buffered_writer_->Close(); | 52 buffered_writer_->Close(); |
53 channel_.reset(); | 53 channel_.reset(); |
54 if (session_) { | 54 if (session_) { |
55 session_->CancelChannelCreation(kVideoChannelName); | 55 session_->CancelChannelCreation(kVideoChannelName); |
56 session_ = NULL; | 56 session_ = NULL; |
57 } | 57 } |
58 } | 58 } |
59 | 59 |
| 60 bool ProtobufVideoWriter::is_connected() { |
| 61 return channel_.get() != NULL; |
| 62 } |
| 63 |
60 void ProtobufVideoWriter::ProcessVideoPacket(const VideoPacket* packet, | 64 void ProtobufVideoWriter::ProcessVideoPacket(const VideoPacket* packet, |
61 const base::Closure& done) { | 65 const base::Closure& done) { |
62 buffered_writer_->Write(SerializeAndFrameMessage(*packet), done); | 66 buffered_writer_->Write(SerializeAndFrameMessage(*packet), done); |
63 } | 67 } |
64 | 68 |
65 int ProtobufVideoWriter::GetPendingPackets() { | 69 int ProtobufVideoWriter::GetPendingPackets() { |
66 return buffered_writer_->GetBufferChunks(); | 70 return buffered_writer_->GetBufferChunks(); |
67 } | 71 } |
68 | 72 |
69 } // namespace protocol | 73 } // namespace protocol |
70 } // namespace remoting | 74 } // namespace remoting |
OLD | NEW |