After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 702638 - v4l2: Optimize negotiation by removing the query filter
v4l2: Optimize negotiation by removing the query filter
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.1.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-06-19 10:52 UTC by Sjoerd Simons
Modified: 2013-07-02 08:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (1.48 KB, patch)
2013-06-19 10:52 UTC, Sjoerd Simons
committed Details | Review

Description Sjoerd Simons 2013-06-19 10:52:40 UTC
Created attachment 247250 [details] [review]
proposed patch

As cameras tend to have a quite specific set of capabilities (specific
framerates for each resolution), getting the peer caps filtered by our
probed caps can cause a big increase in the caps size which slows down
things quire a bit.
    
As for negotiation v4l2 iterates through the caps of the peer to find the
first intersection with the probed caps, getting the fully expanded
intersection of capabilities is not useful.
    
Using the same testcase as for bug #702632, adding this patch on top of
the patches suggested there speeds up getting the inital frame from
around ~14-15 seconds to around ~3-4 seconds.
Comment 1 Sebastian Dröge (slomo) 2013-06-19 11:01:07 UTC
But shouldn't the filter actually cause more restricted caps to be passed between elements, and thus usually create smaller caps?
Comment 2 Sjoerd Simons 2013-06-19 11:56:57 UTC
The problem here is that the camera caps are quite specific e.g (my camera has 28 different resolutions it can do, both in YUYV and MJPG (56 caps entries), which about doubles again once you start doing the emulated formats through libv4l).

All these tend to be of the following form, so don't easily simplify:
video/x-raw, height=1280,width=720, framerate=15/1,
 video/x-raw,height=640, width=320, framerate=30/1.
 etc etc.

While the remainder of the pipeline has a bunch of transform elements, so the "full" set will be all the original entries expanded with all the possible transformations.. Which turns out to be a lot...
Comment 3 Sebastian Dröge (slomo) 2013-06-19 12:08:33 UTC
Ok, fine then :)
Comment 4 Sjoerd Simons 2013-06-19 13:09:09 UTC
commit 8e43c0ec9ea627d3cea0cecf6d3e168bf4d5d09e
Author: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Date:   Wed Jun 19 12:37:31 2013 +0200

    v4l2: Optimize negotiation by removing the query filter
    
    As cameras tend to have a quite specific set of capabilities (specific
    framerates for each resolution), getting the peer caps filtered by our
    probed caps can cause a big increase in the caps size which slows down
    things quire a bit.
    
    As for negotiation v4l2 iterates through the caps of the peer to find the
    first intersection with the probed caps, getting the fully expanded
    intersection of capabilities is not useful.
    
    Using the same testcase as for bug #702632, adding this patch on top of
    the patches suggested there speeds up getting the inital frame from
    around ~14-15 seconds to around ~3-4 seconds.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=702638
Comment 5 Wim Taymans 2013-06-19 14:20:52 UTC
Maybe instead of doing the full filter, you can filter it by only the format, for example.
Comment 6 Sebastian Dröge (slomo) 2013-07-01 07:59:46 UTC
Sjoerd?
Comment 7 Sebastian Dröge (slomo) 2013-07-02 08:38:12 UTC
(In reply to comment #5)
> Maybe instead of doing the full filter, you can filter it by only the format,
> for example.

You mean passing a filter with just video/x-raw,format={A, B, C} downstream instead of the multi-structure, large filter? Would make sense IMHO