| 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 // VideoWriter is a generic interface used by ConnectionToClient to | 5 // VideoWriter is a generic interface used by ConnectionToClient to |
| 6 // write into the video stream. ProtobufVideoWriter implements this | 6 // write into the video stream. ProtobufVideoWriter implements this |
| 7 // interface for protobuf video streams. | 7 // interface for protobuf video streams. |
| 8 | 8 |
| 9 #ifndef REMOTING_PROTOCOL_VIDEO_WRITER_H_ | 9 #ifndef REMOTING_PROTOCOL_VIDEO_WRITER_H_ |
| 10 #define REMOTING_PROTOCOL_VIDEO_WRITER_H_ | 10 #define REMOTING_PROTOCOL_VIDEO_WRITER_H_ |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "remoting/protocol/video_stub.h" | 14 #include "remoting/protocol/video_stub.h" |
| 15 | 15 |
| 16 namespace base { | |
| 17 class MessageLoopProxy; | |
| 18 } // namespace base | |
| 19 | |
| 20 namespace remoting { | 16 namespace remoting { |
| 21 namespace protocol { | 17 namespace protocol { |
| 22 | 18 |
| 23 class Session; | 19 class Session; |
| 24 class SessionConfig; | 20 class SessionConfig; |
| 25 | 21 |
| 26 class VideoWriter : public VideoStub { | 22 class VideoWriter : public VideoStub { |
| 27 public: | 23 public: |
| 28 virtual ~VideoWriter(); | 24 virtual ~VideoWriter(); |
| 29 | 25 |
| 30 // The callback is called when initialization is finished. The | 26 // The callback is called when initialization is finished. The |
| 31 // parameter is set to true on success. | 27 // parameter is set to true on success. |
| 32 typedef base::Callback<void(bool)> InitializedCallback; | 28 typedef base::Callback<void(bool)> InitializedCallback; |
| 33 | 29 |
| 34 static VideoWriter* Create(base::MessageLoopProxy* message_loop, | 30 static VideoWriter* Create(const SessionConfig& config); |
| 35 const SessionConfig& config); | |
| 36 | 31 |
| 37 // Initializes the writer. | 32 // Initializes the writer. |
| 38 virtual void Init(Session* session, const InitializedCallback& callback) = 0; | 33 virtual void Init(Session* session, const InitializedCallback& callback) = 0; |
| 39 | 34 |
| 40 // Stops writing. Must be called on the network thread before this | 35 // Stops writing. Must be called on the network thread before this |
| 41 // object is destroyed. | 36 // object is destroyed. |
| 42 virtual void Close() = 0; | 37 virtual void Close() = 0; |
| 43 | 38 |
| 44 // Returns true if the channel is connected. | 39 // Returns true if the channel is connected. |
| 45 virtual bool is_connected() = 0; | 40 virtual bool is_connected() = 0; |
| 46 | 41 |
| 47 protected: | 42 protected: |
| 48 VideoWriter() { } | 43 VideoWriter() { } |
| 49 | 44 |
| 50 private: | 45 private: |
| 51 DISALLOW_COPY_AND_ASSIGN(VideoWriter); | 46 DISALLOW_COPY_AND_ASSIGN(VideoWriter); |
| 52 }; | 47 }; |
| 53 | 48 |
| 54 } // namespace protocol | 49 } // namespace protocol |
| 55 } // namespace remoting | 50 } // namespace remoting |
| 56 | 51 |
| 57 #endif // REMOTING_PROTOCOL_VIDEO_WRITER_H_ | 52 #endif // REMOTING_PROTOCOL_VIDEO_WRITER_H_ |
| OLD | NEW |