Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PLUGIN_PEPPER_VIDEO_RENDERER_H_ | 5 #ifndef REMOTING_CLIENT_PLUGIN_PEPPER_VIDEO_RENDERER_H_ |
| 6 #define REMOTING_CLIENT_PLUGIN_PEPPER_VIDEO_RENDERER_H_ | 6 #define REMOTING_CLIENT_PLUGIN_PEPPER_VIDEO_RENDERER_H_ |
| 7 | 7 |
| 8 #include "remoting/client/video_renderer.h" | 8 #include "remoting/client/video_renderer.h" |
| 9 | 9 |
| 10 namespace webrtc { | 10 namespace webrtc { |
| 11 class DesktopSize; | 11 class DesktopSize; |
| 12 class DesktopVector; | 12 class DesktopVector; |
| 13 class DesktopRegion; | 13 class DesktopRegion; |
| 14 } // namespace webrtc | 14 } // namespace webrtc |
| 15 | 15 |
| 16 namespace pp { | |
| 17 class Instance; | |
| 18 class View; | |
| 19 } // namespace pp | |
| 20 | |
| 16 namespace remoting { | 21 namespace remoting { |
| 17 | 22 |
| 18 class ClientContext; | 23 class ClientContext; |
| 19 | 24 |
| 20 // Interface for video renderers that render video in pepper plugin. | 25 // Interface for video renderers that render video in pepper plugin. |
| 21 class PepperVideoRenderer : public VideoRenderer { | 26 class PepperVideoRenderer : public VideoRenderer { |
| 22 public: | 27 public: |
| 23 class EventHandler { | 28 class EventHandler { |
| 24 public: | 29 public: |
| 25 EventHandler() {} | 30 EventHandler() {} |
| 26 virtual ~EventHandler() {} | 31 virtual ~EventHandler() {} |
| 27 | 32 |
| 33 // Called when decoder has failed for any reason. | |
|
Wez
2014/12/24 17:11:14
nit: "Called if video decoding fails, for any reas
Sergey Ulanov
2015/01/06 01:16:31
Done.
| |
| 34 virtual void OnVideoDecoderFailed() = 0; | |
| 35 | |
| 28 // Called when the first frame is received. | 36 // Called when the first frame is received. |
| 29 virtual void OnVideoFirstFrameReceived() = 0; | 37 virtual void OnVideoFirstFrameReceived() = 0; |
| 30 | 38 |
| 31 // Called when stream size changes. | 39 // Called when stream size changes. |
| 32 virtual void OnVideoSize(const webrtc::DesktopSize& size, | 40 virtual void OnVideoSize(const webrtc::DesktopSize& size, |
| 33 const webrtc::DesktopVector& dpi) = 0; | 41 const webrtc::DesktopVector& dpi) = 0; |
| 34 | 42 |
| 35 // Called when desktop shape changes. | 43 // Called when desktop shape changes. |
| 36 virtual void OnVideoShape(const webrtc::DesktopRegion& shape) = 0; | 44 virtual void OnVideoShape(const webrtc::DesktopRegion& shape) = 0; |
| 37 }; | 45 }; |
| 38 | 46 |
| 39 // Initializes the renderer. |instance| and |event_handler| must outlive the | 47 // Initializes the renderer. |instance| and |event_handler| must outlive the |
| 40 // renderer. Returns false if the renderer cannot be initialized. | 48 // renderer. Returns false if the renderer cannot be initialized. |
| 41 virtual bool Initialize(pp::Instance* instance, | 49 virtual bool Initialize(pp::Instance* instance, |
| 42 const ClientContext& context, | 50 const ClientContext& context, |
| 43 EventHandler* event_handler) = 0; | 51 EventHandler* event_handler) = 0; |
| 44 | 52 |
| 45 // Must be called whenever the plugin view changes. | 53 // Must be called whenever the plugin view changes. |
| 46 virtual void OnViewChanged(const pp::View& view) = 0; | 54 virtual void OnViewChanged(const pp::View& view) = 0; |
| 47 }; | 55 }; |
| 48 | 56 |
| 49 } // namespace remoting | 57 } // namespace remoting |
| 50 | 58 |
| 51 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_VIDEO_RENDERER_H_ | 59 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_VIDEO_RENDERER_H_ |
| OLD | NEW |