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 701650 - v4l2: make sure the element is not deleted before the pool
v4l2: make sure the element is not deleted before the pool
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.1.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-06-05 14:51 UTC by Michael Olbrich
Modified: 2013-06-07 18:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (1.17 KB, patch)
2013-06-05 14:51 UTC, Michael Olbrich
committed Details | Review

Description Michael Olbrich 2013-06-05 14:51:23 UTC
Created attachment 246082 [details] [review]
patch

The pool accesses data from the v4l2object so it must exist at least
as long as the pool. Refcount the element which controls the object
live-time.
Comment 1 Sebastian Dröge (slomo) 2013-06-06 12:43:01 UTC
Note that this creates a refcount circle. v4l2object and pool own a reference of each other. Which will mean that you will leak both. The alternative is a (see xvimagesink) object to hold the v4l2 context, which is owned by both the sink and the buffer pool.
Comment 2 Michael Olbrich 2013-06-07 17:44:01 UTC
Ther is no refcount cycle. v4l2object releases the ref to the pool in gst_v4l2_object_stop(). When the last buffer returns to the pool, pool_stop() is called and the the pool is deleted. Then the element and object are deleted (unless there are other refs to the element).
Comment 3 Sebastian Dröge (slomo) 2013-06-07 18:08:46 UTC
Indeed, and that happens even before finalizing the sink/src element. Sorry

commit a1c34b540735a7a23b15cdb77ecba1b28adb93ee
Author: Michael Olbrich <m.olbrich@pengutronix.de>
Date:   Wed Jun 5 16:32:30 2013 +0200

    v4l2: make sure the element is not deleted before the pool
    
    The pool accesses data from the v4l2object so it must exist at least
    as long as the pool. Refcount the element which controls the object
    live-time.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=701650