[vlc-devel] [vlc-commits] v4l2: fix step-wise and continuous frame sizes enumeration

Rémi Denis-Courmont remi at remlab.net
Mon Oct 31 19:29:46 CET 2011


Le lundi 31 octobre 2011 18:59:09 Rémi Denis-Courmont, vous avez écrit :
> vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Oct 31
> 18:55:46 2011 +0200| [8853c7521d3c7e2ebe762a5024fae0edea937f46] |
> committer: Rémi Denis-Courmont
> 
> v4l2: fix step-wise and continuous frame sizes enumeration
> 
> Width and height are independent for step-wise frame sizes (yes,
> enumerating is slow). Continuous frame sizes are step-size with one
> pixel steps for both dimensions (yes, enumerationg is very slow).

Unfortunately, this could reallistically result in millions of system calls: 
basically chromas times widths times heights times intervals, and as many 
lines worth of debug messages.

If we assume that the frame rate is an inverse function of the pixel counts, 
possibly bounded to a maximum, then we could make a dichotomic search:
Use the largest resolution that offers the same frame rate as the minimum 
resolution. The maths are not completely trivial has there are two variables, 
but it can be done. On the other hand, there is no explicit warranty that the 
frame rate matches such a mathematical model.

We could alternatively fix the aspect ratio to that of the maximum resolution 
and enumerate the resolution linearly (instead of bilinearly). This assumes 
said aspect ratio is the best one. The specification does not really tell 
which aspect ratio is isotropic and/or does not crop though.

-- 
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis



More information about the vlc-devel mailing list