libs/gst/controller/gstcontroller.c: Use freeze/thaw notify to sync notify emission a bit (its also more efficient). ...

Original commit message from CVS:
* libs/gst/controller/gstcontroller.c:
Use freeze/thaw notify to sync notify emission a bit (its also more
efficient). Move debug output to LOG (is called a lot in a loop).
Always unset g_values if the have been initialized.
This commit is contained in:
Stefan Kost 2008-06-20 08:32:36 +00:00
parent 8cd06f8770
commit 73151ffc11
2 changed files with 19 additions and 6 deletions

View file

@ -1,3 +1,10 @@
2008-06-20 Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/gstcontroller.c:
Use freeze/thaw notify to sync notify emission a bit (its also more
efficient). Move debug output to LOG (is called a lot in a loop).
Always unset g_values if the have been initialized.
2008-06-20 Wim Taymans <wim.taymans@collabora.co.uk>
* libs/gst/base/gstbasesink.c: (gst_base_sink_get_sync_times),

View file

@ -666,7 +666,8 @@ gst_controller_sync_values (GstController * self, GstClockTime timestamp)
{
GstControlledProperty *prop;
GList *node;
gboolean ret = FALSE;
gboolean ret;
GValue value = { 0, };
g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE);
g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), FALSE);
@ -674,25 +675,30 @@ gst_controller_sync_values (GstController * self, GstClockTime timestamp)
GST_LOG ("sync_values");
g_mutex_lock (self->lock);
g_object_freeze_notify (self->object);
/* go over the controlled properties of the controller */
for (node = self->properties; node; node = g_list_next (node)) {
GValue value = { 0, };
prop = node->data;
GST_DEBUG (" property '%s' at ts=%" G_GUINT64_FORMAT, prop->name,
timestamp);
GST_LOG ("property '%s' at ts=%" G_GUINT64_FORMAT, prop->name, timestamp);
if (!prop->csource || prop->disabled)
continue;
/* we can make this faster
* http://bugzilla.gnome.org/show_bug.cgi?id=536939
*/
g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (prop->pspec));
ret = gst_control_source_get_value (prop->csource, timestamp, &value);
if (ret) {
if (G_LIKELY (ret)) {
g_object_set_property (self->object, prop->name, &value);
g_value_unset (&value);
} else {
GST_LOG ("no control value");
}
g_value_unset (&value);
}
self->priv->last_sync = timestamp;
g_object_thaw_notify (self->object);
g_mutex_unlock (self->lock);