mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-13 15:12:58 +00:00
sys/v4l2/: Numerator is numerator and denominator is denominator. Say that aloud 5 times and retry after next beer.
Original commit message from CVS: * sys/v4l2/v4l2_calls.c: (gst_v4l2_fill_lists): * sys/v4l2/v4l2src_calls.c: (gst_v4l2src_set_fps), (gst_v4l2src_get_fps): Numerator is numerator and denominator is denominator. Say that aloud 5 times and retry after next beer.
This commit is contained in:
parent
d14571a4a8
commit
2d2802aa8d
3 changed files with 22 additions and 14 deletions
|
@ -1,3 +1,11 @@
|
|||
2006-10-17 Stefan Kost <ensonic@users.sf.net>
|
||||
|
||||
* sys/v4l2/v4l2_calls.c: (gst_v4l2_fill_lists):
|
||||
* sys/v4l2/v4l2src_calls.c: (gst_v4l2src_set_fps),
|
||||
(gst_v4l2src_get_fps):
|
||||
Numerator is numerator and denominator is denominator. Say that aloud
|
||||
5 times and retry after next beer.
|
||||
|
||||
2006-10-16 Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
||||
Patch by: Josep Torra Valles <josep at fluendo com>
|
||||
|
|
|
@ -153,8 +153,8 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
|
|||
GstTunerNorm *norm;
|
||||
|
||||
/* fill in defaults */
|
||||
standard.frameperiod.denominator = 0;
|
||||
standard.frameperiod.numerator = 1;
|
||||
standard.frameperiod.numerator = 0;
|
||||
standard.frameperiod.denominator = 1;
|
||||
standard.index = n;
|
||||
if (ioctl (v4l2object->video_fd, VIDIOC_ENUMSTD, &standard) < 0) {
|
||||
if (errno == EINVAL)
|
||||
|
@ -167,15 +167,15 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
|
|||
}
|
||||
}
|
||||
|
||||
GST_DEBUG_OBJECT (v4l2object->element, " '%s', fps: %d/%d",
|
||||
standard.name, standard.frameperiod.denominator,
|
||||
standard.frameperiod.numerator);
|
||||
GST_DEBUG_OBJECT (v4l2object->element, " '%s', fps: %d / %d",
|
||||
standard.name, standard.frameperiod.numerator,
|
||||
standard.frameperiod.denominator);
|
||||
|
||||
v4l2norm = g_object_new (GST_TYPE_V4L2_TUNER_NORM, NULL);
|
||||
norm = GST_TUNER_NORM (v4l2norm);
|
||||
norm->label = g_strdup ((const gchar *) standard.name);
|
||||
gst_value_set_fraction (&norm->framerate,
|
||||
standard.frameperiod.denominator, standard.frameperiod.numerator);
|
||||
standard.frameperiod.numerator, standard.frameperiod.denominator);
|
||||
v4l2norm->index = standard.id;
|
||||
|
||||
v4l2object->norms = g_list_append (v4l2object->norms, (gpointer) norm);
|
||||
|
|
|
@ -728,7 +728,7 @@ gst_v4l2src_set_fps (GstV4l2Src * v4l2src, guint * fps_n, guint * fps_d)
|
|||
GstV4l2Object *v4l2object = v4l2src->v4l2object;
|
||||
struct v4l2_streamparm stream;
|
||||
|
||||
GST_LOG_OBJECT (v4l2src, "setting fps %d, %d", *fps_n, *fps_d);
|
||||
GST_LOG_OBJECT (v4l2src, "setting fps %d / %d", *fps_n, *fps_d);
|
||||
|
||||
memset (&stream, 0x00, sizeof (struct v4l2_streamparm));
|
||||
stream.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||
|
@ -738,16 +738,16 @@ gst_v4l2src_set_fps (GstV4l2Src * v4l2src, guint * fps_n, guint * fps_d)
|
|||
if (!(stream.parm.capture.capability & V4L2_CAP_TIMEPERFRAME))
|
||||
goto no_timeperframe;
|
||||
|
||||
stream.parm.capture.timeperframe.denominator = *fps_n;
|
||||
stream.parm.capture.timeperframe.numerator = *fps_d;
|
||||
stream.parm.capture.timeperframe.numerator = *fps_n;
|
||||
stream.parm.capture.timeperframe.denominator = *fps_d;
|
||||
|
||||
if (ioctl (v4l2object->video_fd, VIDIOC_S_PARM, &stream) < 0)
|
||||
goto sparm_failed;
|
||||
|
||||
*fps_n = stream.parm.capture.timeperframe.denominator;
|
||||
*fps_d = stream.parm.capture.timeperframe.numerator;
|
||||
*fps_n = stream.parm.capture.timeperframe.numerator;
|
||||
*fps_d = stream.parm.capture.timeperframe.denominator;
|
||||
|
||||
GST_LOG_OBJECT (v4l2src, "fps set to %d, %d", *fps_n, *fps_d);
|
||||
GST_LOG_OBJECT (v4l2src, "fps set to %d / %d", *fps_n, *fps_d);
|
||||
|
||||
return TRUE;
|
||||
|
||||
|
@ -796,8 +796,8 @@ gst_v4l2src_get_fps (GstV4l2Src * v4l2src, guint * fps_n, guint * fps_d)
|
|||
}
|
||||
|
||||
/* Note: V4L2 gives us the frame interval, we need the frame rate */
|
||||
*fps_n = stream.parm.capture.timeperframe.denominator;
|
||||
*fps_d = stream.parm.capture.timeperframe.numerator;
|
||||
*fps_n = stream.parm.capture.timeperframe.numerator;
|
||||
*fps_d = stream.parm.capture.timeperframe.denominator;
|
||||
|
||||
GST_DEBUG_OBJECT (v4l2src,
|
||||
"frame rate returned by G_PARM: %d/%d fps", *fps_n, *fps_d);
|
||||
|
|
Loading…
Reference in a new issue