After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 706069 - UVC Allocated buffers wrapped in GstBuffer get orphaned by GstBuffer API
UVC Allocated buffers wrapped in GstBuffer get orphaned by GstBuffer API
Status: RESOLVED DUPLICATE of bug 706083
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.1.3
Other Linux
: Normal major
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-08-15 13:22 UTC by Robert Krakora
Modified: 2013-08-19 08:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix for orphaned UVC driver allocated buffers in v4l2src... (790 bytes, patch)
2013-08-15 13:22 UTC, Robert Krakora
none Details | Review
Fix for orphaned UVC driver allocated buffers in v4l2src... (3.69 KB, patch)
2013-08-16 22:12 UTC, Robert Krakora
rejected Details | Review

Description Robert Krakora 2013-08-15 13:22:47 UTC
Created attachment 251735 [details] [review]
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++;
Comment 1 Tim-Philipp Müller 2013-08-15 19:18:54 UTC

*** This bug has been marked as a duplicate of bug 706083 ***
Comment 2 Robert Krakora 2013-08-16 22:12:42 UTC
Created attachment 251956 [details] [review]
Fix for orphaned UVC driver allocated buffers in v4l2src...