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. |shape| should be NULL if frames are
45 virtual void OnVideoShape(const webrtc::DesktopRegion
* shape
) = 0;
47 // Called with each frame's updated region, if EnableDebugDirtyRegion(true)
49 virtual void OnVideoFrameDirtyRegion(
50 const webrtc::DesktopRegion
& dirty_region
) = 0;
53 // Initializes the renderer. |instance| and |event_handler| must outlive the
54 // renderer. Returns false if the renderer cannot be initialized.
55 virtual bool Initialize(pp::Instance
* instance
,
56 const ClientContext
& context
,
57 EventHandler
* event_handler
) = 0;
59 // Must be called whenever the plugin view changes.
60 virtual void OnViewChanged(const pp::View
& view
) = 0;
62 // Enables or disables delivery of dirty region information to the
63 // EventHandler, for debugging purposes.
64 virtual void EnableDebugDirtyRegion(bool enable
) = 0;
67 } // namespace remoting
69 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_VIDEO_RENDERER_H_