Gnash
0.8.10
|
00001 // VaapiGlobalContext.h: VA API global context 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_VAAPIGLOBALCONTEXT_H 00021 #define GNASH_VAAPIGLOBALCONTEXT_H 00022 00023 #include <vector> 00024 00025 #include "log.h" 00026 #include "vaapi_common.h" 00027 #include "VaapiDisplay.h" 00028 #include "VaapiImageFormat.h" 00029 00030 namespace gnash { 00031 00033 class DSOEXPORT VaapiGlobalContext { 00034 std::auto_ptr<VaapiDisplay> _display; 00035 std::vector<VAProfile> _profiles; 00036 std::vector<VAImageFormat> _image_formats; 00037 std::vector<VAImageFormat> _subpicture_formats; 00038 00039 bool init(); 00040 00041 public: 00042 VaapiGlobalContext(std::auto_ptr<VaapiDisplay> display); 00043 ~VaapiGlobalContext(); 00044 00046 // 00048 static VaapiGlobalContext *get(); 00049 00051 bool hasProfile(VAProfile profile) const; 00052 00054 // 00056 const VAImageFormat *getImageFormat(VaapiImageFormat format) const; 00057 00059 // 00061 std::vector<VaapiImageFormat> getImageFormats() const; 00062 00064 // 00066 std::vector<VaapiImageFormat> getSubpictureFormats() const; 00067 00069 // 00071 VADisplay display() const { return _display->get(); } 00072 }; 00073 00074 } // gnash namespace 00075 00076 #endif // GNASH_VAAPIGLOBALCONTEXT_H 00077 00078 00079 // local Variables: 00080 // mode: C++ 00081 // indent-tabs-mode: nil 00082 // End: