Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef REMOTING_CLIENT_VIDEO_RENDERER_H_ | 5 #ifndef REMOTING_CLIENT_VIDEO_RENDERER_H_ |
| 6 #define REMOTING_CLIENT_VIDEO_RENDERER_H_ | 6 #define REMOTING_CLIENT_VIDEO_RENDERER_H_ |
| 7 | 7 |
| 8 namespace remoting { | 8 namespace remoting { |
| 9 class ClientContext; | |
| 10 | |
| 9 namespace protocol { | 11 namespace protocol { |
| 10 | |
| 11 class FrameConsumer; | 12 class FrameConsumer; |
| 13 class PerformanceTracker; | |
| 12 class SessionConfig; | 14 class SessionConfig; |
| 13 class VideoStub; | 15 class VideoStub; |
| 14 | 16 |
| 15 // VideoRenderer is responsible for decoding and displaying incoming video | 17 // VideoRenderer is responsible for decoding and displaying incoming video |
| 16 // stream. This interface is used by ConnectionToHost implementations to | 18 // stream. This interface is used by ConnectionToHost implementations to |
| 17 // render received video frames. ConnectionToHost may feed encoded frames to the | 19 // render received video frames. ConnectionToHost may feed encoded frames to the |
| 18 // VideoStub or decode them and pass decoded frames to the FrameConsumer. | 20 // VideoStub or decode them and pass decoded frames to the FrameConsumer. |
| 19 // | 21 // |
| 20 // TODO(sergeyu): Reconsider this design. | 22 // TODO(sergeyu): Reconsider this design. |
| 21 class VideoRenderer { | 23 class VideoRenderer { |
| 22 public: | 24 public: |
| 23 virtual ~VideoRenderer() {} | 25 virtual ~VideoRenderer() {} |
| 24 | 26 |
| 27 // Initializes the video renderer. This allows the renderer to be initialized | |
| 28 // after it is constructed. It is up to the implementation and caller to | |
| 29 // either use this function or have their own initialization approach. | |
| 30 // |perf_tracker| must outlive the renderer. | |
| 31 virtual void Initialize(const ClientContext& client_context, | |
|
Sergey Ulanov
2016/06/28 17:59:50
Return bool here as Initialization may fail (for t
Yuwei
2016/06/28 18:46:06
Done.
| |
| 32 protocol::PerformanceTracker* perf_tracker) {} | |
|
Sergey Ulanov
2016/06/28 17:59:50
Please make this pure virtual. Default stub implem
Yuwei
2016/06/28 18:46:06
Done.
| |
| 33 | |
| 25 // Configures the renderer with the supplied |config|. This must be called | 34 // Configures the renderer with the supplied |config|. This must be called |
| 26 // exactly once before video data is supplied to the renderer. | 35 // exactly once before video data is supplied to the renderer. |
| 27 virtual void OnSessionConfig(const SessionConfig& config) = 0; | 36 virtual void OnSessionConfig(const SessionConfig& config) = 0; |
| 28 | 37 |
| 29 // Returns the VideoStub interface of this renderer. | 38 // Returns the VideoStub interface of this renderer. |
| 30 virtual VideoStub* GetVideoStub() = 0; | 39 virtual VideoStub* GetVideoStub() = 0; |
| 31 | 40 |
| 32 // Returns the FrameConsumer interface for this renderer. | 41 // Returns the FrameConsumer interface for this renderer. |
| 33 virtual FrameConsumer* GetFrameConsumer() = 0; | 42 virtual FrameConsumer* GetFrameConsumer() = 0; |
| 34 }; | 43 }; |
| 35 | 44 |
| 36 } // namespace protocol | 45 } // namespace protocol |
| 37 } // namespace remoting | 46 } // namespace remoting |
| 38 | 47 |
| 39 #endif // REMOTING_CLIENT_VIDEO_RENDERER_H_ | 48 #endif // REMOTING_CLIENT_VIDEO_RENDERER_H_ |
| OLD | NEW |