2 * Copyright (C) <2005> Julien Moutte <julien@moutte.net>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
20 #ifndef __GST_XIMAGEPOOL_H__
21 #define __GST_XIMAGEPOOL_H__
24 #include <sys/types.h>
27 #endif /* HAVE_XSHM */
30 #include <X11/Xutil.h>
33 #include <X11/extensions/XShm.h>
34 #endif /* HAVE_XSHM */
42 typedef struct _GstXImageMemory GstXImageMemory;
44 typedef struct _GstXImageBufferPool GstXImageBufferPool;
45 typedef struct _GstXImageBufferPoolClass GstXImageBufferPoolClass;
46 typedef struct _GstXImageBufferPoolPrivate GstXImageBufferPoolPrivate;
48 #include "ximagesink.h"
52 * @sink: a reference to the our #GstXImageSink
53 * @ximage: the XImage of this buffer
54 * @width: the width in pixels of XImage @ximage
55 * @height: the height in pixels of XImage @ximage
56 * @size: the size in bytes of XImage @ximage
58 * Subclass of #GstMemory containing additional information about an XImage.
60 struct _GstXImageMemory
64 /* Reference to the ximagesink we belong to */
70 XShmSegmentInfo SHMInfo;
71 #endif /* HAVE_XSHM */
78 /* buffer pool functions */
79 #define GST_TYPE_XIMAGE_BUFFER_POOL (gst_ximage_buffer_pool_get_type())
80 #define GST_IS_XIMAGE_BUFFER_POOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_XIMAGE_BUFFER_POOL))
81 #define GST_XIMAGE_BUFFER_POOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_XIMAGE_BUFFER_POOL, GstXImageBufferPool))
82 #define GST_XIMAGE_BUFFER_POOL_CAST(obj) ((GstXImageBufferPool*)(obj))
84 struct _GstXImageBufferPool
86 GstBufferPool bufferpool;
89 GstAllocator *allocator;
91 GstXImageBufferPoolPrivate *priv;
94 struct _GstXImageBufferPoolClass
96 GstBufferPoolClass parent_class;
99 GType gst_ximage_buffer_pool_get_type (void);
101 GstBufferPool * gst_ximage_buffer_pool_new (GstXImageSink * ximagesink);
103 gboolean gst_ximagesink_check_xshm_calls (GstXImageSink * ximagesink,
104 GstXContext * xcontext);
108 #endif /* __GST_XIMAGEPOOL_H__ */