Hi!
I would like to be notified when an readonly parameter changes. Consider for example the current delay or latency of ladspa or lv2 delay plugin. I tried the following with no success: self.delay.bind_property('left-delay', self.ui_value, 'value', GObject.BindingFlags.DEFAULT) When the property is writable I am notified about its changes but not when it is readonly. I know that the plugin code made changes to the parameter because I can see them doing print(self.delay.get_property('left-delay)). Is there a way to be notified about these changes without having to periodically calling get_property? Best regards, Wellington Prof.° Wellington Wallace Miguel Melo CEFET/RJ Uned Nova Iguaçu _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Hi Wellington
Every GObject (GstElements included) may emit a signal every time one of its properties change. This signal is named “notify::<property name>”. So, for example, if you’d like to register a callback every time the “sync” property changes, you would do something like: /* Activate property change notification */ g_object_notify (G_OBJECT (sink), “sync”); /* Register a callback */ g_signal_connect (sink, "notify::sync", G_CALLBACK (sync_update_callback), NULL); You may find more info in the notify signal documentation: — Michael Gruner <[hidden email]> Embedded Linux and GStreamer solutions RidgeRun Engineering Contact Us - http://www.ridgerun.com/#!contact/c3vn
_______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Hi Michael Maybe there is a limitation in the LADSPA or LV2 support and there is no internal calling for the notify property when GStreamer updates the the readonly properties of these kind of plugins. Or maybe something is missing in the Python bindings. Best regards, Wellington On Tue, Mar 20, 2018 at 1:05 PM, Michael Gruner <[hidden email]> wrote:
Prof.° Wellington Wallace Miguel Melo CEFET/RJ Uned Nova Iguaçu _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
> Maybe there is a limitation in the LADSPA or LV2 support and there is no internal calling for the notify property when GStreamer updates the the readonly properties of these kind of plugins. Or maybe something is missing in the Python bindings.
From what you describe I would guess something is missing in the lv2/ladspa GStreamer plugin, patches welcome :-) Regards, Thibault Saunier On Wed, Mar 21, 2018 at 1:00 AM, wellington wallace <[hidden email]> wrote: > Hi Michael > > I tried what you suggested and the callback is called only when I invoke > GObject notify method. Nothing happens when the plugin updates the property. > I will detail a little more my situation. I am the developer of this > application https://github.com/wwmm/pulseeffects. In it I use a few LADSPA > and LV2 plugins that write on readonly parameters information like the > current audio delay, attenuation or latency. I would like to show this kind > of information without using a combination of GLib.timeout_add_seconds and > get_property like I am doing know. Things like the delay of the delay plugin > do not change all the time like the attenuation of a compressor. So it does > not make sense to get this value in a timer. > > Maybe there is a limitation in the LADSPA or LV2 support and there is no > internal calling for the notify property when GStreamer updates the the > readonly properties of these kind of plugins. Or maybe something is missing > in the Python bindings. > > Best regards, > > Wellington > > > On Tue, Mar 20, 2018 at 1:05 PM, Michael Gruner > <[hidden email]> wrote: >> >> Hi Wellington >> >> Every GObject (GstElements included) may emit a signal every time one of >> its properties change. This signal is named “notify::<property name>”. So, >> for example, if you’d like to register a callback every time the “sync” >> property changes, you would do something like: >> >> /* Activate property change notification */ >> g_object_notify (G_OBJECT (sink), “sync”); >> >> /* Register a callback */ >> g_signal_connect (sink, "notify::sync", >> G_CALLBACK (sync_update_callback), NULL); >> >> You may find more info in the notify signal documentation: >> >> https://developer.gnome.org/gobject/stable/gobject-The-Base-Object-Type.html#GObject-notify >> >> >> — >> Michael Gruner <[hidden email]> >> Embedded Linux and GStreamer solutions >> RidgeRun Engineering >> Contact Us - http://www.ridgerun.com/#!contact/c3vn >> >> On Mar 20, 2018, at 09:18, wellington wallace >> <[hidden email]> wrote: >> >> Hi! >> >> I would like to be notified when an readonly parameter changes. Consider >> for example the current delay or latency of ladspa or lv2 delay plugin. I >> tried the following with no success: >> >> self.delay.bind_property('left-delay', self.ui_value, 'value', >> GObject.BindingFlags.DEFAULT) >> >> When the property is writable I am notified about its changes but not when >> it is readonly. I know that the plugin code made changes to the parameter >> because I can see them doing print(self.delay.get_property('left-delay)). >> >> Is there a way to be notified about these changes without having to >> periodically calling get_property? >> >> Best regards, >> >> Wellington >> >> -- >> Prof.° Wellington Wallace Miguel Melo >> >> CEFET/RJ Uned Nova Iguaçu >> >> _______________________________________________ >> gstreamer-devel mailing list >> [hidden email] >> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel >> >> > > > > -- > Prof.° Wellington Wallace Miguel Melo > > CEFET/RJ Uned Nova Iguaçu > > > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel > gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
When I have the time I will try to take a look at the lv2/ladspa plugin source :D But as I have never done a Gstreamer or lv2/ladspa plugin before I am not sure I will succeed and be able to provide patches. Best regards, Wellington On Wed, Mar 21, 2018 at 6:23 PM, Thibault Saunier <[hidden email]> wrote: > Maybe there is a limitation in the LADSPA or LV2 support and there is no internal calling for the notify property when GStreamer updates the the readonly properties of these kind of plugins. Or maybe something is missing in the Python bindings. Prof.° Wellington Wallace Miguel Melo CEFET/RJ Uned Nova Iguaçu _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |