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

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Thu Aug 15 12:08:07 PDT 2013


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

           Summary: UVC Allocated buffers wrapped in GstBuffer get
                    orphaned by GstBuffer API
    Classification: Platform
           Product: GStreamer
           Version: git
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: major
          Priority: Normal
         Component: gst-plugins-good
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: rob.krakora at messagenetsystems.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


Created an attachment (id=251764)
 View: https://bugzilla.gnome.org/attachment.cgi?id=251764
 Review: https://bugzilla.gnome.org/review?bug=706083&attachment=251764

Fix for orphaned UVC driver allocated buffers in v4l2src...

So, I was able to "fix" an issue with v4l2src UVC driver allocated buffers
being replaced (orphaned) by the GstBuffer API (gst_buffer_resize() for
example) with the patch below which "puts back" the UVC driver allocated
buffers to the GstBuffers in which they were initially placed when allocated
and wrapped in a GstMemory object.

diff -rupN gst-plugins-good-1.1.3/sys/v4l2/gstv4l2bufferpool.c
gst-plugins-good-1.1.3.new/sys/v4l2/gstv4l2bufferpool.c
--- gst-plugins-good-1.1.3/sys/v4l2/gstv4l2bufferpool.c    2013-07-08
10:27:16.000000000 -0400
+++ gst-plugins-good-1.1.3.new/sys/v4l2/gstv4l2bufferpool.c    2013-08-14
17:21:42.801320440 -0400
@@ -678,6 +678,12 @@ gst_v4l2_buffer_pool_qbuf (GstV4l2Buffer
   if (v4l2_ioctl (pool->video_fd, VIDIOC_QBUF, &meta->vbuffer) < 0)
     goto queue_failed;

+  /* Memory may have been replaced in GstBuffer so put it back using meta
cookie */
+  gst_buffer_replace_memory (buf, 0,
+    gst_memory_new_wrapped (GST_MEMORY_FLAG_NO_SHARE,
+        meta->mem, meta->vbuffer.length, 0, meta->vbuffer.length, NULL,
+        NULL));
+
   pool->buffers[index] = buf;
   pool->num_queued++;

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