gstreamer-java / gst1-java-core

Java bindings for GStreamer 1.x
GNU Lesser General Public License v3.0
188 stars 72 forks source link

fix pad ownership on gst_element_get_request_pad #197

Closed MaZderMind closed 4 years ago

MaZderMind commented 4 years ago

adding @CallerOwnsReturn to gst_element_get_request_pad as suggested in https://github.com/gstreamer-java/gst1-java-core/pull/186#discussion_r406777371 seems to reliably fix #188.

neilcsmith-net commented 4 years ago

Does it also fix your GC issue? This should stop the request pad being collected while it's referenced by the ghost pad, but might be other issue at play there too.

MaZderMind commented 4 years ago

@neilcsmith-net It also fixes the Memory-Leak, if that is what you relate to. I still have a very rare reliability issue in my Code but I do not yet see a relation to this or #184.

neilcsmith-net commented 4 years ago

@MaZderMind I'm thinking of the issue with the (request) Pad being GC'd while the callback is running. This might fix that. All owned Java GObjects are cached if there are additional native references (as that GhostPad should have).

MaZderMind commented 4 years ago

@neilcsmith-net Ah - yes! That seems to be fixed as well \o/ Didn't even notice that because I was experimenting with the original fix applied locally for a while. Thank you very much for your help!

neilcsmith-net commented 4 years ago

@MaZderMind :+1: we might still want to look at caching the pads in the element, but that's good to know.