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
3 // found in the LICENSE file.
5 #ifndef REMOTING_CLIENT_PLUGIN_PEPPER_VIDEO_RENDERER_H_
6 #define REMOTING_CLIENT_PLUGIN_PEPPER_VIDEO_RENDERER_H_
8 #include "remoting/client/video_renderer.h"
25 // Interface for video renderers that render video in pepper plugin.
26 class PepperVideoRenderer
: public VideoRenderer
{
31 virtual ~EventHandler() {}
33 // Called if video decoding fails, for any reason.
34 virtual void OnVideoDecodeError() = 0;
36 // Called when the first frame is received.
37 virtual void OnVideoFirstFrameReceived() = 0;
39 // Called when stream size changes.
40 virtual void OnVideoSize(const webrtc::DesktopSize
& size
,
41 const webrtc::DesktopVector
& dpi
) = 0;
43 // Called when desktop shape changes.
44 virtual void OnVideoShape(const webrtc::DesktopRegion
& shape
) = 0;
46 // Called with each frame's updated region, if EnableDebugDirtyRegion(true)
48 virtual void OnVideoFrameDirtyRegion(
49 const webrtc::DesktopRegion
& dirty_region
) = 0;
52 // Initializes the renderer. |instance| and |event_handler| must outlive the
53 // renderer. Returns false if the renderer cannot be initialized.
54 virtual bool Initialize(pp::Instance
* instance
,
55 const ClientContext
& context
,
56 EventHandler
* event_handler
) = 0;
58 // Must be called whenever the plugin view changes.
59 virtual void OnViewChanged(const pp::View
& view
) = 0;
61 // Enables or disables delivery of dirty region information to the
62 // EventHandler, for debugging purposes.
63 virtual void EnableDebugDirtyRegion(bool enable
) = 0;
66 } // namespace remoting
68 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_VIDEO_RENDERER_H_