Gnash  0.8.10
VaapiDisplayX11.h
Go to the documentation of this file.
00001 // VaapiDisplayX11.h: VA/X11 display representation
00002 // 
00003 // Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
00004 // 
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation; either version 3 of the License, or
00008 // (at your option) any later version.
00009 // 
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 // 
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018 //
00019 
00020 #ifndef GNASH_VAAPIDISPLAYX11_H
00021 #define GNASH_VAAPIDISPLAYX11_H
00022 
00023 #include <va/va_x11.h>
00024 #include "VaapiDisplay.h"
00025 
00026 namespace gnash {
00027 
00029 class X11Display {
00030     Display *_x_display;
00031 
00032 public:
00033     X11Display() { _x_display = XOpenDisplay(NULL); }
00034 
00035     ~X11Display() { if (_x_display) XCloseDisplay(_x_display); }
00036 
00037     Display *get() const { return _x_display; }
00038 };
00039 
00041 struct VaapiDisplayX11 : public X11Display, VaapiDisplay {
00042     VaapiDisplayX11()
00043         : VaapiDisplay(vaGetDisplay(X11Display::get()))
00044         { }
00045 };
00046 
00047 } // gnash namespace
00048 
00049 #endif // GNASH_VAAPIDISPLAY_H
00050 
00051 // local Variables:
00052 // mode: C++
00053 // indent-tabs-mode: nil
00054 // End:
00055