Gnash
0.8.10
|
00001 // VaapiImageFormat.h: VA image format abstraction 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_VAAPIIMAGEFORMAT_H 00021 #define GNASH_VAAPIIMAGEFORMAT_H 00022 00023 #include "dsodefs.h" 00024 #include "vaapi_common.h" 00025 00027 enum VaapiColorspace { 00028 VAAPI_COLORSPACE_UNKNOWN, 00029 VAAPI_COLORSPACE_YUV, 00030 VAAPI_COLORSPACE_RGB 00031 }; 00032 00034 enum VaapiImageFormat { 00036 VAAPI_IMAGE_NONE = 0, 00038 VAAPI_IMAGE_NV12 = VA_FOURCC('N','V','1','2'), 00040 VAAPI_IMAGE_YV12 = VA_FOURCC('Y','V','1','2'), 00042 VAAPI_IMAGE_I420 = VA_FOURCC('I','4','2','0'), 00044 VAAPI_IMAGE_ARGB = VA_FOURCC('A','R','G','B'), 00046 VAAPI_IMAGE_RGBA = VA_FOURCC('R','G','B','A'), 00048 VAAPI_IMAGE_ABGR = VA_FOURCC('A','B','G','R'), 00050 VAAPI_IMAGE_BGRA = VA_FOURCC('B','G','R','A'), 00052 VAAPI_IMAGE_RGB32 = VA_FOURCC('R','G','B', 32), 00054 VAAPI_IMAGE_RGB24 = VA_FOURCC('R','G','B', 24) 00055 }; 00056 00058 VaapiColorspace DSOEXPORT 00059 vaapi_image_format_get_colorspace(VaapiImageFormat format); 00060 00062 static inline bool vaapi_image_format_is_rgb(VaapiImageFormat format) 00063 { 00064 return vaapi_image_format_get_colorspace(format) == VAAPI_COLORSPACE_RGB; 00065 } 00066 00068 static inline bool vaapi_image_format_is_yuv(VaapiImageFormat format) 00069 { 00070 return vaapi_image_format_get_colorspace(format) == VAAPI_COLORSPACE_YUV; 00071 } 00072 00074 VaapiImageFormat vaapi_get_image_format(VAImageFormat const &format); 00075 00076 #endif // GNASH_VAAPIIMAGEFORMAT_H 00077 00078 // local Variables: 00079 // mode: C++ 00080 // indent-tabs-mode: nil 00081 // End: 00082 00083