GNOME Bugzilla – Bug 763142
API: add async property change notification - gst_element_add_property_notify_watch()
Last modified: 2016-04-08 12:29:22 UTC
Created attachment 323156 [details] [review] element: add API to get property change notifications via messages I always thought it'd be nice if we had some helper API to receive GObject property notifications such as playbin notify::volume via the bus instead of callbacks from a non-application thread. This adds API for that. Open question: should we merge add_property_notify_watch() and _add_deep_...() ? That would mean changing the gboolean include_value into a flags argument with flags for include_value and recursive notification. --- Be notified in the application thread via bus messages about notify::* and deep-notify::* property changes, instead of having to deal with it in a non-application thread. API: gst_element_add_property_notify_watch() API: gst_element_add_property_deep_notify_watch() API: gst_element_remove_property_notify_watch() API: gst_message_new_property_notify() API: gst_message_parse_property_notify() API: GST_MESSAGE_NOTIFY_PROPERTY
Created attachment 323157 [details] [review] tools: gst-launch: use new async property change notification API
Sounds like a very nice idea (in pitivi for example we got to always marshall properties changes to the app thread etc.. and I believe it is a problem other apps have) :) Just wonder if the deep_notify watches should not rather go to the ChildProxy interface?
Review of attachment 323156 [details] [review]: Very good idea. I think keeping deep and non-deep separate is fine :) (While we're at it, a deep-element-added/removed is something we should also try to get in for 1.10 finally...) ::: gst/gstmessage.h @@ +598,3 @@ +/* PROPERTY_NOTIFY */ +GstMessage * gst_message_new_property_notify (GstObject * src, const gchar * property_name, GValue * val) G_GNUC_MALLOC; +void gst_message_parse_property_notify (GstMessage * message, const gchar ** property_name, const GValue ** value); Maybe add the object here too? GST_MESSAGE_SRC() basically but it would be easier to find and often you probably want to know the sender.
(In reply to Thibault Saunier from comment #2) > Sounds like a very nice idea (in pitivi for example we got to always > marshall properties changes to the app thread etc.. and I believe it is a > problem other apps have) :) > > Just wonder if the deep_notify watches should not rather go to the > ChildProxy interface? deep-notify is a GstObject thing, GstChildProxy operates on GObject.
Created attachment 324791 [details] [review] element: add API to get property change notifications via messages [v2] v2: - added gtk-doc blurb for gst_message_parse_property_notify() - added GstObject ** out argument to gst_message_parse_property_notify() (should this be a GObject instead?) - fix property name leak in parse_property_name() - add unit test ----- Be notified in the application thread via bus messages about notify::* and deep-notify::* property changes, instead of having to deal with it in a non-application thread. API: gst_element_add_property_notify_watch() API: gst_element_add_property_deep_notify_watch() API: gst_element_remove_property_notify_watch() API: gst_message_new_property_notify() API: gst_message_parse_property_notify() API: GST_MESSAGE_PROPERTY_NOTIFY
Created attachment 324792 [details] [review] tools: gst-launch: use new async property change notification API [v2]
commit d09dc8cbc0c72dde640a29134e74760d93f680ae Author: Tim-Philipp Müller <tim@centricular.com> Date: Sat Mar 5 17:51:01 2016 +0000 tools: gst-launch: use new async property change notification API https://bugzilla.gnome.org/show_bug.cgi?id=763142 commit 6e3fb7af523f11ecaff63702d24723cb44e5d625 Author: Tim-Philipp Müller <tim@centricular.com> Date: Sat Mar 5 14:12:36 2016 +0000 element: add API to get property change notifications via messages Be notified in the application thread via bus messages about notify::* and deep-notify::* property changes, instead of having to deal with it in a non-application thread. API: gst_element_add_property_notify_watch() API: gst_element_add_property_deep_notify_watch() API: gst_element_remove_property_notify_watch() API: gst_message_new_property_notify() API: gst_message_parse_property_notify() API: GST_MESSAGE_PROPERTY_NOTIFY https://bugzilla.gnome.org/show_bug.cgi?id=763142