Tizen 2.1 base
[framework/multimedia/gstreamer-vaapi.git] / gst-libs / gst / vaapi / gstvaapiobject_priv.h
1 /*
2  *  gstvaapiobject_priv.h - Base VA object (private definitions)
3  *
4  *  Copyright (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_OBJECT_PRIV_H
23 #define GST_VAAPI_OBJECT_PRIV_H
24
25 #include <gst/vaapi/gstvaapiobject.h>
26
27 G_BEGIN_DECLS
28
29 #define GST_VAAPI_OBJECT_GET_PRIVATE(obj)                       \
30     (G_TYPE_INSTANCE_GET_PRIVATE((obj),                         \
31                                  GST_VAAPI_TYPE_OBJECT,         \
32                                  GstVaapiObjectPrivate))
33
34 #define GST_VAAPI_OBJECT_CAST(object) ((GstVaapiObject *)(object))
35
36 /**
37  * GST_VAAPI_OBJECT_DISPLAY:
38  * @object: a #GstVaapiObject
39  *
40  * Macro that evaluates to the #GstVaapiDisplay the @object is bound to.
41  * This is an internal macro that does not do any run-time type check.
42  */
43 #define GST_VAAPI_OBJECT_DISPLAY(object) \
44     GST_VAAPI_OBJECT_CAST(object)->priv->display
45
46 /**
47  * GST_VAAPI_OBJECT_ID:
48  * @object: a #GstVaapiObject
49  *
50  * Macro that evaluates to the #GstVaapiID contained in @object.
51  * This is an internal macro that does not do any run-time type checks.
52  */
53 #define GST_VAAPI_OBJECT_ID(object) \
54     GST_VAAPI_OBJECT_CAST(object)->priv->id
55
56 /**
57  * GST_VAAPI_OBJECT_DISPLAY_X11:
58  * @object: a #GstVaapiObject
59  *
60  * Macro that evaluates to the #GstVaapiDisplayX11 the @object is bound to.
61  * This is an internal macro that does not do any run-time type check
62  * and requires #include "gstvaapidisplay_x11_priv.h"
63  */
64 #define GST_VAAPI_OBJECT_DISPLAY_X11(object) \
65     GST_VAAPI_DISPLAY_X11_CAST(GST_VAAPI_OBJECT_DISPLAY(object))
66
67 /**
68  * GST_VAAPI_OBJECT_DISPLAY_GLX:
69  * @object: a #GstVaapiObject
70  *
71  * Macro that evaluates to the #GstVaapiDisplayGLX the @object is bound to.
72  * This is an internal macro that does not do any run-time type check
73  * and requires #include "gstvaapidisplay_glx_priv.h".
74  */
75 #define GST_VAAPI_OBJECT_DISPLAY_GLX(object) \
76     GST_VAAPI_DISPLAY_GLX_CAST(GST_VAAPI_OBJECT_DISPLAY(object))
77
78 /**
79  * GST_VAAPI_OBJECT_DISPLAY_WAYLAND:
80  * @object: a #GstVaapiObject
81  *
82  * Macro that evaluates to the #GstVaapiDisplayWayland the @object is
83  * bound to.  This is an internal macro that does not do any run-time
84  * type check and requires #include "gstvaapidisplay_wayland_priv.h"
85  */
86 #define GST_VAAPI_OBJECT_DISPLAY_WAYLAND(object) \
87     GST_VAAPI_DISPLAY_WAYLAND_CAST(GST_VAAPI_OBJECT_DISPLAY(object))
88
89 /**
90  * GST_VAAPI_OBJECT_VADISPLAY:
91  * @object: a #GstVaapiObject
92  *
93  * Macro that evaluates to the #VADisplay of @display.
94  * This is an internal macro that does not do any run-time type check
95  * and requires #include "gstvaapidisplay_priv.h".
96  */
97 #define GST_VAAPI_OBJECT_VADISPLAY(object) \
98     GST_VAAPI_DISPLAY_VADISPLAY(GST_VAAPI_OBJECT_DISPLAY(object))
99
100 /**
101  * GST_VAAPI_OBJECT_XDISPLAY:
102  * @object: a #GstVaapiObject
103  *
104  * Macro that evaluates to the underlying X11 #Display of @display.
105  * This is an internal macro that does not do any run-time type check
106  * and requires #include "gstvaapidisplay_x11_priv.h".
107  */
108 #define GST_VAAPI_OBJECT_XDISPLAY(object) \
109     GST_VAAPI_DISPLAY_XDISPLAY(GST_VAAPI_OBJECT_DISPLAY(object))
110
111 /**
112  * GST_VAAPI_OBJECT_XSCREEN:
113  * @object: a #GstVaapiObject
114  *
115  * Macro that evaluates to the underlying X11 screen of @display.
116  * This is an internal macro that does not do any run-time type check
117  * and requires #include "gstvaapidisplay_x11_priv.h".
118  */
119 #define GST_VAAPI_OBJECT_XSCREEN(object) \
120     GST_VAAPI_DISPLAY_XSCREEN(GST_VAAPI_OBJECT_DISPLAY(object))
121
122 /**
123  * GST_VAAPI_OBJECT_WL_DISPLAY:
124  * @object: a #GstVaapiObject
125  *
126  * Macro that evaluates to the underlying #wl_display of @display.
127  * This is an internal macro that does not do any run-time type check
128  * and requires #include "gstvaapidisplay_wayland_priv.h".
129  */
130 #define GST_VAAPI_OBJECT_WL_DISPLAY(object) \
131     GST_VAAPI_DISPLAY_WL_DISPLAY(GST_VAAPI_OBJECT_DISPLAY(object))
132
133 /**
134  * GST_VAAPI_OBJECT_LOCK_DISPLAY:
135  * @object: a #GstVaapiObject
136  *
137  * Macro that locks the #GstVaapiDisplay contained in the @object.
138  * This is an internal macro that does not do any run-time type check.
139  */
140 #define GST_VAAPI_OBJECT_LOCK_DISPLAY(object) \
141     GST_VAAPI_DISPLAY_LOCK(GST_VAAPI_OBJECT_DISPLAY(object))
142
143 /**
144  * GST_VAAPI_OBJECT_UNLOCK_DISPLAY:
145  * @object: a #GstVaapiObject
146  *
147  * Macro that unlocks the #GstVaapiDisplay contained in the @object.
148  * This is an internal macro that does not do any run-time type check.
149  */
150 #define GST_VAAPI_OBJECT_UNLOCK_DISPLAY(object) \
151     GST_VAAPI_DISPLAY_UNLOCK(GST_VAAPI_OBJECT_DISPLAY(object))
152
153 /**
154  * GstVaapiObjectPrivate:
155  *
156  * VA object base.
157  */
158 struct _GstVaapiObjectPrivate {
159     GstVaapiDisplay    *display;
160     GstVaapiID          id;
161     guint               is_destroying   : 1;
162 };
163
164 G_END_DECLS
165
166 #endif /* GST_VAAPI_OBJECT_PRIV_H */