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 #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 "remoting/proto/video.pb.h" | 8 #include "remoting/proto/video.pb.h" |
9 #include "remoting/protocol/message_reader.h" | 9 #include "remoting/protocol/message_reader.h" |
10 #include "remoting/protocol/video_reader.h" | 10 #include "remoting/protocol/video_reader.h" |
11 | 11 |
12 namespace remoting { | 12 namespace remoting { |
13 namespace protocol { | 13 namespace protocol { |
14 | 14 |
15 class Session; | 15 class Session; |
16 | 16 |
17 class ProtobufVideoReader : public VideoReader { | 17 class ProtobufVideoReader : public VideoReader { |
18 public: | 18 public: |
19 ProtobufVideoReader(VideoPacketFormat::Encoding encoding); | 19 ProtobufVideoReader(VideoPacketFormat::Encoding encoding); |
20 virtual ~ProtobufVideoReader(); | 20 virtual ~ProtobufVideoReader(); |
21 | 21 |
22 // VideoReader interface. | 22 // VideoReader interface. |
23 virtual void Init(protocol::Session* session, VideoStub* video_stub); | 23 virtual void Init(protocol::Session* session, VideoStub* video_stub); |
24 virtual void Close(); | |
25 | 24 |
26 private: | 25 private: |
27 void OnNewData(VideoPacket* packet); | 26 void OnNewData(VideoPacket* packet); |
28 | 27 |
29 VideoPacketFormat::Encoding encoding_; | 28 VideoPacketFormat::Encoding encoding_; |
30 | 29 |
31 MessageReader reader_; | 30 ProtobufMessageReader<VideoPacket> reader_; |
32 | 31 |
33 // The stub that processes all received packets. | 32 // The stub that processes all received packets. |
34 VideoStub* video_stub_; | 33 VideoStub* video_stub_; |
35 | 34 |
36 DISALLOW_COPY_AND_ASSIGN(ProtobufVideoReader); | 35 DISALLOW_COPY_AND_ASSIGN(ProtobufVideoReader); |
37 }; | 36 }; |
38 | 37 |
39 } // namespace protocol | 38 } // namespace protocol |
40 } // namespace remoting | 39 } // namespace remoting |
41 | 40 |
42 #endif // REMOTING_PROTOCOL_PROTOBUF_VIDEO_READER_H_ | 41 #endif // REMOTING_PROTOCOL_PROTOBUF_VIDEO_READER_H_ |
OLD | NEW |