| 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 // 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 remoting { | 15 namespace remoting { |
| 16 | 16 |
| 17 class ChromotocolConnection; | 17 class ChromotocolConnection; |
| 18 | 18 |
| 19 namespace protocol { | 19 namespace protocol { |
| 20 | 20 |
| 21 class Session; | 21 class Session; |
| 22 class SessionConfig; | 22 class SessionConfig; |
| 23 | 23 |
| 24 class VideoReader { | 24 class VideoReader { |
| 25 public: | 25 public: |
| 26 static VideoReader* Create(const SessionConfig* config); | 26 static VideoReader* Create(const SessionConfig* config); |
| 27 | 27 |
| 28 // The callback is called when initialization is finished. The |
| 29 // parameter is set to true on success. |
| 30 typedef base::Callback<void(bool)> InitializedCallback; |
| 31 |
| 28 virtual ~VideoReader(); | 32 virtual ~VideoReader(); |
| 29 | 33 |
| 30 // Initializies the reader. Doesn't take ownership of either |connection| | 34 // Initializies the reader. Doesn't take ownership of either |connection| |
| 31 // or |video_stub|. | 35 // or |video_stub|. |
| 32 virtual void Init(Session* session, | 36 virtual void Init(Session* session, |
| 33 VideoStub* video_stub) = 0; | 37 VideoStub* video_stub, |
| 38 const InitializedCallback& callback) = 0; |
| 34 | 39 |
| 35 protected: | 40 protected: |
| 36 VideoReader() { } | 41 VideoReader() { } |
| 37 | 42 |
| 38 private: | 43 private: |
| 39 DISALLOW_COPY_AND_ASSIGN(VideoReader); | 44 DISALLOW_COPY_AND_ASSIGN(VideoReader); |
| 40 }; | 45 }; |
| 41 | 46 |
| 42 } // namespace protocol | 47 } // namespace protocol |
| 43 } // namespace remoting | 48 } // namespace remoting |
| 44 | 49 |
| 45 #endif // REMOTING_PROTOCOL_VIDEO_READER_H_ | 50 #endif // REMOTING_PROTOCOL_VIDEO_READER_H_ |
| OLD | NEW |