mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
sys/v4l2/: Framerate can be 0/1 too.
Original commit message from CVS: * sys/v4l2/gstv4l2src.c: (gst_v4l2src_get_all_caps), (gst_v4l2src_get_caps): * sys/v4l2/v4l2_calls.c: (gst_v4l2_fill_lists): Framerate can be 0/1 too. Init framerate to 0/1 before querying it so that we can detect devices that don't know about a framerate. Add some more debugging info.
This commit is contained in:
parent
f0cf378a42
commit
210e3a8e67
2 changed files with 11 additions and 2 deletions
|
@ -684,7 +684,7 @@ gst_v4l2src_get_all_caps (void)
|
|||
gst_structure_set (structure,
|
||||
"width", GST_TYPE_INT_RANGE, 1, GST_V4L2_MAX_SIZE,
|
||||
"height", GST_TYPE_INT_RANGE, 1, GST_V4L2_MAX_SIZE,
|
||||
"framerate", GST_TYPE_FRACTION_RANGE, 1, 1, 100, 1, NULL);
|
||||
"framerate", GST_TYPE_FRACTION_RANGE, 0, 1, 100, 1, NULL);
|
||||
gst_caps_append_structure (caps, structure);
|
||||
}
|
||||
}
|
||||
|
@ -754,7 +754,7 @@ gst_v4l2src_get_caps (GstBaseSrc * src)
|
|||
/* another approach for web-cams would be to try to set a very
|
||||
high(100/1) and low(1/1) FPSs and get the values returned */
|
||||
gst_structure_set (structure, "framerate", GST_TYPE_FRACTION_RANGE,
|
||||
1, 1, 100, 1, NULL);
|
||||
0, 1, 100, 1, NULL);
|
||||
|
||||
gst_caps_append_structure (caps, structure);
|
||||
}
|
||||
|
|
|
@ -105,6 +105,8 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
|
|||
}
|
||||
}
|
||||
|
||||
GST_DEBUG_OBJECT (v4l2object->element, " '%s'", input.name);
|
||||
|
||||
v4l2channel = g_object_new (GST_TYPE_V4L2_TUNER_CHANNEL, NULL);
|
||||
channel = GST_TUNER_CHANNEL (v4l2channel);
|
||||
channel->label = g_strdup ((const gchar *) input.name);
|
||||
|
@ -150,6 +152,9 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
|
|||
GstV4l2TunerNorm *v4l2norm;
|
||||
GstTunerNorm *norm;
|
||||
|
||||
/* fill in defaults */
|
||||
standard.frameperiod.denominator = 0;
|
||||
standard.frameperiod.numerator = 1;
|
||||
standard.index = n;
|
||||
if (ioctl (v4l2object->video_fd, VIDIOC_ENUMSTD, &standard) < 0) {
|
||||
if (errno == EINVAL)
|
||||
|
@ -162,6 +167,10 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
|
|||
}
|
||||
}
|
||||
|
||||
GST_DEBUG_OBJECT (v4l2object->element, " '%s', fps: %d/%d",
|
||||
standard.name, standard.frameperiod.denominator,
|
||||
standard.frameperiod.numerator);
|
||||
|
||||
v4l2norm = g_object_new (GST_TYPE_V4L2_TUNER_NORM, NULL);
|
||||
norm = GST_TUNER_NORM (v4l2norm);
|
||||
norm->label = g_strdup ((const gchar *) standard.name);
|
||||
|
|
Loading…
Reference in a new issue