[Bug 738013] v4l2allocator: issue with import_userptr() in single-planar API when n_planes > 1

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Mon Jan 26 01:23:13 PST 2015


https://bugzilla.gnome.org/show_bug.cgi?id=738013
  GStreamer | gst-plugins-good | git master

--- Comment #16 from Aurélien Zanelli <aurelien.zanelli at parrot.com> 2015-01-26 09:23:07 UTC ---
(In reply to comment #15)
> Review of attachment 295289 [details]:
> 
> ::: sys/v4l2/gstv4l2bufferpool.c
> @@ +258,3 @@
> +            pix_fmt->bytesperline);
> +        guint eheight = GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT (finfo, i,
> +            pix_fmt->height);
> 
> I'm wondering if we could use a simplier check.
> 
> if (!V4L2_TYPE_IS_MULTIPLANAR (pool->obj->type)) {
>   if (gst_buffer_n_memory (buffer) != 1)
>     goto non_contiguous_mem;
> 
>   /* TODO check all strides */
>   if (stride[0] != pix_fmt->bytesperline)
>     goto not_aligned;
> 
> Would do you think ?

If there are more than 1 memory, I think we can safely assume that memory won't
be contiguous, otherwise we are lucky.

However checking the stride is not enough, since we could have padding at the
bottom and in this case, plane are not contiguous. As a result, we will have
padding pixel displayed as chroma sample in YUV.
Hence we should check that planes have the expected size. But currently, if I'm
right, we have to deal with data pointer or frame offset calculate them in
order to know if there is padding or not.

Maybe , the 'simpler/generic' way should be to let element know about padding
by adding VideoAlignment information to VideoInfo, but there might be a good
reason to not do so ?

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list