mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-10 02:55:36 +00:00
ab6dd970ac8a427c1aafb5f2f66ac6cce8fc4bf4
V4L2 is able to advertise that a video device is able to display any frame interval within a continuous range. SDL does not allow advertising this and only exposes discrete frame intervals. To work around this, SDL attempted to generate a subset of the range with a fixed interval. Unfortunately, the way this was accomplish is inherently broken and led to attempting to allocate a very large number of formats per resolution and colorspace. With the Magewell Pro Capture HDMI, which can expose FRMSIZE_TYPE_CONTINUOUS as well, this can expose a truly astronomical number of formats, exceeding 1 PB of RAM. This will lead to an OOM kill for any process that tries to initialize the camera subsystem. This patch just tests to see if some common frame rates are within the contiuous range and expose those. SDL still does not handle FRMSIZE_TYPE_CONTINUOUS in a graceful way so it still uses over a gigabyte of RAM for each possible combination of sizes, but with this patch it no longer leads to an OOM kill. The API will need amending for proper support for both continuous frame sizes and frame intervals.
Simple DirectMedia Layer (SDL for short) is a cross-platform library designed to make it easy to write multi-media software, such as games and emulators.
You can find the latest release and additional information at: https://www.libsdl.org/
Installation instructions and a quick introduction is available in INSTALL.md
This library is distributed under the terms of the zlib license, available in LICENSE.txt.
Enjoy!
Sam Lantinga (slouken@libsdl.org)
Languages
C
85.8%
C++
6.6%
Objective-C
3.3%
CMake
1.6%
Perl
0.7%
Other
1.7%