843950b2a92b4f1c5fabb38a472f53a892a10218
[platform/upstream/gstreamer-vaapi.git] / gst-libs / gst / vaapi / gstvaapidisplay_x11_priv.h
1 /*
2  *  gstvaapidisplay_x11_priv.h - Internal VA/X11 interface
3  *
4  *  Copyright (C) 2010-2011 Splitted-Desktop Systems
5  *  Copyright (C) 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_X11_PRIV_H
24 #define GST_VAAPI_DISPLAY_X11_PRIV_H
25
26 #include <gst/vaapi/gstvaapiutils_x11.h>
27 #include <gst/vaapi/gstvaapidisplay_x11.h>
28 #include "gstvaapidisplay_priv.h"
29
30 G_BEGIN_DECLS
31
32 #define GST_VAAPI_IS_DISPLAY_X11(display)                               \
33     ((display) != NULL &&                                               \
34      (GST_VAAPI_DISPLAY_TYPE(display) == GST_VAAPI_DISPLAY_TYPE_X11 ||  \
35       GST_VAAPI_DISPLAY_TYPE(display) == GST_VAAPI_DISPLAY_TYPE_GLX))
36
37 #define GST_VAAPI_DISPLAY_X11_CAST(display) \
38     ((GstVaapiDisplayX11 *)(display))
39
40 #define GST_VAAPI_DISPLAY_X11_PRIVATE(display) \
41     (&GST_VAAPI_DISPLAY_X11_CAST(display)->priv)
42
43 typedef struct _GstVaapiDisplayX11Private       GstVaapiDisplayX11Private;
44 typedef struct _GstVaapiDisplayX11Class         GstVaapiDisplayX11Class;
45
46 /**
47  * GST_VAAPI_DISPLAY_XDISPLAY:
48  * @display: a #GstVaapiDisplay
49  *
50  * Macro that evaluates to the underlying X11 #Display of @display
51  */
52 #undef  GST_VAAPI_DISPLAY_XDISPLAY
53 #define GST_VAAPI_DISPLAY_XDISPLAY(display) \
54     GST_VAAPI_DISPLAY_X11_PRIVATE(display)->x11_display
55
56 /**
57  * GST_VAAPI_DISPLAY_XSCREEN:
58  * @display: a #GstVaapiDisplay
59  *
60  * Macro that evaluates to the underlying X11 screen of @display
61  */
62 #undef  GST_VAAPI_DISPLAY_XSCREEN
63 #define GST_VAAPI_DISPLAY_XSCREEN(display) \
64     GST_VAAPI_DISPLAY_X11_PRIVATE(display)->x11_screen
65
66 struct _GstVaapiDisplayX11Private {
67     gchar              *display_name;
68     Display            *x11_display;
69     int                 x11_screen;
70     guint               use_foreign_display     : 1; // Foreign native_display?
71     guint               use_xrandr              : 1;
72     guint               synchronous             : 1;
73 };
74
75 /**
76  * GstVaapiDisplayX11:
77  *
78  * VA/X11 display wrapper.
79  */
80 struct _GstVaapiDisplayX11 {
81     /*< private >*/
82     GstVaapiDisplay parent_instance;
83
84     GstVaapiDisplayX11Private priv;
85 };
86
87 /**
88  * GstVaapiDisplayX11Class:
89  *
90  * VA/X11 display wrapper clas.
91  */
92 struct _GstVaapiDisplayX11Class {
93     /*< private >*/
94     GstVaapiDisplayClass parent_class;
95 };
96
97 void
98 gst_vaapi_display_x11_class_init(GstVaapiDisplayX11Class *klass);
99
100 G_END_DECLS
101
102 #endif /* GST_VAAPI_DISPLAY_X11_PRIV_H */