mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-05 18:22:23 +00:00
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:
parent
8cd06f8770
commit
73151ffc11
2 changed files with 19 additions and 6 deletions
|
@ -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>
|
2008-06-20 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
* libs/gst/base/gstbasesink.c: (gst_base_sink_get_sync_times),
|
* libs/gst/base/gstbasesink.c: (gst_base_sink_get_sync_times),
|
||||||
|
|
|
@ -666,7 +666,8 @@ gst_controller_sync_values (GstController * self, GstClockTime timestamp)
|
||||||
{
|
{
|
||||||
GstControlledProperty *prop;
|
GstControlledProperty *prop;
|
||||||
GList *node;
|
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_IS_CONTROLLER (self), FALSE);
|
||||||
g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), 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");
|
GST_LOG ("sync_values");
|
||||||
|
|
||||||
g_mutex_lock (self->lock);
|
g_mutex_lock (self->lock);
|
||||||
|
g_object_freeze_notify (self->object);
|
||||||
/* go over the controlled properties of the controller */
|
/* go over the controlled properties of the controller */
|
||||||
for (node = self->properties; node; node = g_list_next (node)) {
|
for (node = self->properties; node; node = g_list_next (node)) {
|
||||||
GValue value = { 0, };
|
|
||||||
prop = node->data;
|
prop = node->data;
|
||||||
|
|
||||||
GST_DEBUG (" property '%s' at ts=%" G_GUINT64_FORMAT, prop->name,
|
GST_LOG ("property '%s' at ts=%" G_GUINT64_FORMAT, prop->name, timestamp);
|
||||||
timestamp);
|
|
||||||
|
|
||||||
if (!prop->csource || prop->disabled)
|
if (!prop->csource || prop->disabled)
|
||||||
continue;
|
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));
|
g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (prop->pspec));
|
||||||
ret = gst_control_source_get_value (prop->csource, timestamp, &value);
|
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_object_set_property (self->object, prop->name, &value);
|
||||||
|
} else {
|
||||||
|
GST_LOG ("no control value");
|
||||||
|
}
|
||||||
g_value_unset (&value);
|
g_value_unset (&value);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
self->priv->last_sync = timestamp;
|
self->priv->last_sync = timestamp;
|
||||||
|
g_object_thaw_notify (self->object);
|
||||||
|
|
||||||
g_mutex_unlock (self->lock);
|
g_mutex_unlock (self->lock);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue