mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-09 16:02:59 +00:00
Merge branch 'master' into 0.11
Conflicts: sys/v4l2/v4l2src_calls.c
This commit is contained in:
commit
5b55cf057b
1 changed files with 31 additions and 30 deletions
|
@ -2291,37 +2291,38 @@ gst_v4l2_object_set_format (GstV4l2Object * v4l2object, GstCaps * caps)
|
||||||
streamparm.parm.capture.timeperframe.denominator,
|
streamparm.parm.capture.timeperframe.denominator,
|
||||||
streamparm.parm.capture.timeperframe.numerator);
|
streamparm.parm.capture.timeperframe.numerator);
|
||||||
|
|
||||||
/* Note: V4L2 provides the frame interval, we have the frame rate */
|
/* We used to skip frame rate setup if the camera was already setup
|
||||||
if (!fractions_are_equal (streamparm.parm.capture.timeperframe.numerator,
|
* with the requested frame rate. This breaks some cameras though,
|
||||||
streamparm.parm.capture.timeperframe.denominator, fps_d, fps_n)) {
|
* causing them to not output data (several models of Thinkpad cameras
|
||||||
GST_LOG_OBJECT (v4l2object->element, "Setting framerate to %u/%u", fps_n,
|
* have this problem at least).
|
||||||
fps_d);
|
* So, don't skip. */
|
||||||
/* We want to change the frame rate, so check whether we can. Some cheap USB
|
GST_LOG_OBJECT (v4l2object->element, "Setting framerate to %u/%u", fps_n,
|
||||||
* cameras don't have the capability */
|
fps_d);
|
||||||
if ((streamparm.parm.capture.capability & V4L2_CAP_TIMEPERFRAME) == 0) {
|
/* We want to change the frame rate, so check whether we can. Some cheap USB
|
||||||
GST_DEBUG_OBJECT (v4l2object->element,
|
* cameras don't have the capability */
|
||||||
"Not setting framerate (not supported)");
|
if ((streamparm.parm.capture.capability & V4L2_CAP_TIMEPERFRAME) == 0) {
|
||||||
goto done;
|
GST_DEBUG_OBJECT (v4l2object->element,
|
||||||
}
|
"Not setting framerate (not supported)");
|
||||||
|
goto done;
|
||||||
/* Note: V4L2 wants the frame interval, we have the frame rate */
|
|
||||||
streamparm.parm.capture.timeperframe.numerator = fps_d;
|
|
||||||
streamparm.parm.capture.timeperframe.denominator = fps_n;
|
|
||||||
|
|
||||||
/* some cheap USB cam's won't accept any change */
|
|
||||||
if (v4l2_ioctl (fd, VIDIOC_S_PARM, &streamparm) < 0)
|
|
||||||
goto set_parm_failed;
|
|
||||||
|
|
||||||
/* get new values */
|
|
||||||
fps_d = streamparm.parm.capture.timeperframe.numerator;
|
|
||||||
fps_n = streamparm.parm.capture.timeperframe.denominator;
|
|
||||||
|
|
||||||
GST_INFO_OBJECT (v4l2object->element, "Set framerate to %u/%u", fps_n,
|
|
||||||
fps_d);
|
|
||||||
|
|
||||||
GST_VIDEO_INFO_FPS_N (&info) = fps_n;
|
|
||||||
GST_VIDEO_INFO_FPS_D (&info) = fps_d;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Note: V4L2 wants the frame interval, we have the frame rate */
|
||||||
|
streamparm.parm.capture.timeperframe.numerator = fps_d;
|
||||||
|
streamparm.parm.capture.timeperframe.denominator = fps_n;
|
||||||
|
|
||||||
|
/* some cheap USB cam's won't accept any change */
|
||||||
|
if (v4l2_ioctl (fd, VIDIOC_S_PARM, &streamparm) < 0)
|
||||||
|
goto set_parm_failed;
|
||||||
|
|
||||||
|
/* get new values */
|
||||||
|
fps_d = streamparm.parm.capture.timeperframe.numerator;
|
||||||
|
fps_n = streamparm.parm.capture.timeperframe.denominator;
|
||||||
|
|
||||||
|
GST_INFO_OBJECT (v4l2object->element, "Set framerate to %u/%u", fps_n,
|
||||||
|
fps_d);
|
||||||
|
|
||||||
|
GST_VIDEO_INFO_FPS_N (&info) = fps_n;
|
||||||
|
GST_VIDEO_INFO_FPS_D (&info) = fps_d;
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
|
Loading…
Reference in a new issue