Commit 5cf61c6a authored by Edward Hervey's avatar Edward Hervey 🤘
Browse files

sys/v4l2/gstv4l2src.c: Properly set the maximum latency value, in the same way...

sys/v4l2/gstv4l2src.c: Properly set the maximum latency value, in the same way it is done in v4lsrc.

Original commit message from CVS:
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_query):
Properly set the maximum latency value, in the same way it is done in
v4lsrc.
* sys/v4l2/v4l2src_calls.c:
Simplify fraction equality check, no need to use GValues for this.
parent 27e20ead
2008-08-13 Edward Hervey <edward.hervey@collabora.co.uk>
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_query):
Properly set the maximum latency value, in the same way it is done in
v4lsrc.
* sys/v4l2/v4l2src_calls.c:
Simplify fraction equality check, no need to use GValues for this.
2008-08-12 Edward Hervey <edward.hervey@collabora.co.uk>
 
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_query):
......
......@@ -1089,8 +1089,7 @@ gst_v4l2src_query (GstBaseSrc * bsrc, GstQuery * query)
gst_util_uint64_scale_int (GST_SECOND, src->fps_d, src->fps_n);
/* max latency is total duration of the frame buffer */
/* FIXME: what to use here? */
max_latency = 1 * min_latency;
max_latency = src->num_buffers * min_latency;
GST_DEBUG_OBJECT (bsrc,
"report latency min %" GST_TIME_FORMAT " max %" GST_TIME_FORMAT,
......
......@@ -1132,19 +1132,10 @@ qbuf_failed:
*/
}
static gboolean
fractions_are_equal (gint num1, gint den1, gint num2, gint den2)
{
GValue fraction1 = { 0, }, fraction2 = {
0,};
g_value_init (&fraction1, GST_TYPE_FRACTION);
g_value_init (&fraction2, GST_TYPE_FRACTION);
gst_value_set_fraction (&fraction1, num1, den1);
gst_value_set_fraction (&fraction2, num2, den2);
/* we know we don't have to unset the values in this case */
return (gst_value_compare (&fraction1, &fraction2) == GST_VALUE_EQUAL);
}
/* Note about fraction simplification
* n1/d1 == n2/d2 is also written as n1 == ( n2 * d1 ) / d2
*/
#define fractions_are_equal(n1,d1,n2,d2) ((n1) == gst_util_uint64_scale_int((n2), (d1), (d2)))
/******************************************************
* gst_v4l2src_set_capture():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment