Merge branch 'move_subdir_editing-services' into tizen_gst_1.19.2_mono
[platform/upstream/gstreamer.git] / subprojects / gstreamer-vaapi / 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  *    Author: Gwenole Beauchesne <gwenole.beauchesne@splitted-desktop.com>
6  *  Copyright (C) 2012-2013 Intel Corporation
7  *    Author: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
8  *
9  *  This library is free software; you can redistribute it and/or
10  *  modify it under the terms of the GNU Lesser General Public License
11  *  as published by the Free Software Foundation; either version 2.1
12  *  of the License, or (at your option) any later version.
13  *
14  *  This library is distributed in the hope that it will be useful,
15  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  *  Lesser General Public License for more details.
18  *
19  *  You should have received a copy of the GNU Lesser General Public
20  *  License along with this library; if not, write to the Free
21  *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22  *  Boston, MA 02110-1301 USA
23  */
24
25 #ifndef GST_VAAPI_DISPLAY_X11_PRIV_H
26 #define GST_VAAPI_DISPLAY_X11_PRIV_H
27
28 #include <gst/vaapi/gstvaapiutils_x11.h>
29 #include <gst/vaapi/gstvaapidisplay_x11.h>
30 #include "gstvaapidisplay_priv.h"
31
32 G_BEGIN_DECLS
33
34 #define GST_VAAPI_IS_DISPLAY_X11(display) \
35     (G_TYPE_CHECK_INSTANCE_TYPE ((display), GST_TYPE_VAAPI_DISPLAY_X11))
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 #define GST_VAAPI_DISPLAY_X11_GET_CLASS(obj) \
44     (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VAAPI_DISPLAY_X11, GstVaapiDisplayX11Class))
45
46 typedef struct _GstVaapiDisplayX11Private       GstVaapiDisplayX11Private;
47 typedef struct _GstVaapiDisplayX11Class         GstVaapiDisplayX11Class;
48
49 /**
50  * GST_VAAPI_DISPLAY_XDISPLAY:
51  * @display: a #GstVaapiDisplay
52  *
53  * Macro that evaluates to the underlying X11 #Display of @display
54  */
55 #undef  GST_VAAPI_DISPLAY_XDISPLAY
56 #define GST_VAAPI_DISPLAY_XDISPLAY(display) \
57     GST_VAAPI_DISPLAY_X11_PRIVATE(display)->x11_display
58
59 /**
60  * GST_VAAPI_DISPLAY_XSCREEN:
61  * @display: a #GstVaapiDisplay
62  *
63  * Macro that evaluates to the underlying X11 screen of @display
64  */
65 #undef  GST_VAAPI_DISPLAY_XSCREEN
66 #define GST_VAAPI_DISPLAY_XSCREEN(display) \
67     GST_VAAPI_DISPLAY_X11_PRIVATE(display)->x11_screen
68
69 struct _GstVaapiDisplayX11Private
70 {
71   gchar *display_name;
72   Display *x11_display;
73   int x11_screen;
74   GArray *pixmap_formats;
75   guint use_foreign_display:1;  // Foreign native_display?
76   guint use_xrandr:1;
77   guint synchronous:1;
78 };
79
80 /**
81  * GstVaapiDisplayX11:
82  *
83  * VA/X11 display wrapper.
84  */
85 struct _GstVaapiDisplayX11
86 {
87   /*< private >*/
88   GstVaapiDisplay parent_instance;
89
90   GstVaapiDisplayX11Private *priv;
91 };
92
93 /**
94  * GstVaapiDisplayX11Class:
95  *
96  * VA/X11 display wrapper class.
97  */
98 struct _GstVaapiDisplayX11Class
99 {
100   /*< private >*/
101   GstVaapiDisplayClass parent_class;
102 };
103
104 G_GNUC_INTERNAL
105 GstVideoFormat
106 gst_vaapi_display_x11_get_pixmap_format (GstVaapiDisplayX11 * display,
107     guint depth);
108
109 G_GNUC_INTERNAL
110 guint
111 gst_vaapi_display_x11_get_pixmap_depth (GstVaapiDisplayX11 * display,
112     GstVideoFormat format);
113
114 G_END_DECLS
115
116 #endif /* GST_VAAPI_DISPLAY_X11_PRIV_H */