[Bug 699517] uvch264src: v4l2src delivered buffer from C920 camera to uvch264src corrupt?

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Sat Aug 10 18:21:50 PDT 2013


https://bugzilla.gnome.org/show_bug.cgi?id=699517
  GStreamer | gst-plugins-bad | 1.1.2

--- Comment #21 from Robert Krakora <rob.krakora at messagenetsystems.com> 2013-08-11 01:21:32 UTC ---
I found the problem.  In v4l2src, four buffers are acquired from the UVC
driver, and each is mapped to user space and each wrapped in a GstMemory object
which is then appended to a GstBuffer.  However, in v4l2src gst_buffer_resize()
can be called on a GstBuffer and this function allocates a new GstMemory object
with an appropriately sized data area and copies the contents of the current
GstMemory object's data area in to it.  The old GstMemory object with a data
area comprised of one of the four buffers previously acquired from the UVC
driver is then replaced by the new GstMemory object whose data area was
allocated in user space of which the UVC has no knowledge.  The replaced
GstMemory object is unreferenced (deallocated) and the UVC driver buffer is
orphaned and it's lights out for the pipeline.  I was able to hack a fix by
removing the to instances of gst_buffer_resize() and placing the real size from
vbuffer.bytesused in the GstBuffer metadata in v4l2src and then retrieving it
from the GstBuffer metadata in uvch264src.  I cannot think of a proper way to
fix this right now.

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