From f246c0e97d434262f8f59063b0cc6da43900c4fd Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 8 Mar 2011 17:01:41 +0000 Subject: [PATCH] meta: update for new API --- gst-libs/gst/netbuffer/gstnetbuffer.c | 34 +++++++++++++--------------------- sys/v4l/v4lsrc_calls.c | 3 +-- sys/ximage/ximagepool.c | 3 +-- sys/xvimage/xvimagesink.c | 3 +-- 4 files changed, 16 insertions(+), 27 deletions(-) diff --git a/gst-libs/gst/netbuffer/gstnetbuffer.c b/gst-libs/gst/netbuffer/gstnetbuffer.c index 9e1a6af..5c62553 100644 --- a/gst-libs/gst/netbuffer/gstnetbuffer.c +++ b/gst-libs/gst/netbuffer/gstnetbuffer.c @@ -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); - memcpy (&naddr->naddr, &meta->naddr, sizeof (meta->naddr)); + 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; diff --git a/sys/v4l/v4lsrc_calls.c b/sys/v4l/v4lsrc_calls.c index 5cc3ef1..044ccd2 100644 --- a/sys/v4l/v4lsrc_calls.c +++ b/sys/v4l/v4lsrc_calls.c @@ -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; diff --git a/sys/ximage/ximagepool.c b/sys/ximage/ximagepool.c index 3e7f777..159b0e3 100644 --- a/sys/ximage/ximagepool.c +++ b/sys/ximage/ximagepool.c @@ -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; diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index fc28283..1db6bc8 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -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; -- 2.7.4