Gnash  0.8.11dev
VaapiGlobalContext.h
Go to the documentation of this file.
1 // VaapiGlobalContext.h: VA API global context
2 //
3 // Copyright (C) 2009, 2010, 2011, 2012 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 #ifndef GNASH_VAAPIGLOBALCONTEXT_H
21 #define GNASH_VAAPIGLOBALCONTEXT_H
22 
23 #include <vector>
24 
25 #include "log.h"
26 #include "vaapi_common.h"
27 #include "VaapiDisplay.h"
28 #include "VaapiImageFormat.h"
29 
30 namespace gnash {
31 
34  std::unique_ptr<VaapiDisplay> _display;
35  std::vector<VAProfile> _profiles;
36  std::vector<VAImageFormat> _image_formats;
37  std::vector<VAImageFormat> _subpicture_formats;
38 
39  bool init();
40 
41 public:
42  VaapiGlobalContext(std::unique_ptr<VaapiDisplay> display);
44 
46  //
48  static VaapiGlobalContext *get();
49 
51  bool hasProfile(VAProfile profile) const;
52 
54  //
56  const VAImageFormat *getImageFormat(VaapiImageFormat format) const;
57 
59  //
61  std::vector<VaapiImageFormat> getImageFormats() const;
62 
64  //
66  std::vector<VaapiImageFormat> getSubpictureFormats() const;
67 
69  //
71  VADisplay display() const { return _display->get(); }
72 };
73 
74 } // gnash namespace
75 
76 #endif // GNASH_VAAPIGLOBALCONTEXT_H
77 
78 
79 // local Variables:
80 // mode: C++
81 // indent-tabs-mode: nil
82 // End:
VaapiException.h
gnash::VaapiGlobalContext
VA API global context.
Definition: VaapiGlobalContext.h:33
gnash::VaapiGlobalContext::getImageFormat
const VAImageFormat * getImageFormat(VaapiImageFormat format) const
Get the VA image format matching format.
Definition: VaapiGlobalContext.cpp:96
gnash::VaapiGlobalContext::display
VADisplay display() const
Get the VA display.
Definition: VaapiGlobalContext.h:71
gnash::key::i
@ i
Definition: GnashKey.h:155
LOG_ONCE
#define LOG_ONCE(x)
Definition: log.h:49
gnash
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
GNASH_REPORT_FUNCTION
#define GNASH_REPORT_FUNCTION
Definition: log.h:452
gnash::VaapiGlobalContext::get
static VaapiGlobalContext * get()
Get the unique global VA context.
Definition: VaapiGlobalContext.cpp:130
VaapiImageFormat.h
gnash::VaapiGlobalContext::getSubpictureFormats
std::vector< VaapiImageFormat > getSubpictureFormats() const
Get the list of supported subpicture formats.
Definition: VaapiGlobalContext.cpp:124
gnash::vaapi_set_is_enabled
void vaapi_set_is_enabled(bool enabled)
Enable video acceleration (with VA API)
Definition: vaapi_utils.cpp:29
gnash::VaapiGlobalContext::hasProfile
bool hasProfile(VAProfile profile) const
Check VA profile is supported.
Definition: VaapiGlobalContext.cpp:85
VaapiDisplayX11.h
gnash::get
T * get(as_object *o)
Extract the DisplayObject attached to an object.
Definition: as_object.h:842
gnash::VaapiGlobalContext::getImageFormats
std::vector< VaapiImageFormat > getImageFormats() const
Get the list of supported image formats.
Definition: VaapiGlobalContext.cpp:118
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
vaapi_get_image_format
VaapiImageFormat vaapi_get_image_format(VAImageFormat const &format)
Return image format from a VA image format.
Definition: VaapiImageFormat.cpp:43
VaapiImageFormat
VaapiImageFormat
Image types.
Definition: VaapiImageFormat.h:34
vaapi_common.h
VaapiGlobalContext.h
gnash::VaapiGlobalContext::VaapiGlobalContext
VaapiGlobalContext(std::unique_ptr< VaapiDisplay > display)
Definition: VaapiGlobalContext.cpp:35
gnash::VaapiGlobalContext::~VaapiGlobalContext
~VaapiGlobalContext()
Definition: VaapiGlobalContext.cpp:44
log.h
gnash::VaapiDisplayX11
VA/X11 display representation.
Definition: VaapiDisplayX11.h:41
VaapiDisplayGLX.h
gnashconfig.h
VAAPI_IMAGE_NONE
@ VAAPI_IMAGE_NONE
Best format for the underlying hardware.
Definition: VaapiImageFormat.h:36
DSOEXPORT
#define DSOEXPORT
Definition: dsodefs.h:55
gnash::VaapiException
VA exception abstraction.
Definition: VaapiException.h:29
gnash::VaapiDisplayGLX
VA/GLX display representation.
Definition: VaapiDisplayGLX.h:30
VaapiDisplay.h
vaapi_utils.h