mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
v4l2src: Prepend to lists and reverse them at the end.
Gratuitous micro-optimisation - prepend to lists and reverse them, rather than appending to them each time.
This commit is contained in:
parent
608d13d462
commit
a32581abee
1 changed files with 7 additions and 3 deletions
|
@ -181,8 +181,9 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
|
||||||
}
|
}
|
||||||
|
|
||||||
v4l2object->channels =
|
v4l2object->channels =
|
||||||
g_list_append (v4l2object->channels, (gpointer) channel);
|
g_list_prepend (v4l2object->channels, (gpointer) channel);
|
||||||
}
|
}
|
||||||
|
v4l2object->channels = g_list_reverse (v4l2object->channels);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (e, " norms");
|
GST_DEBUG_OBJECT (e, " norms");
|
||||||
/* norms... */
|
/* norms... */
|
||||||
|
@ -221,8 +222,9 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
|
||||||
standard.frameperiod.denominator, standard.frameperiod.numerator);
|
standard.frameperiod.denominator, standard.frameperiod.numerator);
|
||||||
v4l2norm->index = standard.id;
|
v4l2norm->index = standard.id;
|
||||||
|
|
||||||
v4l2object->norms = g_list_append (v4l2object->norms, (gpointer) norm);
|
v4l2object->norms = g_list_prepend (v4l2object->norms, (gpointer) norm);
|
||||||
}
|
}
|
||||||
|
v4l2object->norms = g_list_reverse (v4l2object->norms);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (e, " controls+menus");
|
GST_DEBUG_OBJECT (e, " controls+menus");
|
||||||
/* and lastly, controls+menus (if appropriate) */
|
/* and lastly, controls+menus (if appropriate) */
|
||||||
|
@ -364,8 +366,10 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
v4l2object->colors = g_list_append (v4l2object->colors, (gpointer) channel);
|
v4l2object->colors =
|
||||||
|
g_list_prepend (v4l2object->colors, (gpointer) channel);
|
||||||
}
|
}
|
||||||
|
v4l2object->colors = g_list_reverse (v4l2object->colors);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (e, "done");
|
GST_DEBUG_OBJECT (e, "done");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in a new issue