ExtensionInstallDialogView: fix scrolling behavior on Views (Win,Linux)
[chromium-blink-merge.git] / remoting / client / plugin / pepper_video_renderer.h
blob86713a56dd00ab7bbede6bb5391178747a95fb01
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"
10 namespace webrtc {
11 class DesktopSize;
12 class DesktopVector;
13 class DesktopRegion;
14 } // namespace webrtc
16 namespace pp {
17 class Instance;
18 class View;
19 } // namespace pp
21 namespace remoting {
23 class ClientContext;
25 // Interface for video renderers that render video in pepper plugin.
26 class PepperVideoRenderer : public VideoRenderer {
27 public:
28 class EventHandler {
29 public:
30 EventHandler() {}
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)
47 // was called.
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_