GNOME Bugzilla – Bug 792265
appsrc: uncertainty moment in the documentation
Last modified: 2018-11-03 12:02:43 UTC
About the ownership of the buffer, when pushing it to appsrc. https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-appsrc.html#gst-app-src-push-buffer Function takes ownership, but signal doesn't. It was tricky, because I didn't find the documentation for signal in the web. But in appsrc's code it exists: /** * GstAppSrc::push-buffer: * @appsrc: the appsrc * @buffer: a buffer to push * * Adds a buffer to the queue of buffers that the appsrc element will * push to its source pad. This function does not take ownership of the * buffer so the buffer needs to be unreffed after calling this function. * And the web-page only says: ---- The main way of handing data to the appsrc element is by calling the gst_app_src_push_buffer() method or by emitting the push-buffer action signal. ---- But gst_app_src_push_buffer is not a signal handler for "push-buffer", that's what's tricky.
The problem is that it's in the documentation twice, once as library API in libgstapp, and once as element: https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-plugins/html/gst-plugins-base-plugins-appsrc.html#gst-plugins-base-plugins-appsrc.signals Without the description from the doc chunk though.
I don't really know what to do about this to be honest. Do you have any suggestions? The documentation for gst_app_src_push_buffer() is correct. Arguments to g_signal_emit() never take ownership, that's a GObject thing.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/412.