• Max Staudt's avatar
    media: vivid: Extend FPS rates offered by simulated webcam · f0b4a2c0
    Max Staudt authored
    
    
    This adds an option for higher frame rates from a simulated webcam.
    
    Currently, vivid emulates (amongst other things) a webcam with somewhat
    limited bandwidth - higher resolutions deliver fewer frames per second.
    
    $ yavta --enum-formats -c /dev/video0
    Device /dev/video0 opened.
    Device `vivid' on `platform:vivid-000' (driver 'vivid') supports video, capture, without mplanes.
    - Available formats:
    	Format 0: YUYV (56595559)
    	Type: Video capture (1)
    	Name: YUYV 4:2:2
    	Frame size: 320x180 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15, 1/25, 1/30, 1/40, 1/50, 1/60)
    	Frame size: 640x360 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15, 1/25, 1/30, 1/40)
    	Frame size: 640x480 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15, 1/25)
    	Frame size: 1280x720 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25)
    	Frame size: 1920x1080 (1/1, 1/2, 1/4, 1/5)
    	Frame size: 3840x2160 (1/1, 1/2)
    
    In some test cases, it is useful to allow for higher frame rates, as
    configurations such as 720p@30 FPS have become commonplace now.
    
    This patch allows:
       0- 719p - 120fps
     720-1079p - 60fps
    1080-2159p - 30fps
         2160p - 15fps
    
    $ yavta --enum-formats -c /dev/video0
    Device /dev/video0 opened.
    Device `vivid' on `platform:vivid-000' (driver 'vivid') supports video, capture, without mplanes.
    - Available formats:
    	Format 0: YUYV (56595559)
    	Type: Video capture (1)
    	Name: YUYV 4:2:2
    	Frame size: 320x180 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15, 1/25, 1/30, 1/40, 1/50, 1/60, 1/120)
    	Frame size: 640x360 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15, 1/25, 1/30, 1/40, 1/50, 1/60, 1/120)
    	Frame size: 640x480 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15, 1/25, 1/30, 1/40, 1/50, 1/60, 1/120)
    	Frame size: 1280x720 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15, 1/25, 1/30, 1/40, 1/50, 1/60)
    	Frame size: 1920x1080 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15, 1/25, 1/30)
    	Frame size: 3840x2160 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15)
    
    Passes: v4l2-compliance 1.25.0-5039 from v4l-utils git ccc08732823f
    Signed-off-by: default avatarMax Staudt <mstaudt@chromium.org>
    Reviewed-by: default avatarRicardo Ribalda <ribalda@chromium.org>
    Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
    [hverkuil: unsigned -> unsigned int]
    f0b4a2c0
vivid-vid-cap.c 47.5 KB