vaapiconvert: change direct-rendering=0 to vaPutImage and support YUY2 colorspace...
[profile/ivi/gstreamer-vaapi.git] / gst / vaapi / gstvaapiupload.h
1 /*
2  *  gstvaapiupload.h - VA-API video uploader
3  *
4  *  Copyright (C) 2010-2011 Splitted-Desktop Systems
5  *  Copyright (C) 2011-2012 Intel Corporation
6  *
7  *  This program 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 program 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 program; 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_VAAPIUPLOAD_H
24 #define GST_VAAPIUPLOAD_H
25
26 #include <gst/base/gstbasetransform.h>
27 #include <gst/vaapi/gstvaapidisplay.h>
28 #include <gst/vaapi/gstvaapisurface.h>
29 #include <gst/vaapi/gstvaapiimagepool.h>
30 #include <gst/vaapi/gstvaapisurfacepool.h>
31 #include <gst/vaapi/gstvaapivideobuffer.h>
32
33 G_BEGIN_DECLS
34
35 #define GST_TYPE_VAAPIUPLOAD \
36     (gst_vaapiupload_get_type())
37
38 #define GST_VAAPIUPLOAD(obj)                            \
39     (G_TYPE_CHECK_INSTANCE_CAST((obj),                  \
40                                 GST_TYPE_VAAPIUPLOAD,   \
41                                 GstVaapiUpload))
42
43 #define GST_VAAPIUPLOAD_CLASS(klass)                    \
44     (G_TYPE_CHECK_CLASS_CAST((klass),                   \
45                              GST_TYPE_VAAPIUPLOAD,      \
46                              GstVaapiUploadClass))
47
48 #define GST_IS_VAAPIUPLOAD(obj) \
49     (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_VAAPIUPLOAD))
50
51 #define GST_IS_VAAPIUPLOAD_CLASS(klass) \
52     (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_VAAPIUPLOAD))
53
54 #define GST_VAAPIUPLOAD_GET_CLASS(obj)                  \
55     (G_TYPE_INSTANCE_GET_CLASS((obj),                   \
56                                GST_TYPE_VAAPIUPLOAD,    \
57                                GstVaapiUploadClass))
58
59 typedef struct _GstVaapiUpload                  GstVaapiUpload;
60 typedef struct _GstVaapiUploadClass             GstVaapiUploadClass;
61
62 /* Max output surfaces */
63 #define GST_VAAPIUPLOAD_MAX_SURFACES 2
64
65 struct _GstVaapiUpload {
66     /*< private >*/
67     GstBaseTransform    parent_instance;
68
69     GstVaapiDisplay    *display;
70     GstVaapiVideoPool  *images;
71     guint               image_width;
72     guint               image_height;
73     GstVaapiVideoPool  *surfaces;
74     guint               surface_width;
75     guint               surface_height;
76     guint               direct_rendering_caps;
77     guint               direct_rendering;
78     unsigned int        images_reset    : 1;
79     unsigned int        surfaces_reset  : 1;
80     unsigned int        need_manual_convert : 1;
81 };
82
83 struct _GstVaapiUploadClass {
84     /*< private >*/
85     GstBaseTransformClass parent_class;
86 };
87
88 GType
89 gst_vaapiupload_get_type(void) G_GNUC_CONST;
90
91 G_END_DECLS
92
93 #endif /* GST_VAAPIUPLOAD_H */