/* Helper functions */
#include <gst/video/video.h>
-#include <gst/video/gstmetavideo.h>
+#include <gst/video/gstvideometa.h>
#include <gst/video/gstvideopool.h>
GST_DEBUG_CATEGORY_EXTERN (gst_debug_ximagepool);
gboolean need_alignment;
};
-static void gst_meta_ximage_free (GstMetaXImage * meta, GstBuffer * buffer);
+static void gst_ximage_meta_free (GstXImageMeta * meta, GstBuffer * buffer);
/* ximage metadata */
const GstMetaInfo *
-gst_meta_ximage_get_info (void)
+gst_ximage_meta_get_info (void)
{
- static const GstMetaInfo *meta_ximage_info = NULL;
+ static const GstMetaInfo *ximage_meta_info = NULL;
- if (meta_ximage_info == NULL) {
- meta_ximage_info = gst_meta_register ("GstMetaXImage", "GstMetaXImage",
- sizeof (GstMetaXImage),
+ if (ximage_meta_info == NULL) {
+ ximage_meta_info = gst_meta_register ("GstXImageMeta", "GstXImageMeta",
+ sizeof (GstXImageMeta),
(GstMetaInitFunction) NULL,
- (GstMetaFreeFunction) gst_meta_ximage_free,
+ (GstMetaFreeFunction) gst_ximage_meta_free,
(GstMetaCopyFunction) NULL, (GstMetaTransformFunction) NULL);
}
- return meta_ximage_info;
+ return ximage_meta_info;
}
/* X11 stuff */
return 0;
}
-static GstMetaXImage *
-gst_buffer_add_meta_ximage (GstBuffer * buffer, GstXImageBufferPool * xpool)
+static GstXImageMeta *
+gst_buffer_add_ximage_meta (GstBuffer * buffer, GstXImageBufferPool * xpool)
{
GstXImageSink *ximagesink;
int (*handler) (Display *, XErrorEvent *);
gboolean success = FALSE;
GstXContext *xcontext;
- GstMetaXImage *meta;
+ GstXImageMeta *meta;
gint width, height;
GstXImageBufferPoolPrivate *priv;
height = priv->padded_height;
meta =
- (GstMetaXImage *) gst_buffer_add_meta (buffer, GST_META_INFO_XIMAGE,
+ (GstXImageMeta *) gst_buffer_add_meta (buffer, GST_XIMAGE_META_INFO,
NULL);
#ifdef HAVE_XSHM
meta->SHMInfo.shmaddr = ((void *) -1);
}
static void
-gst_meta_ximage_free (GstMetaXImage * meta, GstBuffer * buffer)
+gst_ximage_meta_free (GstXImageMeta * meta, GstBuffer * buffer)
{
GstXImageSink *ximagesink;
static const gchar **
ximage_buffer_pool_get_options (GstBufferPool * pool)
{
- static const gchar *options[] = { GST_BUFFER_POOL_OPTION_META_VIDEO,
+ static const gchar *options[] = { GST_BUFFER_POOL_OPTION_VIDEO_META,
GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT, NULL
};
/* check for the configured metadata */
priv->add_metavideo =
gst_buffer_pool_config_has_option (config,
- GST_BUFFER_POOL_OPTION_META_VIDEO);
+ GST_BUFFER_POOL_OPTION_VIDEO_META);
/* parse extra alignment info */
priv->need_alignment = gst_buffer_pool_config_has_option (config,
/* we need the video metadata too now */
priv->add_metavideo = TRUE;
+ } else {
+ gst_video_alignment_reset (&priv->align);
}
/* add the padding */
GstXImageBufferPoolPrivate *priv = xpool->priv;
GstVideoInfo *info;
GstBuffer *ximage;
- GstMetaXImage *meta;
+ GstXImageMeta *meta;
info = &priv->info;
ximage = gst_buffer_new ();
- meta = gst_buffer_add_meta_ximage (ximage, xpool);
+ meta = gst_buffer_add_ximage_meta (ximage, xpool);
if (meta == NULL) {
gst_buffer_unref (ximage);
goto no_buffer;
}
if (priv->add_metavideo) {
- GstMetaVideo *meta;
+ GstVideoMeta *meta;
- GST_DEBUG_OBJECT (pool, "adding GstMetaVideo");
+ GST_DEBUG_OBJECT (pool, "adding GstVideoMeta");
/* these are just the defaults for now */
- meta = gst_buffer_add_meta_video (ximage, 0, GST_VIDEO_INFO_FORMAT (info),
+ meta = gst_buffer_add_video_meta (ximage, 0, GST_VIDEO_INFO_FORMAT (info),
priv->padded_width, priv->padded_height);
if (priv->need_alignment) {
}
}
-static void
-ximage_buffer_pool_free (GstBufferPool * pool, GstBuffer * buffer)
-{
- gst_buffer_unref (buffer);
-}
-
GstBufferPool *
gst_ximage_buffer_pool_new (GstXImageSink * ximagesink)
{
gstbufferpool_class->get_options = ximage_buffer_pool_get_options;
gstbufferpool_class->set_config = ximage_buffer_pool_set_config;
gstbufferpool_class->alloc_buffer = ximage_buffer_pool_alloc;
- gstbufferpool_class->free_buffer = ximage_buffer_pool_free;
}
static void