mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:36:20 +00:00
libs/gst/controller/: Save last synced value from the list to continue searching from there in future syncs. This spe...
Original commit message from CVS: reviewed by: Stefan Kost <ensonic@users.sf.net> * libs/gst/controller/gstcontroller.c: (gst_controller_unset), (gst_controller_unset_all): * libs/gst/controller/gstcontrollerprivate.h: * libs/gst/controller/gstinterpolation.c: (gst_controlled_property_find_control_point_node): Save last synced value from the list to continue searching from there in future syncs. This speeds everything up a bit.
This commit is contained in:
parent
b92d7dc076
commit
3b7871d993
4 changed files with 28 additions and 19 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
||||||
|
2007-05-17 Sebastian Dröge <slomo@circular-chaos.org>
|
||||||
|
|
||||||
|
reviewed by: Stefan Kost <ensonic@users.sf.net>
|
||||||
|
|
||||||
|
* libs/gst/controller/gstcontroller.c: (gst_controller_unset),
|
||||||
|
(gst_controller_unset_all):
|
||||||
|
* libs/gst/controller/gstcontrollerprivate.h:
|
||||||
|
* libs/gst/controller/gstinterpolation.c:
|
||||||
|
(gst_controlled_property_find_control_point_node):
|
||||||
|
Save last synced value from the list to continue searching from there
|
||||||
|
in future syncs. This speeds everything up a bit.
|
||||||
|
|
||||||
2007-05-17 Sebastian Dröge <slomo@circular-chaos.org>
|
2007-05-17 Sebastian Dröge <slomo@circular-chaos.org>
|
||||||
|
|
||||||
reviewed by: Stefan Kost <ensonic@users.sf.net>
|
reviewed by: Stefan Kost <ensonic@users.sf.net>
|
||||||
|
|
|
@ -853,6 +853,8 @@ gst_controller_unset (GstController * self, gchar * property_name,
|
||||||
/* check if a control point for the timestamp exists */
|
/* check if a control point for the timestamp exists */
|
||||||
if ((node = g_list_find_custom (prop->values, ×tamp,
|
if ((node = g_list_find_custom (prop->values, ×tamp,
|
||||||
gst_control_point_find))) {
|
gst_control_point_find))) {
|
||||||
|
if (node == prop->last_requested_value)
|
||||||
|
prop->last_requested_value = NULL;
|
||||||
gst_control_point_free (node->data); /* free GstControlPoint */
|
gst_control_point_free (node->data); /* free GstControlPoint */
|
||||||
prop->values = g_list_delete_link (prop->values, node);
|
prop->values = g_list_delete_link (prop->values, node);
|
||||||
res = TRUE;
|
res = TRUE;
|
||||||
|
@ -888,6 +890,7 @@ gst_controller_unset_all (GstController * self, gchar * property_name)
|
||||||
/* free GstControlPoint structures */
|
/* free GstControlPoint structures */
|
||||||
g_list_foreach (prop->values, (GFunc) gst_control_point_free, NULL);
|
g_list_foreach (prop->values, (GFunc) gst_control_point_free, NULL);
|
||||||
g_list_free (prop->values);
|
g_list_free (prop->values);
|
||||||
|
prop->last_requested_value = NULL;
|
||||||
prop->values = NULL;
|
prop->values = NULL;
|
||||||
res = TRUE;
|
res = TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,9 +106,7 @@ typedef struct _GstControlledProperty
|
||||||
InterpolateGetValueArray get_value_array;
|
InterpolateGetValueArray get_value_array;
|
||||||
|
|
||||||
GList *values; /* List of GstControlPoint */
|
GList *values; /* List of GstControlPoint */
|
||||||
/* TODO keep the last search result to be able to continue
|
GList *last_requested_value; /* last search result, can be used for incremental searches */
|
||||||
GList *last_value; // last search result, can be used for incremental searches
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
gpointer _gst_reserved[GST_PADDING];
|
gpointer _gst_reserved[GST_PADDING];
|
||||||
|
|
|
@ -44,23 +44,20 @@ GList *
|
||||||
gst_controlled_property_find_control_point_node (GstControlledProperty * prop,
|
gst_controlled_property_find_control_point_node (GstControlledProperty * prop,
|
||||||
GstClockTime timestamp)
|
GstClockTime timestamp)
|
||||||
{
|
{
|
||||||
/* GList *prev_node = NULL; */
|
|
||||||
GList *prev_node = g_list_last (prop->values);
|
GList *prev_node = g_list_last (prop->values);
|
||||||
GList *node;
|
GList *node;
|
||||||
GstControlPoint *cp;
|
GstControlPoint *cp;
|
||||||
|
|
||||||
/*
|
node = prop->values;
|
||||||
if((prop->last_value) &&
|
if (prop->last_requested_value) {
|
||||||
(timestamp>((GstTimedValue *)(prop->last_value->data))->timestamp)) {
|
GstControlPoint *last_cp = prop->last_requested_value->data;
|
||||||
node=prop->last_value;
|
|
||||||
}
|
if (timestamp > last_cp->timestamp)
|
||||||
else {
|
node = prop->last_requested_value;
|
||||||
node=prop->values;
|
}
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* iterate over timed value list */
|
/* iterate over timed value list */
|
||||||
for (node = prop->values; node; node = g_list_next (node)) {
|
for (; node; node = g_list_next (node)) {
|
||||||
cp = node->data;
|
cp = node->data;
|
||||||
/* this timestamp is newer that the one we look for */
|
/* this timestamp is newer that the one we look for */
|
||||||
if (timestamp < cp->timestamp) {
|
if (timestamp < cp->timestamp) {
|
||||||
|
@ -69,11 +66,10 @@ gst_controlled_property_find_control_point_node (GstControlledProperty * prop,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
if(node) {
|
if (prev_node)
|
||||||
prop->last_value=prev_node;
|
prop->last_requested_value = prev_node;
|
||||||
}
|
|
||||||
*/
|
|
||||||
return (prev_node);
|
return (prev_node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue