Tizen 2.0 Release
[framework/multimedia/gstreamer-vaapi.git] / gst-libs / gst / vaapi / gstvaapiimageformat.h
1 /*
2  *  gstvaapiimageformat.h - VA image format abstraction
3  *
4  *  Copyright (C) 2010-2011 Splitted-Desktop Systems
5  *  Copyright (C) 2011 Intel Corporation
6  *
7  *  This library is free software; you can redistribute it and/or
8  *  modify it under the terms of the GNU Lesser General Public License
9  *  as published by the Free Software Foundation; either version 2.1
10  *  of the License, or (at your option) any later version.
11  *
12  *  This library is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  *  Lesser General Public License for more details.
16  *
17  *  You should have received a copy of the GNU Lesser General Public
18  *  License along with this library; if not, write to the Free
19  *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  *  Boston, MA 02110-1301 USA
21  */
22
23 #ifndef GST_VAAPI_IMAGE_FORMAT_H
24 #define GST_VAAPI_IMAGE_FORMAT_H
25
26 #include <gst/gstvalue.h>
27 #include <gst/video/video.h>
28
29 G_BEGIN_DECLS
30
31 typedef enum _GstVaapiImageFormat               GstVaapiImageFormat;
32
33 /**
34  * GstVaapiImageFormat:
35  * @GST_VAAPI_IMAGE_NV12:
36  *   planar YUV 4:2:0, 12-bit, 1 plane for Y and 1 plane for UV
37  * @GST_VAAPI_IMAGE_YV12:
38  *   planar YUV 4:2:0, 12-bit, 3 planes for Y V U
39  * @GST_VAAPI_IMAGE_I420:
40  *   planar YUV 4:2:0, 12-bit, 3 planes for Y U V
41  * @GST_VAAPI_IMAGE_AYUV:
42  *   packed YUV 4:4:4, 32-bit, A Y U V, native endian byte-order
43  * @GST_VAAPI_IMAGE_ARGB:
44  *   packed RGB 8:8:8, 32-bit, A R G B
45  * @GST_VAAPI_IMAGE_RGBA:
46  *   packed RGB 8:8:8, 32-bit, R G B A
47  * @GST_VAAPI_IMAGE_ABGR:
48  *   packed RGB 8:8:8, 32-bit, A B G R
49  * @GST_VAAPI_IMAGE_BGRA:
50  *   packed RGB 8:8:8, 32-bit, B G R A
51  *
52  * The set of all image formats for #GstVaapiImage.
53  */
54 enum _GstVaapiImageFormat {
55     GST_VAAPI_IMAGE_NV12 = GST_MAKE_FOURCC('N','V','1','2'),
56     GST_VAAPI_IMAGE_YV12 = GST_MAKE_FOURCC('Y','V','1','2'),
57     GST_VAAPI_IMAGE_I420 = GST_MAKE_FOURCC('I','4','2','0'),
58     GST_VAAPI_IMAGE_AYUV = GST_MAKE_FOURCC('A','Y','U','V'),
59     GST_VAAPI_IMAGE_ARGB = GST_MAKE_FOURCC('A','R','G','B'),
60     GST_VAAPI_IMAGE_RGBA = GST_MAKE_FOURCC('R','G','B','A'),
61     GST_VAAPI_IMAGE_ABGR = GST_MAKE_FOURCC('A','B','G','R'),
62     GST_VAAPI_IMAGE_BGRA = GST_MAKE_FOURCC('B','G','R','A'),
63 };
64
65 gboolean
66 gst_vaapi_image_format_is_rgb(GstVaapiImageFormat format);
67
68 gboolean
69 gst_vaapi_image_format_is_yuv(GstVaapiImageFormat format);
70
71 GstVaapiImageFormat
72 gst_vaapi_image_format(const VAImageFormat *va_format);
73
74 GstVaapiImageFormat
75 gst_vaapi_image_format_from_caps(GstCaps *caps);
76
77 GstVaapiImageFormat
78 gst_vaapi_image_format_from_fourcc(guint32 fourcc);
79
80 GstVaapiImageFormat
81 gst_vaapi_image_format_from_video(GstVideoFormat format);
82
83 const VAImageFormat *
84 gst_vaapi_image_format_get_va_format(GstVaapiImageFormat format);
85
86 GstCaps *
87 gst_vaapi_image_format_get_caps(GstVaapiImageFormat format);
88
89 guint
90 gst_vaapi_image_format_get_score(GstVaapiImageFormat format);
91
92 G_END_DECLS
93
94 #endif /* GST_GST_VAAPI_IMAGE_H */