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_XVIMAGEPOOL_H__
21 #define __GST_XVIMAGEPOOL_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 _GstMetaXvImage GstMetaXvImage;
44 typedef struct _GstXvImageBufferPool GstXvImageBufferPool;
45 typedef struct _GstXvImageBufferPoolClass GstXvImageBufferPoolClass;
46 typedef struct _GstXvImageBufferPoolPrivate GstXvImageBufferPoolPrivate;
48 #include "xvimagesink.h"
50 const GstMetaInfo * gst_meta_xvimage_get_info (void);
51 #define GST_META_INFO_XVIMAGE (gst_meta_xvimage_get_info())
53 #define gst_buffer_get_meta_xvimage(b) ((GstMetaXvImage*)gst_buffer_get_meta((b),GST_META_INFO_XVIMAGE))
57 * @sink: a reference to the our #GstXvImageSink
58 * @xvimage: the XvImage of this buffer
59 * @width: the width in pixels of XvImage @xvimage
60 * @height: the height in pixels of XvImage @xvimage
61 * @im_format: the format of XvImage @xvimage
62 * @size: the size in bytes of XvImage @xvimage
64 * Subclass of #GstMeta containing additional information about an XvImage.
66 struct _GstMetaXvImage
70 /* Reference to the xvimagesink we belong to */
76 XShmSegmentInfo SHMInfo;
77 #endif /* HAVE_XSHM */
85 /* buffer pool functions */
86 #define GST_TYPE_XVIMAGE_BUFFER_POOL (gst_xvimage_buffer_pool_get_type())
87 #define GST_IS_XVIMAGE_BUFFER_POOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_XVIMAGE_BUFFER_POOL))
88 #define GST_XVIMAGE_BUFFER_POOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_XVIMAGE_BUFFER_POOL, GstXvImageBufferPool))
89 #define GST_XVIMAGE_BUFFER_POOL_CAST(obj) ((GstXvImageBufferPool*)(obj))
91 struct _GstXvImageBufferPool
93 GstBufferPool bufferpool;
97 GstXvImageBufferPoolPrivate *priv;
100 struct _GstXvImageBufferPoolClass
102 GstBufferPoolClass parent_class;
105 GType gst_xvimage_buffer_pool_get_type (void);
107 GstBufferPool *gst_xvimage_buffer_pool_new (GstXvImageSink * xvimagesink);
109 gboolean gst_xvimagesink_check_xshm_calls (GstXvImageSink * xvimagesink,
110 GstXContext * xcontext);
112 gint gst_xvimagesink_get_format_from_info (GstXvImageSink * xvimagesink,
113 GstVideoInfo * info);
117 #endif /*__GST_XVIMAGEPOOL_H__*/