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_WRITER_H_
6 #define REMOTING_PROTOCOL_PROTOBUF_VIDEO_WRITER_H_
10 #include "base/compiler_specific.h"
11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "remoting/protocol/buffered_socket_writer.h"
14 #include "remoting/protocol/video_writer.h"
26 class ProtobufVideoWriter
: public VideoWriter
{
28 ProtobufVideoWriter();
29 virtual ~ProtobufVideoWriter();
31 // VideoWriter interface.
32 virtual void Init(protocol::Session
* session
,
33 const InitializedCallback
& callback
) OVERRIDE
;
34 virtual void Close() OVERRIDE
;
35 virtual bool is_connected() OVERRIDE
;
37 // VideoStub interface.
38 virtual void ProcessVideoPacket(scoped_ptr
<VideoPacket
> packet
,
39 const base::Closure
& done
) OVERRIDE
;
42 void OnChannelReady(scoped_ptr
<net::StreamSocket
> socket
);
44 InitializedCallback initialized_callback_
;
46 ChannelFactory
* channel_factory_
;
47 scoped_ptr
<net::StreamSocket
> channel_
;
49 BufferedSocketWriter buffered_writer_
;
51 DISALLOW_COPY_AND_ASSIGN(ProtobufVideoWriter
);
54 } // namespace protocol
55 } // namespace remoting
57 #endif // REMOTING_PROTOCOL_PROTOBUF_VIDEO_WRITER_H_