display: use VA display cache for X11 and GLX winsys.
[profile/ivi/gstreamer-vaapi.git] / gst-libs / gst / vaapi / gstvaapidisplay_priv.h
1 /*
2  *  gstvaapidisplay_priv.h - Base VA display (private definitions)
3  *
4  *  gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems
5  *
6  *  This library is free software; you can redistribute it and/or
7  *  modify it under the terms of the GNU Lesser General Public License
8  *  as published by the Free Software Foundation; either version 2.1
9  *  of the License, or (at your option) any later version.
10  *
11  *  This library is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  *  Lesser General Public License for more details.
15  *
16  *  You should have received a copy of the GNU Lesser General Public
17  *  License along with this library; if not, write to the Free
18  *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  *  Boston, MA 02110-1301 USA
20  */
21
22 #ifndef GST_VAAPI_DISPLAY_PRIV_H
23 #define GST_VAAPI_DISPLAY_PRIV_H
24
25 #include <gst/vaapi/gstvaapidisplay.h>
26 #include <gst/vaapi/gstvaapidisplaycache.h>
27
28 G_BEGIN_DECLS
29
30 #define GST_VAAPI_DISPLAY_GET_PRIVATE(obj)                      \
31     (G_TYPE_INSTANCE_GET_PRIVATE((obj),                         \
32                                  GST_VAAPI_TYPE_DISPLAY,        \
33                                  GstVaapiDisplayPrivate))
34
35 #define GST_VAAPI_DISPLAY_CAST(display) ((GstVaapiDisplay *)(display))
36
37 /**
38  * GST_VAAPI_DISPLAY_VADISPLAY:
39  * @display_: a #GstVaapiDisplay
40  *
41  * Macro that evaluates to the #VADisplay of @display.
42  * This is an internal macro that does not do any run-time type check.
43  */
44 #undef  GST_VAAPI_DISPLAY_VADISPLAY
45 #define GST_VAAPI_DISPLAY_VADISPLAY(display_) \
46     GST_VAAPI_DISPLAY_CAST(display_)->priv->display
47
48 /**
49  * GST_VAAPI_DISPLAY_LOCK:
50  * @display: a #GstVaapiDisplay
51  *
52  * Locks @display
53  */
54 #undef  GST_VAAPI_DISPLAY_LOCK
55 #define GST_VAAPI_DISPLAY_LOCK(display) \
56     gst_vaapi_display_lock(GST_VAAPI_DISPLAY_CAST(display))
57
58 /**
59  * GST_VAAPI_DISPLAY_UNLOCK:
60  * @display: a #GstVaapiDisplay
61  *
62  * Unlocks @display
63  */
64 #undef  GST_VAAPI_DISPLAY_UNLOCK
65 #define GST_VAAPI_DISPLAY_UNLOCK(display) \
66     gst_vaapi_display_unlock(GST_VAAPI_DISPLAY_CAST(display))
67
68 /**
69  * GstVaapiDisplayPrivate:
70  *
71  * Base class for VA displays.
72  */
73 struct _GstVaapiDisplayPrivate {
74     GstVaapiDisplay    *parent;
75     GStaticRecMutex     mutex;
76     VADisplay           display;
77     guint               width;
78     guint               height;
79     guint               width_mm;
80     guint               height_mm;
81     guint               par_n;
82     guint               par_d;
83     GArray             *decoders;
84     GArray             *encoders;
85     GArray             *image_formats;
86     GArray             *subpicture_formats;
87     guint               create_display  : 1;
88 };
89
90 GstVaapiDisplayCache *
91 gst_vaapi_display_get_cache(void);
92
93 G_END_DECLS
94
95 #endif /* GST_VAAPI_DISPLAY_PRIV_H */