libs: use glib >= 2.32 semantics for mutexes.
[profile/ivi/gstreamer-vaapi.git] / gst-libs / gst / vaapi / gstvaapidisplay_priv.h
1 /*
2  *  gstvaapidisplay_priv.h - Base VA display (private definitions)
3  *
4  *  Copyright (C) 2010-2011 Splitted-Desktop Systems
5  *  Copyright (C) 2011-2012 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_DISPLAY_PRIV_H
24 #define GST_VAAPI_DISPLAY_PRIV_H
25
26 #include <gst/vaapi/gstvaapidisplay.h>
27 #include <gst/vaapi/gstvaapidisplaycache.h>
28
29 G_BEGIN_DECLS
30
31 #define GST_VAAPI_DISPLAY_GET_PRIVATE(obj)                      \
32     (G_TYPE_INSTANCE_GET_PRIVATE((obj),                         \
33                                  GST_VAAPI_TYPE_DISPLAY,        \
34                                  GstVaapiDisplayPrivate))
35
36 #define GST_VAAPI_DISPLAY_CAST(display) ((GstVaapiDisplay *)(display))
37
38 /**
39  * GST_VAAPI_DISPLAY_VADISPLAY:
40  * @display_: a #GstVaapiDisplay
41  *
42  * Macro that evaluates to the #VADisplay of @display.
43  * This is an internal macro that does not do any run-time type check.
44  */
45 #undef  GST_VAAPI_DISPLAY_VADISPLAY
46 #define GST_VAAPI_DISPLAY_VADISPLAY(display_) \
47     GST_VAAPI_DISPLAY_CAST(display_)->priv->display
48
49 /**
50  * GST_VAAPI_DISPLAY_LOCK:
51  * @display: a #GstVaapiDisplay
52  *
53  * Locks @display
54  */
55 #undef  GST_VAAPI_DISPLAY_LOCK
56 #define GST_VAAPI_DISPLAY_LOCK(display) \
57     gst_vaapi_display_lock(GST_VAAPI_DISPLAY_CAST(display))
58
59 /**
60  * GST_VAAPI_DISPLAY_UNLOCK:
61  * @display: a #GstVaapiDisplay
62  *
63  * Unlocks @display
64  */
65 #undef  GST_VAAPI_DISPLAY_UNLOCK
66 #define GST_VAAPI_DISPLAY_UNLOCK(display) \
67     gst_vaapi_display_unlock(GST_VAAPI_DISPLAY_CAST(display))
68
69 /**
70  * GstVaapiDisplayPrivate:
71  *
72  * Base class for VA displays.
73  */
74 struct _GstVaapiDisplayPrivate {
75     GstVaapiDisplay    *parent;
76     GRecMutex           mutex;
77     GstVaapiDisplayType display_type;
78     VADisplay           display;
79     guint               width;
80     guint               height;
81     guint               width_mm;
82     guint               height_mm;
83     guint               par_n;
84     guint               par_d;
85     GArray             *decoders;
86     GArray             *encoders;
87     GArray             *image_formats;
88     GArray             *subpicture_formats;
89     GArray             *properties;
90     guint               create_display  : 1;
91 };
92
93 GstVaapiDisplayCache *
94 gst_vaapi_display_get_cache(void);
95
96 G_END_DECLS
97
98 #endif /* GST_VAAPI_DISPLAY_PRIV_H */