From 61e84bc4357dd9d54a9029362003e7860008329f Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 12 Nov 2014 09:57:38 +0100 Subject: [PATCH] video-converter: take offset into account when unpacking When we can directly take the input line from the source frame when unpacking, also take into account the x offset. --- gst-libs/gst/video/video-converter.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/video/video-converter.c b/gst-libs/gst/video/video-converter.c index 4f66fee592..c1487ca12a 100644 --- a/gst-libs/gst/video/video-converter.c +++ b/gst-libs/gst/video/video-converter.c @@ -171,6 +171,7 @@ struct _GstVideoConverter GstVideoScaler *v_scaler; gint v_scale_width; gint v_scale_format; + gint unpack_pstride; gint pack_pstride; const GstVideoFrame *src; @@ -389,6 +390,7 @@ chain_unpack_line (GstVideoConverter * convert) convert->current_format = convert->in_info.finfo->unpack_format; convert->current_pstride = convert->in_bits >> 1; + convert->unpack_pstride = convert->current_pstride; convert->identity_unpack = (convert->current_format == convert->in_info.finfo->format); @@ -1456,7 +1458,8 @@ do_unpack_lines (GstLineCache * cache, gint out_line, gint in_line, convert->in_width); } else { GST_DEBUG ("get src line %d (%u)", in_line, cline); - tmpline = FRAME_GET_LINE (convert->src, cline); + tmpline = ((guint8 *) FRAME_GET_LINE (convert->src, cline)) + + convert->in_x * convert->unpack_pstride; } gst_line_cache_add_line (cache, in_line, tmpline);