Commit Graph

14661 Commits (7eca84d57ed30b320d6c36c34557d48f448cfee0)

Author SHA1 Message Date
Anonymous Maarten 7eca84d57e cmake: don't use target_compile_features when the CMake thinks the compiler does not support it
This happens when using an older CMake with a new LLVM toolchain (e.g. Android ndk)
2024-02-21 00:51:40 +01:00
Anonymous Maarten cbf0b1ce81 testcamera: create window and renderer through test library 2024-02-21 00:49:15 +01:00
Anonymous Maarten ecfbb6719f SDL_test: support SDL_INIT_CAMERA for SDL_CommonInit and SDL_CommonQuit 2024-02-21 00:49:15 +01:00
Ryan C. Gordon 26ffbe43c2
camera: turn OFF `DEBUG_CAMERA` debug logging. 2024-02-20 16:09:02 -05:00
SDL Wiki Bot 31fe061ab5 Sync SDL3 wiki -> header 2024-02-20 20:57:27 +00:00
Ryan C. Gordon f59c66a97f testcamera: Allow app to flip between a front and back camera. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon 6296677bc9 camera: Fixed Android hotplug. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon 6c080717f2 camera: Reset permissions to undecided when closing camera.
Otherwise, the permission-granted event will not fire when reopened.
2024-02-20 15:56:26 -05:00
Ryan C. Gordon db8caa029b camera: Added new function with gendynapi.py. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon 70b89ab70d camera: Added SDL_GetCameraDevicePosition.
Otherwise, as a property, you have to open each camera device to figure out
which ones are which.
2024-02-20 15:56:26 -05:00
Ryan C. Gordon b1ed49772c camera: Replace testcamera.c with testcameraminimal.c 2024-02-20 15:56:26 -05:00
Ryan C. Gordon bdcddf4810 camera: Disconnected cameras become zombies that feed blank frames. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon 2613e3da24 camera: Rewrote Android support.
This does something a little weird, in that it doesn't care what
`__ANDROID_API__` is set to, but will attempt to dlopen the system
libraries, like we do for many other platform-specific pieces of SDL.

This allows us to a) not bump the minimum required Android version, which is
extremely ancient but otherwise still working, doing the right thing on old
and new hardware in the field, and b) not require the app to link against
more libraries than it previously did before the feature was available.

The downside is that it's a little messy, but it's okay for now, I think.
2024-02-20 15:56:26 -05:00
Ryan C. Gordon 848dcf8a5f main: Fixed compiler warning on Android.
(the NDK got upset about a function with void params using a bare `()`.)
2024-02-20 15:56:26 -05:00
Ryan C. Gordon 47313bba32 camera: SDL_GetCameraDevices should not report "no devices" like an error. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon f3485a47b3 android: Add src/main/ files to Android.mk 2024-02-20 15:56:26 -05:00
Ryan C. Gordon 8db2a3b27a camera: Add an optional property that reports if a camera is back or front.
This is useful for iOS and Android, so an app can find the camera it cares
about in the list of devices.
2024-02-20 15:56:26 -05:00
Ryan C. Gordon 0b8617f71d test: Fixed CMake to build testcameraminimal correctly on WinRT. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon 99d1337de2 camera: Reenabled macOS/iOS support, with rewritten CoreMedia implementation. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon f8fa08d2b1 camera: Fix compiler warnings on some platforms. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon 22dbc0f32f camera: Patched to compile after rebasing to latest in main. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon 7191a97fe3 camera: Windows support, through the Media Foundation API! 2024-02-20 15:56:26 -05:00
Ryan C. Gordon 3dca8a03da camera: Removed some debug logging. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon 67708f9110 camera: Emscripten support!
This also adds code to deal with waiting for the user to approve camera
access, reworks testcameraminimal to use main callbacks, etc.
2024-02-20 15:56:26 -05:00
Ryan C. Gordon 182f707284 include: Fixed doxygen comments on new camera APIs. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon 2cdff93578 v4l2: Corrected SDL_UDEV_AddCallback return check after #8694. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon 0b5875825e camera: framerate support. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon 9ae39d52de camera: Add sources to Xcode and Visual Studio projects.
This still needs updates to actually compile on macOS/iOS, though!
2024-02-20 15:56:26 -05:00
Ryan C. Gordon 87e7046fca camera: Public API functions should say "Format" not "Spec" to match audio. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon f87d536229 camera: Added more accurate timestamps. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon d3e6ef3cc6 camera: Massive code reworking.
- Simplified public API, simplified backend interface.
- Camera device hotplug events.
- Thread code is split up so it backends that provide own threads can use it.
- Added "dummy" backend.

