| 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 // VideoWriter is a generic interface for a video stream writer. RtpVideoWriter | 5 // VideoWriter is a generic interface for a video stream writer. RtpVideoWriter |
| 6 // and ProtobufVideoWriter implement this interface for RTP and protobuf video | 6 // and ProtobufVideoWriter implement this interface for RTP and protobuf video |
| 7 // streams. VideoWriter is used by ConnectionToClient to write into the video | 7 // streams. VideoWriter is used by ConnectionToClient to write into the video |
| 8 // stream. | 8 // stream. |
| 9 | 9 |
| 10 #ifndef REMOTING_PROTOCOL_VIDEO_WRITER_H_ | 10 #ifndef REMOTING_PROTOCOL_VIDEO_WRITER_H_ |
| 11 #define REMOTING_PROTOCOL_VIDEO_WRITER_H_ | 11 #define REMOTING_PROTOCOL_VIDEO_WRITER_H_ |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "remoting/protocol/video_stub.h" | 14 #include "remoting/protocol/video_stub.h" |
| 15 | 15 |
| 16 namespace remoting { | 16 namespace remoting { |
| 17 namespace protocol { | 17 namespace protocol { |
| 18 | 18 |
| 19 class Session; | 19 class Session; |
| 20 class SessionConfig; | 20 class SessionConfig; |
| 21 | 21 |
| 22 // TODO(sergeyu): VideoWriter should implement VideoStub interface. | |
| 23 class VideoWriter : public VideoStub { | 22 class VideoWriter : public VideoStub { |
| 24 public: | 23 public: |
| 25 virtual ~VideoWriter(); | 24 virtual ~VideoWriter(); |
| 26 | 25 |
| 27 static VideoWriter* Create(const SessionConfig* config); | 26 static VideoWriter* Create(const SessionConfig* config); |
| 28 | 27 |
| 29 // Initializes the writer. | 28 // Initializes the writer. |
| 30 virtual void Init(Session* session) = 0; | 29 virtual void Init(Session* session) = 0; |
| 31 | 30 |
| 31 // Stops writing. Must be called on the network thread before this |
| 32 // object is destroyed. |
| 33 virtual void Close() = 0; |
| 34 |
| 32 protected: | 35 protected: |
| 33 VideoWriter() { } | 36 VideoWriter() { } |
| 34 | 37 |
| 35 private: | 38 private: |
| 36 DISALLOW_COPY_AND_ASSIGN(VideoWriter); | 39 DISALLOW_COPY_AND_ASSIGN(VideoWriter); |
| 37 }; | 40 }; |
| 38 | 41 |
| 39 } // namespace protocol | 42 } // namespace protocol |
| 40 } // namespace remoting | 43 } // namespace remoting |
| 41 | 44 |
| 42 #endif // REMOTING_PROTOCOL_VIDEO_WRITER_H_ | 45 #endif // REMOTING_PROTOCOL_VIDEO_WRITER_H_ |
| OLD | NEW |