Gnash
0.8.11dev
libdevice
vaapi
VaapiImageFormat.h
Go to the documentation of this file.
1
// VaapiImageFormat.h: VA image format abstraction
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_VAAPIIMAGEFORMAT_H
21
#define GNASH_VAAPIIMAGEFORMAT_H
22
23
#include "
dsodefs.h
"
24
#include "
vaapi_common.h
"
25
27
enum
VaapiColorspace
{
28
VAAPI_COLORSPACE_UNKNOWN
,
29
VAAPI_COLORSPACE_YUV
,
30
VAAPI_COLORSPACE_RGB
31
};
32
34
enum
VaapiImageFormat
{
36
VAAPI_IMAGE_NONE
= 0,
38
VAAPI_IMAGE_NV12
= VA_FOURCC(
'N'
,
'V'
,
'1'
,
'2'
),
40
VAAPI_IMAGE_YV12
= VA_FOURCC(
'Y'
,
'V'
,
'1'
,
'2'
),
42
VAAPI_IMAGE_I420
= VA_FOURCC(
'I'
,
'4'
,
'2'
,
'0'
),
44
VAAPI_IMAGE_ARGB
= VA_FOURCC(
'A'
,
'R'
,
'G'
,
'B'
),
46
VAAPI_IMAGE_RGBA
= VA_FOURCC(
'R'
,
'G'
,
'B'
,
'A'
),
48
VAAPI_IMAGE_ABGR
= VA_FOURCC(
'A'
,
'B'
,
'G'
,
'R'
),
50
VAAPI_IMAGE_BGRA
= VA_FOURCC(
'B'
,
'G'
,
'R'
,
'A'
),
52
VAAPI_IMAGE_RGB32
= VA_FOURCC(
'R'
,
'G'
,
'B'
, 32),
54
VAAPI_IMAGE_RGB24
= VA_FOURCC(
'R'
,
'G'
,
'B'
, 24)
55
};
56
58
VaapiColorspace
DSOEXPORT
59
vaapi_image_format_get_colorspace
(
VaapiImageFormat
format);
60
62
static
inline
bool
vaapi_image_format_is_rgb(
VaapiImageFormat
format)
63
{
64
return
vaapi_image_format_get_colorspace
(format) ==
VAAPI_COLORSPACE_RGB
;
65
}
66
68
static
inline
bool
vaapi_image_format_is_yuv(
VaapiImageFormat
format)
69
{
70
return
vaapi_image_format_get_colorspace
(format) ==
VAAPI_COLORSPACE_YUV
;
71
}
72
74
VaapiImageFormat
vaapi_get_image_format
(VAImageFormat
const
&format);
75
76
#endif // GNASH_VAAPIIMAGEFORMAT_H
77
78
// local Variables:
79
// mode: C++
80
// indent-tabs-mode: nil
81
// End:
82
83
dsodefs.h
VAAPI_IMAGE_RGBA
Packed RGB 8:8:8, 32-bit, R G B A.
Definition:
VaapiImageFormat.h:46
VAAPI_IMAGE_NONE
Best format for the underlying hardware.
Definition:
VaapiImageFormat.h:36
VAAPI_COLORSPACE_UNKNOWN
Definition:
VaapiImageFormat.h:28
VAAPI_IMAGE_YV12
Planar YUV 4:2:0, 12-bit, 3 planes for Y V U.
Definition:
VaapiImageFormat.h:40
VaapiImageFormat
VaapiImageFormat
Image types.
Definition:
VaapiImageFormat.h:34
vaapi_common.h
VAAPI_COLORSPACE_RGB
YUV colorspace.
Definition:
VaapiImageFormat.h:30
VAAPI_IMAGE_RGB32
Packed RGB 8:8:8, 32-bit, A R G B, native endian byte-order.
Definition:
VaapiImageFormat.h:52
DSOEXPORT
#define DSOEXPORT
Definition:
dsodefs.h:55
vaapi_get_image_format
VaapiImageFormat vaapi_get_image_format(VAImageFormat const &format)
Return image format from a VA image format.
Definition:
VaapiImageFormat.cpp:43
vaapi_image_format_get_colorspace
VaapiColorspace DSOEXPORT vaapi_image_format_get_colorspace(VaapiImageFormat format)
Get colorspace for the specified image format.
Definition:
VaapiImageFormat.cpp:23
VAAPI_IMAGE_RGB24
Packed RGB 8:8:8, 24-bit, R G B.
Definition:
VaapiImageFormat.h:54
VAAPI_IMAGE_I420
Planar YUV 4:2:0, 12-bit, 3 planes for Y U V.
Definition:
VaapiImageFormat.h:42
VAAPI_IMAGE_NV12
Planar YUV 4:2:0, 12-bit, 1 plane for Y and 1 plane for UV.
Definition:
VaapiImageFormat.h:38
VAAPI_IMAGE_BGRA
Packed RGB 8:8:8, 32-bit, R G B A.
Definition:
VaapiImageFormat.h:50
VAAPI_IMAGE_ARGB
Packed RGB 8:8:8, 32-bit, A R G B.
Definition:
VaapiImageFormat.h:44
VaapiColorspace
VaapiColorspace
Color spaces.
Definition:
VaapiImageFormat.h:27
VAAPI_COLORSPACE_YUV
Unknown colorspace.
Definition:
VaapiImageFormat.h:29
VAAPI_IMAGE_ABGR
Packed RGB 8:8:8, 32-bit, A R G B.
Definition:
VaapiImageFormat.h:48
Generated by
1.8.12