Note that CoreMedia (Apple) and Android backends need to be updated, as does
the testcamera app (testcameraminimal works).
2024-02-20 15:56:26 -05:00
Ryan C. Gordon 3d2d5d18f3 pixels: Packed-pixel YUV formats can legit report bits-per-pixel.
This makes the existing SDL_SoftStretch code work with them, at least for
nearest-neighbor scaling; otherwise, it'll mangle the data trying to scale
it as 8bpp data without warning.
2024-02-20 15:56:26 -05:00
Ryan C. Gordon 8e1758260c surface: Fixed a typo in a comment. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon cb10c80aaf camera: Reworked to operate with a driver interface, like other subsystems. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon 2ad44bd162 camera: Made a pass over all the sources, cleaning up for SDL3 style, etc. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon 7ae955ce68 camera: Renamed everything from "video capture" to "camera", wired to CMake. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon f49ce4a15d camera: Renamed "video_capture" files to "camera" and moved to own subdir. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon 4d000ae3bd
audio: Change references to `streams[i]` to previously-calculated `stream`.
Reference PR #9096.
2024-02-20 15:30:01 -05:00
Mathieu Eyraud 751917cb6f Fix null pointer dereference in SDL_BindAudioStreams() 2024-02-20 15:14:07 -05:00
Frank Praznik 8b6eae2d4f cmake: Split and store the libdecor version as individual parts
It is becoming necessary to enable additional features as libdecor continues to evolve, and checking against a single base version will no longer be adequate. Libdecor doesn't provide versioning defines in its headers, so split the version string into parts to allow for discrete version detection and feature enablement at build time.
2024-02-20 11:28:02 -05:00
Sam Lantinga 8073f4aa1d Pass the real error from D3D12_CreatePipelineState() back to the application 2024-02-20 06:24:20 -08:00
Sam Lantinga 376ef4e418 Fixed the WGI driver picking up Xbox controllers handled by RAWINPUT
The WGI driver will see them first, but the RAWINPUT driver has higher priority, so we'll defer to that when it's available.

Fixes https://github.com/libsdl-org/SDL/issues/9091
2024-02-20 06:20:32 -08:00
Ozkan Sezer cb3a1a82d5 SDL_memcpy.c, SDL_memmove.c, SDL_memset.c: don't use gcc builtins if !HAVE_LIBC
__builtin_memcpy, as well as __builtin_memset and __builtin_memmove, needn't be
inlined but emitted as a libc call, leading to infinitely recursive calls.

Fixes https://github.com/libsdl-org/SDL/issues/9090
2024-02-20 01:23:18 +03:00
Sam Lantinga bb4ec5250f Added support for non-gamepad controllers to the GameInput driver 2024-02-17 22:32:44 -08:00
Sam Lantinga f63f99bd2d Setup to handle the guide button once we get an updated GameInput SDK 2024-02-17 21:55:10 -08:00
Sam Lantinga ae8a910781 Added infrastructure for reporting GameInput touchpads
PlayStation controllers don't seem to report touch info, so we'll need to figure out how to interpret the touch data once it's available.
2024-02-17 21:21:54 -08:00
Sam Lantinga ae4aa25082 Get the real GameInput device name if possible 2024-02-17 20:12:46 -08:00
Sam Lantinga 419aebebda Added infrastructure for reporting GameInput sensors
IGameInputReading::GetMotionState() isn't implemented yet, so we'll need to figure out how to interpret the motion data once it's available.
2024-02-17 20:12:46 -08:00
Sam Lantinga 85ac0381b7 IGameInputDevice::GetDeviceInfo() can never return a null pointer
The IGameInputDevice instance can't be internally instantiated without it, so it's always guaranteed to be present.
2024-02-17 20:12:14 -08:00
Sam Lantinga fbe4153214 The HIDAPI driver takes precedence over the GameInput driver
The HIDAPI driver has more functionality for supported controllers.
2024-02-17 19:13:04 -08:00