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 #ifndef REMOTING_PROTOCOL_PROTOBUF_VIDEO_READER_H_ | 5 #ifndef REMOTING_PROTOCOL_PROTOBUF_VIDEO_READER_H_ |
6 #define REMOTING_PROTOCOL_PROTOBUF_VIDEO_READER_H_ | 6 #define REMOTING_PROTOCOL_PROTOBUF_VIDEO_READER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "remoting/proto/video.pb.h" | 9 #include "remoting/proto/video.pb.h" |
10 #include "remoting/protocol/message_reader.h" | 10 #include "remoting/protocol/message_reader.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 class ProtobufVideoReader : public VideoReader { | 22 class ProtobufVideoReader : public VideoReader { |
23 public: | 23 public: |
24 ProtobufVideoReader(VideoPacketFormat::Encoding encoding); | 24 ProtobufVideoReader(VideoPacketFormat::Encoding encoding); |
25 virtual ~ProtobufVideoReader(); | 25 virtual ~ProtobufVideoReader(); |
26 | 26 |
27 // VideoReader interface. | 27 // VideoReader interface. |
28 virtual void Init(protocol::Session* session, | 28 virtual void Init(protocol::Session* session, |
29 VideoStub* video_stub, | 29 VideoStub* video_stub, |
30 const InitializedCallback& callback) OVERRIDE; | 30 const InitializedCallback& callback) OVERRIDE; |
| 31 virtual bool is_connected() OVERRIDE; |
31 | 32 |
32 private: | 33 private: |
33 void OnChannelReady(net::StreamSocket* socket); | 34 void OnChannelReady(net::StreamSocket* socket); |
34 void OnNewData(VideoPacket* packet, const base::Closure& done_task); | 35 void OnNewData(VideoPacket* packet, const base::Closure& done_task); |
35 | 36 |
36 Session* session_; | 37 Session* session_; |
37 | 38 |
38 InitializedCallback initialized_callback_; | 39 InitializedCallback initialized_callback_; |
39 | 40 |
40 VideoPacketFormat::Encoding encoding_; | 41 VideoPacketFormat::Encoding encoding_; |
41 | 42 |
42 // TODO(sergeyu): Remove |channel_| and let |reader_| own it. | 43 // TODO(sergeyu): Remove |channel_| and let |reader_| own it. |
43 scoped_ptr<net::StreamSocket> channel_; | 44 scoped_ptr<net::StreamSocket> channel_; |
44 | 45 |
45 ProtobufMessageReader<VideoPacket> reader_; | 46 ProtobufMessageReader<VideoPacket> reader_; |
46 | 47 |
47 // The stub that processes all received packets. | 48 // The stub that processes all received packets. |
48 VideoStub* video_stub_; | 49 VideoStub* video_stub_; |
49 | 50 |
50 DISALLOW_COPY_AND_ASSIGN(ProtobufVideoReader); | 51 DISALLOW_COPY_AND_ASSIGN(ProtobufVideoReader); |
51 }; | 52 }; |
52 | 53 |
53 } // namespace protocol | 54 } // namespace protocol |
54 } // namespace remoting | 55 } // namespace remoting |
55 | 56 |
56 #endif // REMOTING_PROTOCOL_PROTOBUF_VIDEO_READER_H_ | 57 #endif // REMOTING_PROTOCOL_PROTOBUF_VIDEO_READER_H_ |
OLD | NEW |