Gnash  0.8.11dev
gtk_glue_agg_vaapi.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010,
3 // 2011 Free Software Foundation, Inc.
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 //
19 
20 #ifdef HAVE_CONFIG_H
21 #include "gnashconfig.h"
22 #endif
23 
24 #include "gtk_glue.h"
25 
26 #include <gtk/gtk.h>
27 #include <gdk/gdk.h>
28 #include <boost/shared_ptr.hpp>
29 #include <boost/scoped_array.hpp>
30 #include <memory>
31 #include "vaapi/VaapiImageFormat.h"
32 
33 namespace gnash
34 {
35 
36 // Forward declarations
37 class VaapiImage;
38 class VaapiSurface;
39 class VaapiSubpicture;
40 class VaapiRectangle;
41 class VaapiVideoWindow;
42 class Renderer_agg_base;
43 class movie_root;
44 
45 class GtkAggVaapiGlue : public GtkGlue
46 {
47 public:
50 
51  bool init(int argc, char **argv[]);
52  void prepDrawingArea(GtkWidget *drawing_area);
54  void setRenderHandlerSize(int width, int height);
55  virtual void beforeRendering(movie_root* stage);
56  void render();
57  void render(GdkRegion * const);
58  void configure(GtkWidget *const widget, GdkEventConfigure *const event);
59 
60 private:
61  VaapiVideoWindow *getVideoWindow(boost::shared_ptr<VaapiSurface> surface,
62  GdkWindow *parent_window,
63  VaapiRectangle const & rect);
64 
65  void resetRenderSurface(unsigned int width, unsigned int height);
66 
67 private:
68  Renderer_agg_base *_agg_renderer;
69  VaapiImageFormat _vaapi_image_format;
70  boost::shared_ptr<VaapiImage> _vaapi_image;
71  unsigned int _vaapi_image_width;
72  unsigned int _vaapi_image_height;
73  boost::shared_ptr<VaapiSubpicture> _vaapi_subpicture;
74  std::auto_ptr<VaapiSurface> _vaapi_surface;
75  unsigned int _window_width;
76  unsigned int _window_height;
77  bool _window_is_setup;
78 };
79 
80 } // namespace gnash
Renderer * createRenderHandler()
Definition: gtk_glue_agg_vaapi.cpp:183
void prepDrawingArea(GtkWidget *drawing_area)
Definition: gtk_glue_agg_vaapi.cpp:170
VA rectangle abstraction.
Definition: VaapiSurface.h:35
VaapiImageFormat
Image types.
Definition: VaapiImageFormat.h:34
void setRenderHandlerSize(int width, int height)
Definition: gtk_glue_agg_vaapi.cpp:251
Definition: klash_part.cpp:329
Base class for render handlers.
Definition: Renderer.h:190
~GtkAggVaapiGlue()
Definition: gtk_glue_agg_vaapi.cpp:154
Definition: klash_part.cpp:329
Definition: gtk_glue.h:40
Definition: Renderer_agg.h:29
GtkAggVaapiGlue()
Definition: gtk_glue_agg_vaapi.cpp:143
Definition: gtk_glue_agg_vaapi.h:45
void render()
Definition: gtk_glue_agg_vaapi.cpp:314
void configure(GtkWidget *const widget, GdkEventConfigure *const event)
Definition: gtk_glue_agg_vaapi.cpp:412
virtual void beforeRendering(movie_root *stage)
Definition: gtk_glue_agg_vaapi.cpp:260
bool init(int argc, char **argv[])
Definition: gtk_glue_agg_vaapi.cpp:159
This class represents the 'Stage' and top-level movie.
Definition: movie_root.h:150