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 // VideoWriter is a generic interface used by ConnectionToClient to
6 // write into the video stream. ProtobufVideoWriter implements this
7 // interface for protobuf video streams.
9 #ifndef REMOTING_PROTOCOL_VIDEO_WRITER_H_
10 #define REMOTING_PROTOCOL_VIDEO_WRITER_H_
12 #include "base/basictypes.h"
13 #include "base/callback.h"
14 #include "remoting/protocol/video_stub.h"
22 class VideoWriter
: public VideoStub
{
24 virtual ~VideoWriter();
26 // The callback is called when initialization is finished. The
27 // parameter is set to true on success.
28 typedef base::Callback
<void(bool)> InitializedCallback
;
30 static scoped_ptr
<VideoWriter
> Create(const SessionConfig
& config
);
32 // Initializes the writer.
33 virtual void Init(Session
* session
, const InitializedCallback
& callback
) = 0;
35 // Stops writing. Must be called on the network thread before this
36 // object is destroyed.
37 virtual void Close() = 0;
39 // Returns true if the channel is connected.
40 virtual bool is_connected() = 0;
46 DISALLOW_COPY_AND_ASSIGN(VideoWriter
);
49 } // namespace protocol
50 } // namespace remoting
52 #endif // REMOTING_PROTOCOL_VIDEO_WRITER_H_