[Bug 785156] v4l2src: May takes a lot of time to start with certain USB UVC cameras

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Thu Jul 20 02:46:47 UTC 2017


https://bugzilla.gnome.org/show_bug.cgi?id=785156

--- Comment #7 from Nicolas Dufresne (stormer) <nicolas at ndufresne.ca> ---
Created attachment 355998
  --> https://bugzilla.gnome.org/attachment.cgi?id=355998&action=edit
v4l2src: Speedup camera startup by skipping try_fmt

In this commit, we enabled skip_try_fmt_probes quirk in order to speed
up the start which is known to be disastrously slow with certain USB
cameras.

This has the side effect that we needed to rewrite the entire
negotiation process in a way that we iterate over the possible caps
until we find one that works.

The new negotiation method consist of extracting a preferred structure
from the peer caps and using this to fixate and sort the caps. To
reflect the old behaviour, we sort all resolution strictly bigger
to the preferred one with the closes one first. The rest is appended,
keeping the same order. We then normalize the caps in case there was
some list of interlace-mode or colorimetry left. We finally iterate
over all fixed caps and try it. 99% of the time, the first or the
second one should work, whit the result of a single S_FMT being issues.

>From there, it will be relatively easy to introduce new negotiation
algorithm. The current algorithm is made for optimal image quality
with a scaling sink that sets it's window resolution as preference.
This the case if for:

  v4l2src ! videoconvert ! videoscale ! ximagesink

Other strategy would be needed to optimize for non-scaling sink like
ximagesink or kmssink when the driver does not scale.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list