Commit 27e20ead authored by Edward Hervey's avatar Edward Hervey 🤘
Browse files

sys/v4l2/gstv4l2src.c: Add warning messages stating exactly why the latency query failed.

Original commit message from CVS:
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_query):
Add warning messages stating exactly why the latency query failed.
* sys/v4l2/v4l2src_calls.c: (gst_v4l2src_set_capture):
In some cases, the negotiated framerate might be the default one which
is already set internally. But we still need to mark it down in fps_n
and fps_d so that the latency query can happen properly.
parent a7d73b26
2008-08-12 Edward Hervey <edward.hervey@collabora.co.uk>
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_query):
Add warning messages stating exactly why the latency query failed.
* sys/v4l2/v4l2src_calls.c: (gst_v4l2src_set_capture):
In some cases, the negotiated framerate might be the default one which
is already set internally. But we still need to mark it down in fps_n
and fps_d so that the latency query can happen properly.
2008-08-12 Edward Hervey <edward.hervey@collabora.co.uk> 2008-08-12 Edward Hervey <edward.hervey@collabora.co.uk>
   
* docs/plugins/inspect/plugin-1394.xml: * docs/plugins/inspect/plugin-1394.xml:
......
...@@ -1071,12 +1071,18 @@ gst_v4l2src_query (GstBaseSrc * bsrc, GstQuery * query) ...@@ -1071,12 +1071,18 @@ gst_v4l2src_query (GstBaseSrc * bsrc, GstQuery * query)
GstClockTime min_latency, max_latency; GstClockTime min_latency, max_latency;
/* device must be open */ /* device must be open */
if (!GST_V4L2_IS_OPEN (src->v4l2object)) if (!GST_V4L2_IS_OPEN (src->v4l2object)) {
GST_WARNING_OBJECT (src,
"Can't give latency since device isn't open !");
goto done; goto done;
}
/* we must have a framerate */ /* we must have a framerate */
if (src->fps_n <= 0 || src->fps_d <= 0) if (src->fps_n <= 0 || src->fps_d <= 0) {
GST_WARNING_OBJECT (src,
"Can't give latency since framerate isn't fixated !");
goto done; goto done;
}
/* min latency is the time to capture one frame */ /* min latency is the time to capture one frame */
min_latency = min_latency =
......
...@@ -1214,7 +1214,9 @@ gst_v4l2src_set_capture (GstV4l2Src * v4l2src, guint32 pixelformat, ...@@ -1214,7 +1214,9 @@ gst_v4l2src_set_capture (GstV4l2Src * v4l2src, guint32 pixelformat,
/* Note: V4L2 provides the frame interval, we have the frame rate */ /* Note: V4L2 provides the frame interval, we have the frame rate */
if (fractions_are_equal (stream.parm.capture.timeperframe.numerator, if (fractions_are_equal (stream.parm.capture.timeperframe.numerator,
stream.parm.capture.timeperframe.denominator, fps_d, fps_n)) { stream.parm.capture.timeperframe.denominator, fps_d, fps_n)) {
GST_LOG_OBJECT (v4l2src, "Desired framerate already set, nothing to do"); GST_LOG_OBJECT (v4l2src, "Desired framerate already set");
v4l2src->fps_n = fps_n;
v4l2src->fps_d = fps_d;
goto done; goto done;
} }
......
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