ensonic gstreamer: gstreamer/ gstreamer/libs/gst/controller/
[email protected] Tue, 9 Dec 2008 01:56:39 -0800 (PST)
| Newsgroups | gmane.comp.video.gstreamer.cvs |
|---|---|
| Message-ID | <[email protected]> |
CVS Root: /cvs/gstreamer
Module: gstreamer
Changes by: ensonic
Date: Tue Dec 09 2008 09:56:39 UTC
Log message:
* libs/gst/controller/gstcontroller.c:
Aggregate return value for gst_controller_sync_values(). More info in
logging. Always set values on first sync-call.
* libs/gst/controller/gstcontrolsource.c:
Microoptimizations.
* libs/gst/controller/gsthelper.c:
Fix return code and comment.
Modified files:
. : ChangeLog
libs/gst/controller: gstcontroller.c gstcontrolsource.c
gsthelper.c
Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.4185&r2=1.4186
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/libs/gst/controller/gstcontroller.c.diff?r1=1.59&r2=1.60
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/libs/gst/controller/gstcontrolsource.c.diff?r1=1.2&r2=1.3
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/libs/gst/controller/gsthelper.c.diff?r1=1.18&r2=1.19
====Begin Diffs====
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v
retrieving revision 1.4185
retrieving revision 1.4186
diff -u -d -r1.4185 -r1.4186
--- ChangeLog 9 Dec 2008 09:00:55 -0000 1.4185
+++ ChangeLog 9 Dec 2008 09:56:23 -0000 1.4186
@@ -1,5 +1,18 @@
2008-12-09 Stefan Kost <[email protected]>
+ * libs/gst/controller/gstcontroller.c:
+ Aggregate return value for gst_controller_sync_values(). More info in
+ logging. Always set values on first sync-call.
+
+ * libs/gst/controller/gstcontrolsource.c:
+ Microoptimizations.
+ * libs/gst/controller/gsthelper.c:
+ Fix return code and comment.
+
+2008-12-09 Stefan Kost <[email protected]>
* tools/gst-launch.1.in:
Fix description of how to specify a type in caps. Fixes #553873.
Also ranges and list contain values and not property-assignments.
Index: gstcontroller.c
RCS file: /cvs/gstreamer/gstreamer/libs/gst/controller/gstcontroller.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- gstcontroller.c 17 Nov 2008 21:41:35 -0000 1.59
+++ gstcontroller.c 9 Dec 2008 09:56:24 -0000 1.60
@@ -586,7 +586,8 @@
* Gets the value for the given controller-handled property at the requested
* time.
*
- * Returns: the GValue of the property at the given time, or %NULL if the property isn't handled by the controller
+ * Returns: the GValue of the property at the given time, or %NULL if the
+ * property isn't handled by the controller
*/
GValue *
gst_controller_get (GstController * self, gchar * property_name,
@@ -661,6 +662,9 @@
* Sets the properties of the element, according to the controller that (maybe)
* handles them and for the given timestamp.
+ * If this function fails, it is most likely the application developers fault.
+ * Most probably the control sources are not setup correctly.
+ *
* Returns: %TRUE if the controller values could be applied to the object
* properties, %FALSE otherwise
@@ -669,7 +673,7 @@
{
GstControlledProperty *prop;
GList *node;
- gboolean ret = FALSE;
+ gboolean ret = TRUE, val_ret;
GValue value = { 0, };
g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE);
@@ -683,25 +687,31 @@
for (node = self->properties; node; node = g_list_next (node)) {
prop = node->data;
- GST_LOG ("property '%s' at ts=%" G_GUINT64_FORMAT, prop->name, timestamp);
-
if (!prop->csource || prop->disabled)
continue;
+ GST_LOG ("property '%s' at ts=%" G_GUINT64_FORMAT, prop->name, timestamp);
/* 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 (G_LIKELY (ret)) {
- if (gst_value_compare (&value, &prop->last_value) != GST_VALUE_EQUAL) {
+ val_ret = gst_control_source_get_value (prop->csource, timestamp, &value);
+ if (G_LIKELY (val_ret)) {
+ /* always set the value for first time, but then only if it changed
+ * this should limit g_object_notify invocations.
+ * FIXME: can we detect negative playback rates?
+ */
+ if ((timestamp < self->priv->last_sync) ||
+ gst_value_compare (&value, &prop->last_value) != GST_VALUE_EQUAL) {
g_object_set_property (self->object, prop->name, &value);
g_value_copy (&value, &prop->last_value);
}
} else {
- GST_LOG ("no control value");
+ GST_DEBUG ("no control value for param %s", prop->name);
}
g_value_unset (&value);
+ ret &= val_ret;
}
self->priv->last_sync = timestamp;
g_object_thaw_notify (self->object);
Index: gstcontrolsource.c
RCS file: /cvs/gstreamer/gstreamer/libs/gst/controller/gstcontrolsource.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- gstcontrolsource.c 12 Dec 2007 23:20:00 -0000 1.2
+++ gstcontrolsource.c 9 Dec 2008 09:56:25 -0000 1.3
@@ -92,7 +92,7 @@
g_return_val_if_fail (GST_IS_CONTROL_SOURCE (self), FALSE);
- if (self->get_value) {
+ if (G_LIKELY (self->get_value)) {
return self->get_value (self, timestamp, value);
} else {
GST_ERROR ("Not bound to a specific property yet!");
@@ -122,7 +122,7 @@
- if (self->get_value_array) {
+ if (G_LIKELY (self->get_value_array)) {
return self->get_value_array (self, timestamp, value_array);
Index: gsthelper.c
RCS file: /cvs/gstreamer/gstreamer/libs/gst/controller/gsthelper.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- gsthelper.c 3 May 2008 15:25:24 -0000 1.18
+++ gsthelper.c 9 Dec 2008 09:56:25 -0000 1.19
@@ -186,7 +186,10 @@
if ((ctrl = g_object_get_qdata (object, priv_gst_controller_key))) {
return gst_controller_sync_values (ctrl, timestamp);
- return (FALSE);
+ /* this is no failure, its called by elements regardless if there is a
+ * controller assigned or not
+ */
+ return (TRUE);
}
/**
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/