diff --git a/gst-libs/gst/netbuffer/gstnetbuffer.c b/gst-libs/gst/netbuffer/gstnetbuffer.c index 9e1a6afad6..5c625532ed 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 5cc3ef1342..044ccd2f69 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 3e7f7773b8..159b0e307c 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 fc282837bb..1db6bc8ed5 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;