mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 15:51:11 +00:00
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.
This commit is contained in:
parent
27e20eadc0
commit
5cf61c6a80
3 changed files with 13 additions and 15 deletions
|
@ -1,3 +1,11 @@
|
|||
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():
|
||||
|
|
Loading…
Reference in a new issue