meta: update for new API

This commit is contained in:
Wim Taymans 2011-03-08 17:01:41 +00:00
parent 92f9995d98
commit f246c0e97d
4 changed files with 16 additions and 27 deletions

View file

@ -35,28 +35,21 @@
#include "gstnetbuffer.h"
static void
meta_net_address_copy (GstBuffer * copy, GstMetaNetAddress * meta,
GstBuffer * buffer)
meta_net_address_transform (GstBuffer * transbuf, GstMetaNetAddress * meta,
GstBuffer * buffer, GstMetaTransformData * data)
{
GstMetaNetAddress *naddr;
GST_DEBUG ("copy called from buffer %p to %p, meta %p", buffer, copy, meta);
naddr = gst_buffer_add_meta_net_address (copy);
memcpy (&naddr->naddr, &meta->naddr, sizeof (meta->naddr));
}
static void
meta_net_address_sub (GstBuffer * sub, GstMetaNetAddress * meta,
GstBuffer * buffer, guint offset, guint size)
{
GstMetaNetAddress *naddr;
GST_DEBUG ("sub called from buffer %p to %p, meta %p, %u-%u", buffer, sub,
meta, offset, size);
naddr = gst_buffer_add_meta_net_address (sub);
switch (data->type) {
case GST_META_TRANSFORM_TRIM:
case GST_META_TRANSFORM_MAKE_WRITABLE:
case GST_META_TRANSFORM_COPY:
default:
/* always copy */
naddr = gst_buffer_add_meta_net_address (transbuf);
memcpy (&naddr->naddr, &meta->naddr, sizeof (meta->naddr));
break;
}
}
const GstMetaInfo *
@ -69,8 +62,7 @@ gst_meta_net_address_get_info (void)
sizeof (GstMetaNetAddress),
(GstMetaInitFunction) NULL,
(GstMetaFreeFunction) NULL,
(GstMetaCopyFunction) meta_net_address_copy,
(GstMetaSubFunction) meta_net_address_sub,
(GstMetaTransformFunction) meta_net_address_transform,
(GstMetaSerializeFunction) NULL, (GstMetaDeserializeFunction) NULL);
}
return meta_info;

View file

@ -657,8 +657,7 @@ gst_meta_v4lsrc_get_info (void)
sizeof (GstMetaV4lSrc),
(GstMetaInitFunction) NULL,
(GstMetaFreeFunction) meta_v4lsrc_free,
(GstMetaCopyFunction) NULL,
(GstMetaSubFunction) NULL,
(GstMetaTransformFunction) NULL,
(GstMetaSerializeFunction) NULL, (GstMetaDeserializeFunction) NULL);
}
return meta_v4lsrc_info;

View file

@ -43,8 +43,7 @@ gst_meta_ximage_get_info (void)
sizeof (GstMetaXImage),
(GstMetaInitFunction) NULL,
(GstMetaFreeFunction) gst_meta_ximage_free,
(GstMetaCopyFunction) NULL,
(GstMetaSubFunction) NULL,
(GstMetaTransformFunction) NULL,
(GstMetaSerializeFunction) NULL, (GstMetaDeserializeFunction) NULL);
}
return meta_ximage_info;

View file

@ -208,8 +208,7 @@ gst_meta_xvimage_get_info (void)
sizeof (GstMetaXvImage),
(GstMetaInitFunction) NULL,
(GstMetaFreeFunction) NULL,
(GstMetaCopyFunction) NULL,
(GstMetaSubFunction) NULL,
(GstMetaTransformFunction) NULL,
(GstMetaSerializeFunction) NULL, (GstMetaDeserializeFunction) NULL);
}
return meta_xvimage_info;