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., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, 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 _GstXImageMeta GstXImageMeta;
44 typedef struct _GstXImageBufferPool GstXImageBufferPool;
45 typedef struct _GstXImageBufferPoolClass GstXImageBufferPoolClass;
46 typedef struct _GstXImageBufferPoolPrivate GstXImageBufferPoolPrivate;
48 #include "ximagesink.h"
49 GType gst_ximage_meta_api_get_type (void);
50 #define GST_XIMAGE_META_API_TYPE (gst_ximage_meta_api_get_type())
51 const GstMetaInfo * gst_ximage_meta_get_info (void);
52 #define GST_XIMAGE_META_INFO (gst_ximage_meta_get_info())
54 #define gst_buffer_get_ximage_meta(b) ((GstXImageMeta*)gst_buffer_get_meta((b),GST_XIMAGE_META_API_TYPE))
58 * @simagesink: a reference to the our #GstXImageSink
59 * @ximage: the XImage of this buffer
60 * @width: the width in pixels of XImage @ximage
61 * @height: the height in pixels of XImage @ximage
62 * @size: the size in bytes of XImage @ximage
64 * Subclass of #GstMeta containing additional information about an XImage.
70 /* Reference to the ximagesink we belong to */
76 XShmSegmentInfo SHMInfo;
77 #endif /* HAVE_XSHM */
84 /* buffer pool functions */
85 #define GST_TYPE_XIMAGE_BUFFER_POOL (gst_ximage_buffer_pool_get_type())
86 #define GST_IS_XIMAGE_BUFFER_POOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_XIMAGE_BUFFER_POOL))
87 #define GST_XIMAGE_BUFFER_POOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_XIMAGE_BUFFER_POOL, GstXImageBufferPool))
88 #define GST_XIMAGE_BUFFER_POOL_CAST(obj) ((GstXImageBufferPool*)(obj))
90 struct _GstXImageBufferPool
92 GstBufferPool bufferpool;
96 GstXImageBufferPoolPrivate *priv;
99 struct _GstXImageBufferPoolClass
101 GstBufferPoolClass parent_class;
104 GType gst_ximage_buffer_pool_get_type (void);
106 GstBufferPool * gst_ximage_buffer_pool_new (GstXImageSink * ximagesink);
108 gboolean gst_ximagesink_check_xshm_calls (GstXImageSink * ximagesink,
109 GstXContext * xcontext);
113 #endif /* __GST_XIMAGEPOOL_H__ */