• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List
  • File Members

gtk_glue_agg_vaapi.h

Go to the documentation of this file.
00001 //
00002 //   Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
00003 //
00004 // This program is free software; you can redistribute it and/or modify
00005 // it under the terms of the GNU General Public License as published by
00006 // the Free Software Foundation; either version 3 of the License, or
00007 // (at your option) any later version.
00008 //
00009 // This program is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU General Public License for more details.
00013 // 
00014 // You should have received a copy of the GNU General Public License
00015 // along with this program; if not, write to the Free Software
00016 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00017 //
00018 
00019 #ifdef HAVE_CONFIG_H
00020 #include "gnashconfig.h"
00021 #endif
00022 
00023 #include "gtk_glue.h"
00024 
00025 #include <gtk/gtk.h>
00026 #include <gdk/gdk.h>
00027 #include <boost/shared_ptr.hpp>
00028 #include <boost/scoped_array.hpp>
00029 #include <memory>
00030 #include "VaapiImageFormat.h"
00031 
00032 namespace gnash
00033 {
00034 
00035 // Forward declarations
00036 class VaapiImage;
00037 class VaapiSurface;
00038 class VaapiSubpicture;
00039 class VaapiRectangle;
00040 class VaapiVideoWindow;
00041 class Renderer_agg_base;
00042 
00043 class GtkAggVaapiGlue : public GtkGlue
00044 {
00045 public:
00046     GtkAggVaapiGlue();
00047     ~GtkAggVaapiGlue();
00048 
00049     bool init(int argc, char **argv[]);
00050     void prepDrawingArea(GtkWidget *drawing_area);
00051     Renderer* createRenderHandler();
00052     void setRenderHandlerSize(int width, int height);
00053     void beforeRendering();
00054     void render();
00055     void render(GdkRegion * const);
00056     void configure(GtkWidget *const widget, GdkEventConfigure *const event);
00057 
00058 private:
00059     VaapiVideoWindow *getVideoWindow(boost::shared_ptr<VaapiSurface> surface,
00060                                      GdkWindow *parent_window,
00061                                      VaapiRectangle const & rect);
00062 
00063     void resetRenderSurface(unsigned int width, unsigned int height);
00064 
00065 private:
00066     Renderer_agg_base                  *_agg_renderer;
00067     VaapiImageFormat                    _vaapi_image_format;
00068     boost::shared_ptr<VaapiImage>       _vaapi_image;
00069     unsigned int                        _vaapi_image_width;
00070     unsigned int                        _vaapi_image_height;
00071     boost::shared_ptr<VaapiSubpicture>  _vaapi_subpicture;
00072     std::auto_ptr<VaapiSurface>         _vaapi_surface;
00073     unsigned int                        _window_width;
00074     unsigned int                        _window_height;
00075     bool                                _window_is_setup;
00076 };
00077 
00078 } // namespace gnash

Generated on Thu Sep 30 2010 14:34:59 for Gnash by  doxygen 1.7.1