update copyright date
[gnash.git] / libvaapi / VaapiGlobalContext.h
blob523d39ad10f8c4c36aa9a66d4236d8ad366d24ac
1 // VaapiGlobalContext.h: VA API global context
2 //
3 // Copyright (C) 2009, 2010, 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
20 #ifndef GNASH_VAAPIGLOBALCONTEXT_H
21 #define GNASH_VAAPIGLOBALCONTEXT_H
23 #include <vector>
25 #include "log.h"
26 #include "vaapi_common.h"
27 #include "VaapiDisplay.h"
28 #include "VaapiImageFormat.h"
30 namespace gnash {
32 /// VA API global context
33 class DSOEXPORT VaapiGlobalContext {
34 std::auto_ptr<VaapiDisplay> _display;
35 std::vector<VAProfile> _profiles;
36 std::vector<VAImageFormat> _image_formats;
37 std::vector<VAImageFormat> _subpicture_formats;
39 bool init();
41 public:
42 VaapiGlobalContext(std::auto_ptr<VaapiDisplay> display);
43 ~VaapiGlobalContext();
45 /// Get the unique global VA context
47 /// @return The global VA context
48 static VaapiGlobalContext *get();
50 /// Check VA profile is supported
51 bool hasProfile(VAProfile profile) const;
53 /// Get the VA image format matching format
55 /// @return The VA image format
56 const VAImageFormat *getImageFormat(VaapiImageFormat format) const;
58 /// Get the list of supported image formats
60 /// @return The list of image formats
61 std::vector<VaapiImageFormat> getImageFormats() const;
63 /// Get the list of supported subpicture formats
65 /// @return The list of subpicture formats
66 std::vector<VaapiImageFormat> getSubpictureFormats() const;
68 /// Get the VA display
70 /// @return The VA display
71 VADisplay display() const { return _display->get(); }
74 } // gnash namespace
76 #endif // GNASH_VAAPIGLOBALCONTEXT_H
79 // local Variables:
80 // mode: C++
81 // indent-tabs-mode: nil
82 // End: