[gst-devel] Failed to free the memory allocated by gst_pad_alloc_buffer_and_set_caps()

Arnout Vandecappelle arnout at mind.be
Thu Aug 5 18:35:27 CEST 2010


 I seem to remember I posted patches for v4l2src to support 
V4L2_MEMORY_USERPTR.  You could look at these to see how to handle the 
situation.  Check out https://bugzilla.gnome.org/show_bug.cgi?id=583890

 In the pipeline you gave, the buffer will be allocated by the 
ffmpegcolorspace element, I believe.  Look at the pad_alloc function of the 
ffmpegcolorspace sink pad to find out.  (Default is to allocate using 
malloc().)

 Why do you want a USERPTR anyway?

 Regards,
 Arnout

On Wednesday 04 August 2010 14:33:02, Hu, Gang A wrote:
> Hi,
> I had a v4l2 camera driver with the "V4L2_MEMORY_USERPTR" type memory
> support and a camera source element "v4l2newcamsrc" to support this type
> memory. When I running the pipeline bellow
> "gst-launch v4l2newcamsrc num-buffers=1 ! ffmpegcolorspace !
> video/x-raw-yuv,width=640,height=480 ! filesink  location=image_640.yuv"
> The image can be captured successfully.
> But when the buffers are freed in the camera source element, there will
> always be an error message in the terminal.
> 
> *** glibc detected *** /usr/local/meego/bin/gst-launch-0.10: free():
> invalid pointer: 0xb73c8008 *** ======= Backtrace: =========
> /lib/libc.so.6[0x550cc1]
> /usr/local/meego/lib/libgstreamer-0.10.so.0(+0x29c06)[0xb7792c06]
> /usr/local/meego/lib/libgstreamer-0.10.so.0(gst_mini_object_unref+0xaf)[0
> xb77b94df] .
> 
> I use gst_pad_alloc_buffer_and_set_caps() to allocate the buffer from the
> download element in the camera source element. When the application
> exit, gst_buffer_unref (buffer) will be called to free the memory. This
> code case the error above after debugging with GDB.
> 
> I have two questions about that.
> 1.      Which element is responsible for the memory allocation when call
> "gst_pad_alloc_buffer_and_set_caps()" in camera source element in my
> pipeline. 2.      How to free the memory allocated by
> "gst_pad_alloc_buffer_and_set_caps()"? Why the error "free(): invalid
> pointer: 0xb73c8008 ***" occurred.
> 
> 
> 
> Thanks.
> Best Regards!
> Hu Gang

-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  31BB CF53 8660 6F88 345D  54CC A836 5879 20D7 CF43




More information about the gstreamer-devel mailing list