| 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 // VideoReader is a generic interface for a video stream reader. RtpVideoReader | 5 // VideoReader is a generic interface for a video stream reader. RtpVideoReader |
| 6 // and ProtobufVideoReader implement this interface for RTP and protobuf video | 6 // and ProtobufVideoReader implement this interface for RTP and protobuf video |
| 7 // streams. VideoReader is used by ConnectionToHost to read video stream. | 7 // streams. VideoReader is used by ConnectionToHost to read video stream. |
| 8 | 8 |
| 9 #ifndef REMOTING_PROTOCOL_VIDEO_READER_H_ | 9 #ifndef REMOTING_PROTOCOL_VIDEO_READER_H_ |
| 10 #define REMOTING_PROTOCOL_VIDEO_READER_H_ | 10 #define REMOTING_PROTOCOL_VIDEO_READER_H_ |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "remoting/protocol/video_stub.h" | 13 #include "remoting/protocol/video_stub.h" |
| 14 | 14 |
| 15 namespace base { |
| 16 class MessageLoopProxy; |
| 17 } // namespace base |
| 18 |
| 15 namespace remoting { | 19 namespace remoting { |
| 16 | 20 |
| 17 class ChromotocolConnection; | 21 class ChromotocolConnection; |
| 18 | 22 |
| 19 namespace protocol { | 23 namespace protocol { |
| 20 | 24 |
| 21 class Session; | 25 class Session; |
| 22 class SessionConfig; | 26 class SessionConfig; |
| 23 | 27 |
| 24 class VideoReader { | 28 class VideoReader { |
| 25 public: | 29 public: |
| 26 static VideoReader* Create(const SessionConfig* config); | 30 static VideoReader* Create(base::MessageLoopProxy* message_loop, |
| 31 const SessionConfig* config); |
| 27 | 32 |
| 28 // The callback is called when initialization is finished. The | 33 // The callback is called when initialization is finished. The |
| 29 // parameter is set to true on success. | 34 // parameter is set to true on success. |
| 30 typedef base::Callback<void(bool)> InitializedCallback; | 35 typedef base::Callback<void(bool)> InitializedCallback; |
| 31 | 36 |
| 32 virtual ~VideoReader(); | 37 virtual ~VideoReader(); |
| 33 | 38 |
| 34 // Initializies the reader. Doesn't take ownership of either |connection| | 39 // Initializies the reader. Doesn't take ownership of either |connection| |
| 35 // or |video_stub|. | 40 // or |video_stub|. |
| 36 virtual void Init(Session* session, | 41 virtual void Init(Session* session, |
| 37 VideoStub* video_stub, | 42 VideoStub* video_stub, |
| 38 const InitializedCallback& callback) = 0; | 43 const InitializedCallback& callback) = 0; |
| 39 | 44 |
| 40 protected: | 45 protected: |
| 41 VideoReader() { } | 46 VideoReader() { } |
| 42 | 47 |
| 43 private: | 48 private: |
| 44 DISALLOW_COPY_AND_ASSIGN(VideoReader); | 49 DISALLOW_COPY_AND_ASSIGN(VideoReader); |
| 45 }; | 50 }; |
| 46 | 51 |
| 47 } // namespace protocol | 52 } // namespace protocol |
| 48 } // namespace remoting | 53 } // namespace remoting |
| 49 | 54 |
| 50 #endif // REMOTING_PROTOCOL_VIDEO_READER_H_ | 55 #endif // REMOTING_PROTOCOL_VIDEO_READER_H_ |
| OLD | NEW |