x11: implement pixmap API.
[platform/upstream/gstreamer-vaapi.git] / gst-libs / gst / vaapi / gstvaapipixmap_x11.h
1 /*
2  *  gstvaapipixmap_x11.h - X11 pixmap abstraction
3  *
4  *  Copyright (C) 2013 Intel Corporation
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_PIXMAP_X11_H
23 #define GST_VAAPI_PIXMAP_X11_H
24
25 #include <X11/Xlib.h>
26 #include <gst/vaapi/gstvaapidisplay.h>
27 #include <gst/vaapi/gstvaapipixmap.h>
28
29 G_BEGIN_DECLS
30
31 #define GST_VAAPI_PIXMAP_X11(obj) \
32     ((GstVaapiPixmapX11 *)(obj))
33
34 /**
35  * GST_VAAPI_PIXMAP_XPIXMAP:
36  * @pixmap: a #GstVaapiPixmap
37  *
38  * Macro that evaluates to the underlying X11 #Pixmap of @pixmap
39  */
40 #define GST_VAAPI_PIXMAP_XPIXMAP(pixmap) \
41     gst_vaapi_pixmap_x11_get_xid(GST_VAAPI_PIXMAP_X11(pixmap))
42
43 typedef struct _GstVaapiPixmapX11               GstVaapiPixmapX11;
44
45 GstVaapiPixmap *
46 gst_vaapi_pixmap_x11_new(GstVaapiDisplay *display, GstVideoFormat format,
47     guint width, guint height);
48
49 GstVaapiPixmap *
50 gst_vaapi_pixmap_x11_new_with_xid(GstVaapiDisplay *display, Pixmap xid);
51
52 Pixmap
53 gst_vaapi_pixmap_x11_get_xid(GstVaapiPixmapX11 *pixmap);
54
55 gboolean
56 gst_vaapi_pixmap_x11_is_foreign_xid(GstVaapiPixmapX11 *pixmap);
57
58 G_END_DECLS
59
60 #endif /* GST_VAAPI_PIXMAP_X11_H */