Sam Lantinga
da027ec3ee
Fixed signed/unsigned comparison warning
2024-03-19 17:00:46 -07:00
Sam Lantinga
33eaddc565
Cleaned up various type conversion issues
...
This makes sure SDL_PixelFormatEnum flows through the internal code correctly, as well as fixing a number of other minor issues.
2024-03-07 06:58:43 -08:00
Anonymous Maarten
279a650fae
mediafoundation: fix SDL_camera_mediafoundation MinGW compile warnings
2024-02-22 07:18:22 -05:00
Sam Lantinga
78ac14124c
Fixed warning C4245: 'function': conversion from 'int' to 'DWORD', signed/unsigned mismatch
2024-02-21 22:21:06 -08:00
Ozkan Sezer
3b7533f4a2
SDL_camera_v4l2: allow building against older kernel headers
2024-02-22 00:50:40 +03:00
Ryan C. Gordon
26ffbe43c2
camera: turn OFF `DEBUG_CAMERA` debug logging.
2024-02-20 16:09:02 -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
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
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
47313bba32
camera: SDL_GetCameraDevices should not report "no devices" like an error.
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
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
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
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