diff --git a/gst-libs/gst/codecparsers/gstmpegvideometa.c b/gst-libs/gst/codecparsers/gstmpegvideometa.c index 7f5926f291..f7b2f87e75 100644 --- a/gst-libs/gst/codecparsers/gstmpegvideometa.c +++ b/gst-libs/gst/codecparsers/gstmpegvideometa.c @@ -60,6 +60,38 @@ gst_mpeg_video_meta_free (GstMpegVideoMeta * mpeg_video_meta, g_slice_free (GstMpegVideoQuantMatrixExt, mpeg_video_meta->quantext); } +static gboolean +gst_mpeg_video_meta_transform (GstBuffer * dest, GstMeta * meta, + GstBuffer * buffer, GQuark type, gpointer data) +{ + GstMpegVideoMeta *smeta, *dmeta; + + smeta = (GstMpegVideoMeta *) meta; + + if (GST_META_TRANSFORM_IS_COPY (type)) { + GstMetaTransformCopy *copy = data; + + if (!copy->region) { + /* only copy if the complete data is copied as well */ + dmeta = + gst_buffer_add_mpeg_video_meta (dest, smeta->sequencehdr, + smeta->sequenceext, smeta->sequencedispext, smeta->pichdr, + smeta->picext, smeta->quantext); + + if (!dmeta) + return FALSE; + + dmeta->num_slices = smeta->num_slices; + dmeta->slice_offset = smeta->slice_offset; + } + } else { + /* return FALSE, if transform type is not supported */ + return FALSE; + } + + return TRUE; +} + GType gst_mpeg_video_meta_api_get_type (void) { @@ -86,7 +118,7 @@ gst_mpeg_video_meta_get_info (void) "GstMpegVideoMeta", sizeof (GstMpegVideoMeta), (GstMetaInitFunction) gst_mpeg_video_meta_init, (GstMetaFreeFunction) gst_mpeg_video_meta_free, - (GstMetaTransformFunction) NULL); + (GstMetaTransformFunction) gst_mpeg_video_meta_transform); g_once_init_leave (&mpeg_video_meta_info, meta); }