1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef REMOTING_PROTOCOL_PROTOBUF_VIDEO_READER_H_
6 #define REMOTING_PROTOCOL_PROTOBUF_VIDEO_READER_H_
8 #include "base/compiler_specific.h"
9 #include "remoting/proto/video.pb.h"
10 #include "remoting/protocol/message_reader.h"
11 #include "remoting/protocol/video_reader.h"
23 class ProtobufVideoReader
: public VideoReader
{
25 ProtobufVideoReader(VideoPacketFormat::Encoding encoding
);
26 virtual ~ProtobufVideoReader();
28 // VideoReader interface.
29 virtual void Init(protocol::Session
* session
,
30 VideoStub
* video_stub
,
31 const InitializedCallback
& callback
) OVERRIDE
;
32 virtual bool is_connected() OVERRIDE
;
35 void OnChannelReady(scoped_ptr
<net::StreamSocket
> socket
);
36 void OnNewData(scoped_ptr
<VideoPacket
> packet
,
37 const base::Closure
& done_task
);
39 InitializedCallback initialized_callback_
;
41 VideoPacketFormat::Encoding encoding_
;
43 ChannelFactory
* channel_factory_
;
44 scoped_ptr
<net::StreamSocket
> channel_
;
46 ProtobufMessageReader
<VideoPacket
> reader_
;
48 // The stub that processes all received packets.
49 VideoStub
* video_stub_
;
51 DISALLOW_COPY_AND_ASSIGN(ProtobufVideoReader
);
54 } // namespace protocol
55 } // namespace remoting
57 #endif // REMOTING_PROTOCOL_PROTOBUF_VIDEO_READER_H_