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_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 _GstXvImageMeta GstXvImageMeta;
44 typedef struct _GstXvImageBufferPool GstXvImageBufferPool;
45 typedef struct _GstXvImageBufferPoolClass GstXvImageBufferPoolClass;
46 typedef struct _GstXvImageBufferPoolPrivate GstXvImageBufferPoolPrivate;
48 #include "xvimagesink.h"
50 GType gst_xvimage_meta_api_get_type (void);
51 #define GST_XVIMAGE_META_API_TYPE (gst_xvimage_meta_api_get_type())
52 const GstMetaInfo * gst_xvimage_meta_get_info (void);
53 #define GST_XVIMAGE_META_INFO (gst_xvimage_meta_get_info())
55 #define gst_buffer_get_xvimage_meta(b) ((GstXvImageMeta*)gst_buffer_get_meta((b),GST_XVIMAGE_META_API_TYPE))
59 * @sink: a reference to the our #GstXvImageSink
60 * @xvimage: the XvImage of this buffer
61 * @width: the width in pixels of XvImage @xvimage
62 * @height: the height in pixels of XvImage @xvimage
63 * @im_format: the format of XvImage @xvimage
64 * @size: the size in bytes of XvImage @xvimage
66 * Subclass of #GstMeta containing additional information about an XvImage.
68 struct _GstXvImageMeta
72 /* Reference to the xvimagesink we belong to */
78 XShmSegmentInfo SHMInfo;
79 #endif /* HAVE_XSHM */
87 /* buffer pool functions */
88 #define GST_TYPE_XVIMAGE_BUFFER_POOL (gst_xvimage_buffer_pool_get_type())
89 #define GST_IS_XVIMAGE_BUFFER_POOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_XVIMAGE_BUFFER_POOL))
90 #define GST_XVIMAGE_BUFFER_POOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_XVIMAGE_BUFFER_POOL, GstXvImageBufferPool))
91 #define GST_XVIMAGE_BUFFER_POOL_CAST(obj) ((GstXvImageBufferPool*)(obj))
93 struct _GstXvImageBufferPool
95 GstBufferPool bufferpool;
99 GstXvImageBufferPoolPrivate *priv;
102 struct _GstXvImageBufferPoolClass
104 GstBufferPoolClass parent_class;
107 GType gst_xvimage_buffer_pool_get_type (void);
109 GstBufferPool *gst_xvimage_buffer_pool_new (GstXvImageSink * xvimagesink);
111 gboolean gst_xvimagesink_check_xshm_calls (GstXvImageSink * xvimagesink,
112 GstXContext * xcontext);
114 gint gst_xvimagesink_get_format_from_info (GstXvImageSink * xvimagesink,
115 GstVideoInfo * info);
119 #endif /*__GST_XVIMAGEPOOL_H__*/