[Bug 706083] v4l2src: UVC Allocated buffers wrapped in GstBuffer get orphaned by GstBuffer API

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Wed Sep 18 16:41:53 PDT 2013


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

--- Comment #16 from Olivier Crete (Tester) <olivier.crete at ocrete.ca> 2013-09-18 23:41:49 UTC ---
Any chance you can provide an updated patch ?

(In reply to comment #15)
> Review of attachment 252279 [details]:
> @@ +775,3 @@
> +        gst_memory_new_wrapped (GST_MEMORY_FLAG_NO_SHARE,
> +            meta->mem, vbuffer.bytesused, 0, vbuffer.bytesused, NULL,
> +            NULL));
> 
> This resizes without replacing the dequeued buffer as does gst_buffer_resize().
>  I believe that there is work underway to prevent the replacement of wrapped
> memory by the GstBuffer class.  This is a temporary workaround.
> 
> @@ +894,3 @@
> 
> +            /* copy the buffer with memory, but not the meta data */
> +            copy = gst_buffer_copy_region (*buffer, GST_BUFFER_COPY_MEMORY, 0,
> -1);
> 
> Trying to be efficient...gst_buffer_copy() can be used instead as it was in the
> original source.

actually, gst_buffer_copy() won't do as it doesn't make a copy of the actual
memory, you do want GST_BUFFER_COPY_DEEP

> * To efficiently create a smaller buffer out of an existing one, you can
>  * use gst_buffer_copy_region(). This method tries to share the memory objects
>  * between the two buffers.

You don't want to share the memory, as the next step is to give it back to the
driver.

> @@ +1006,3 @@
> +                gst_memory_new_wrapped (GST_MEMORY_FLAG_NO_SHARE,
> +                    meta->mem, meta->vbuffer.length, 0, meta->vbuffer.length,
> NULL,
> +                    NULL));
> 
> This resizes without replacing the dequeued buffer as does gst_buffer_resize().
>  I believe that there is work underway to prevent the replacement of wrapped
> memory by the GstBuffer class.  This is a temporary workaround.

I also think that's the correct workaround as I don't think the rework in bug
#707534 can land in time for 1.2

-- 
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