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 <memory>
29 #include "vaapi/VaapiImageFormat.h"
30 
31 namespace gnash
32 {
33 
34 // Forward declarations
35 class VaapiImage;
36 class VaapiSurface;
37 class VaapiSubpicture;
38 class VaapiRectangle;
39 class VaapiVideoWindow;
40 class Renderer_agg_base;
41 class movie_root;
42 
43 class GtkAggVaapiGlue : public GtkGlue
44 {
45 public:
48 
49  bool init(int argc, char **argv[]);
50  void prepDrawingArea(GtkWidget *drawing_area);
52  void setRenderHandlerSize(int width, int height);
53  virtual void beforeRendering(movie_root* stage);
54  void render();
55  void render(GdkRegion * const);
56  void configure(GtkWidget *const widget, GdkEventConfigure *const event);
57 
58 private:
59  VaapiVideoWindow *getVideoWindow(std::shared_ptr<VaapiSurface> surface,
60  GdkWindow *parent_window,
61  VaapiRectangle const & rect);
62 
63  void resetRenderSurface(unsigned int width, unsigned int height);
64 
65 private:
66  Renderer_agg_base *_agg_renderer;
67  VaapiImageFormat _vaapi_image_format;
68  std::shared_ptr<VaapiImage> _vaapi_image;
69  unsigned int _vaapi_image_width;
70  unsigned int _vaapi_image_height;
71  std::shared_ptr<VaapiSubpicture> _vaapi_subpicture;
72  std::unique_ptr<VaapiSurface> _vaapi_surface;
73  unsigned int _window_width;
74  unsigned int _window_height;
75  bool _window_is_setup;
76 };
77 
78 } // namespace gnash
Renderer_agg.h
gnash::VaapiContext
VA context abstraction.
Definition: VaapiContext.h:51
gnash::create_Renderer_agg
DSOEXPORT Renderer_agg_base * create_Renderer_agg(const char *pixelformat)
Create a render handler.
Definition: Renderer_agg.cpp:2048
Movie.h
movie_root.h
VaapiException.h
height
@ height
Definition: klash_part.cpp:329
gnash::VaapiGlobalContext
VA API global context.
Definition: VaapiGlobalContext.h:33
gnash::key::U
@ U
Definition: GnashKey.h:133
gnash::Movie::widthPixels
virtual size_t widthPixels() const =0
gnash::movie_root::getRootMovie
Movie & getRootMovie()
Access the originating root movie (not necessarily _level0)
Definition: movie_root.h:303
gnash::VaapiGlobalContext::display
VADisplay display() const
Get the VA display.
Definition: VaapiGlobalContext.h:71
y
std::int32_t y
Definition: BitmapData_as.cpp:435
gnash::key::i
@ i
Definition: GnashKey.h:155
_
#define _(String)
Definition: log.h:44
Renderer.h
gnash
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
gnash::GtkAggVaapiGlue::beforeRendering
virtual void beforeRendering(movie_root *stage)
Definition: gtk_glue_agg_vaapi.cpp:260
gnash::Renderer
Base class for render handlers.
Definition: Renderer.h:189
gnash::VaapiGlobalContext::get
static VaapiGlobalContext * get()
Get the unique global VA context.
Definition: VaapiGlobalContext.cpp:130
gnash::Renderer_agg_base::init_buffer
virtual void init_buffer(unsigned char *mem, int size, int x, int y, int rowstride)=0
VaapiImageFormat.h
VaapiContext.h
dprintf
#define dprintf(format,...)
Definition: gtk_glue_agg_vaapi.cpp:44
gtk_glue.h
gnash::GtkAggVaapiGlue
Definition: gtk_glue_agg_vaapi.h:44
VAAPI_IMAGE_ARGB
@ VAAPI_IMAGE_ARGB
Packed RGB 8:8:8, 32-bit, A R G B.
Definition: VaapiImageFormat.h:44
gnash::log_error
void log_error(StringType msg, Args... args)
Definition: log.h:283
VAAPI_IMAGE_ABGR
@ VAAPI_IMAGE_ABGR
Packed RGB 8:8:8, 32-bit, A R G B.
Definition: VaapiImageFormat.h:48
gnash::Renderer::set_scale
virtual void set_scale(float, float)
Sets the x/y scale for the movie
Definition: Renderer.h:204
gnash::VaapiGlobalContext::getSubpictureFormats
std::vector< VaapiImageFormat > getSubpictureFormats() const
Get the list of supported subpicture formats.
Definition: VaapiGlobalContext.cpp:124
USE_HW_SCALING
#define USE_HW_SCALING
Definition: gtk_glue_agg_vaapi.cpp:48
gnash::key::r
@ r
Definition: GnashKey.h:164
gnash::string_of_FOURCC
const char * string_of_FOURCC(std::uint32_t fourcc)
Return a string representation of a FOURCC.
Definition: vaapi_utils.cpp:61
gnash::Movie::heightPixels
virtual size_t heightPixels() const =0
gnash::Renderer::getFirstRenderImage
virtual RenderImages::const_iterator getFirstRenderImage() const
Definition: Renderer.h:353
gnash::GtkGlue
Definition: gtk_glue.h:41
VaapiDisplayX11.h
GnashVaapiImage.h
gnash::VaapiContext::setData
void setData(std::unique_ptr< VaapiContextData > user_data)
Set user data.
Definition: VaapiContext.h:87
gnash::GtkAggVaapiGlue::GtkAggVaapiGlue
GtkAggVaapiGlue()
Definition: gtk_glue_agg_vaapi.cpp:143
gnash::vaapi_check_status
bool vaapi_check_status(VAStatus status, const char *msg)
Check VA status for success or print out an error.
Definition: vaapi_utils.cpp:51
gtk_glue_agg_vaapi.h
gnash::GtkAggVaapiGlue::createRenderHandler
Renderer * createRenderHandler()
Definition: gtk_glue_agg_vaapi.cpp:183
VaapiImageFormat
VaapiImageFormat
Image types.
Definition: VaapiImageFormat.h:34
gnash::GtkAggVaapiGlue::init
bool init(int argc, char **argv[])
Definition: gtk_glue_agg_vaapi.cpp:159
gnash::VaapiImage
VA image abstraction.
Definition: VaapiImage.h:41
VaapiImage.h
gnash::Movie
A top-level, standalone Movie that can be loaded and played.
Definition: Movie.h:47
VM.h
gnash::VaapiContext::getData
VaapiContextData * getData() const
Get user data.
Definition: VaapiContext.h:90
VaapiGlobalContext.h
gnash::GtkAggVaapiGlue::setRenderHandlerSize
void setRenderHandlerSize(int width, int height)
Definition: gtk_glue_agg_vaapi.cpp:251
gnash::GtkAggVaapiGlue::prepDrawingArea
void prepDrawingArea(GtkWidget *drawing_area)
Definition: gtk_glue_agg_vaapi.cpp:170
VaapiSurface.h
log.h
gnash::GtkGlue::_drawing_area
GtkWidget * _drawing_area
Definition: gtk_glue.h:77
gnash::VaapiSubpicture
VA subpicture abstraction.
Definition: VaapiSubpicture.h:36
VAAPI_IMAGE_BGRA
@ VAAPI_IMAGE_BGRA
Packed RGB 8:8:8, 32-bit, R G B A.
Definition: VaapiImageFormat.h:50
gnash::Renderer_agg_base
Definition: Renderer_agg.h:30
gnashconfig.h
gnash::VaapiRectangle
VA rectangle abstraction.
Definition: VaapiSurface.h:35
gnash::movie_root
This class represents the 'Stage' and top-level movie.
Definition: movie_root.h:151
gnash::GtkAggVaapiGlue::configure
void configure(GtkWidget *const widget, GdkEventConfigure *const event)
Definition: gtk_glue_agg_vaapi.cpp:410
VAAPI_IMAGE_NONE
@ VAAPI_IMAGE_NONE
Best format for the underlying hardware.
Definition: VaapiImageFormat.h:36
GnashVaapiImageProxy.h
gnash::VaapiSurface
VA surface abstraction.
Definition: VaapiSurface.h:68
gnash::GtkAggVaapiGlue::~GtkAggVaapiGlue
~GtkAggVaapiGlue()
Definition: gtk_glue_agg_vaapi.cpp:154
width
@ width
Definition: klash_part.cpp:329
gnash::GtkAggVaapiGlue::render
void render()
Definition: gtk_glue_agg_vaapi.cpp:312
vaapi_utils.h
x
std::int32_t x
Definition: BitmapData_as.cpp:434
gnash::Renderer::getLastRenderImage
virtual RenderImages::const_iterator getLastRenderImage() const
Definition: Renderer.h:357
VAAPI_IMAGE_RGBA
@ VAAPI_IMAGE_RGBA
Packed RGB 8:8:8, 32-bit, R G B A.
Definition: VaapiImageFormat.h:46
VaapiSubpicture.h