Commit Graph

148 Commits

Author SHA1 Message Date
Eddy Jansson
23fec649c2 Fix typos in comments. 2026-01-30 07:25:02 -08:00
Sam Lantinga
5f086e7623 Updated copyright for 2026 2026-01-01 09:40:08 -08:00
Anonymous Maarten
9dd3e2305e dlnote: embed trailing semicolon in SDL_ELF_NOTE_DLOPEN macro 2025-12-24 23:45:50 +03:00
Qiu Qiang
62639fdf88 Improve camera frame rate matching on macOS
- Prefer formats with narrower frame rate ranges
- Set frame duration on both device and connection
  for better enforcement
2025-12-08 21:03:09 -08:00
Ryan C. Gordon
4194879df1 surface: Surface rotation property should be float, not int.
Adjusted camera internals to work in floats, too.

Reference Issue #14616.
2025-12-07 22:25:08 -05:00
Qiu Qiang
19988c5faa Fix loop variable bug in V4L2 camera format enumeration 2025-12-07 14:11:27 -08:00
Ryan C. Gordon
2c11d62d17 camera: Report rotation needed to account for device orientation.
Fixes #11476.
2025-12-06 13:51:10 -05:00
Anonymous Maarten
e221905195 Fix check_stdlib_usage.py libc call matching
It now matches libc usage inside statements,
and skips libc-like usage in strings or as struct members.
2025-11-25 01:07:10 +01:00
Sam Lantinga
4931c675ab Fixed warning C4127 (conditional expression is constant) in Visual Studio 2025-11-17 16:06:58 -08:00
Eddy Jansson
836dad75ae Remove redundant semicolons.
[ci skip]
2025-11-09 07:29:27 -08:00
Ozkan Sezer
616c21d730 SDL_camera_v4l2.c: fix build against old kernel headers. 2025-11-06 18:28:50 +03:00
Yevgen Abramov
04af745fec Add support for V4L2 XB24 (32-bit RGBX) camera format 2025-11-06 07:13:04 -08:00
Yevgen Abramov
b09b557fc6 Fix V4L2 frame rate numerator comparison in SDL3 camera
Signed-off-by: Yevgen Abramov <eabramov84@gmail.com>
2025-11-05 10:56:03 -08:00
Ryan C. Gordon
1191f81a3c camera: Make refcounts more robust, and actually destroy disconnected cameras.
Fixes #14049.
2025-10-10 16:21:59 -04:00
Ryan C. Gordon
09bd8e8a5a camera: Fix Emscripten builds when using -sASYNCIFY.
Thanks to user pancakeswya on GitHub for the patch!

Fixes #13934.
2025-10-09 09:54:48 -04:00
Sam Lantinga
25b2d2c821 Use new parameter validation macro 2025-09-18 20:58:32 -07:00
nightmareci
2f5bc17ea6 Fix support for Windows XP and up (#13904) 2025-09-08 13:00:26 -07:00
Anonymous Maarten
0a6b80717c Record dynamic dependencies in .note.dlopen elf section 2025-08-27 16:11:39 +00:00
Merlyn Morgan-Graham
385715c0dd Introduce enum for SDL_GetCameraPermissionState result 2025-08-25 14:43:31 -04:00
Matthew Zavislak
dc2c83c383 Support Google Play 16 KB Page Size Requirement (#13470)
- See: https://developer.android.com/guide/practices/page-sizes#update-packaging
- Also, make min API uniform at 21 (from 16 and 23 in a few places)
2025-07-31 16:12:54 -07:00
Brenton Bostick
f361034ac3 fix typos 2025-07-27 08:10:03 -07:00
Ryan C. Gordon
07ef532681 hints: Renamed SDL_HINT_LOG_BACKENDS to SDL_DEBUG_LOGGING.
This still logs backend choices, but we might use it for other things. For
example, what Android device is being used, or all the devices we enumerated,
etc.

Ideally this eventually logs all the stuff we often have to ask followup
questions about.
2025-07-22 13:19:30 -04:00
Ryan C. Gordon
10004ab0ea hints: Added SDL_HINT_LOG_BACKENDS.
Fixes #13354.
2025-07-14 19:49:38 -04:00
Sam Lantinga
d7939abf42 Use consistent style for pointer declarations and casts 2025-06-18 10:03:44 -07:00
Sam Lantinga
cf6c42e6e6 Use HEAPU8.set rather than Module.HEAPU8.set (thanks @sbc100!)
The Module object is the external interface to the application, internal symbols like HEAPU8 don't need to be exported to be used and usage should not be prefixed with Module.

Fixes https://github.com/libsdl-org/SDL/issues/13156
Closes https://github.com/libsdl-org/SDL/pull/13157
2025-06-02 09:47:26 -07:00
nmlgc
37b86a6d2f windows: fix Unicode function and type inconsistencies
The surrounding code in all of these instances expects the Unicode
variants. Previously, this code mixed Unicode and ANSI/ASCII calls if
`UNICODE` was undefined, which caused type and logic errors. Explicitly
spelling out the W removes any reliance on that macro.
2025-05-08 07:22:11 -07:00
Simon McVittie
d57aa6f7af pipewire: Don't require pw_check_library_version() with Pipewire < 0.3.75
The Debian 12 'bookworm' stable release only has 0.3.65, which is earlier
than the introduction of that symbol. Similarly, Steam Runtime 3 'sniper'
and Steam Runtime 2 'soldier' have a backport of 0.3.65 from Debian 12,
so they have the same limitation.

steamrt/tasks#686

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-03-03 07:32:19 -08:00
kemal
16f12c0d55 Implement the XDP Camera portal
This helps the Pipewire camera driver to access cameras
in a sandboxed environment without host Pipewire socket access.
Unlike other platforms, no event is sent when the user rejects
camera access. This is because there is no mechanism to query
cameras through the portal, and we only obtain access to the
Pipewire fd if the user accepts the request. The Pipewire driver
will attempt to open the host socket instead.
2025-03-02 08:03:57 -08:00
Ryan C. Gordon
a88105784f camera: Delete some failure code that should have been removed before. 2025-03-01 14:52:56 -05:00
Anonymous Maarten
8a7beca122 camera: clear the spec when closing, so re-opening can probe again 2025-03-01 08:34:01 -08:00
Ozkan Sezer
60c65f9fa4 SDL_camera.c: fix failure-return in SDL_PrepareCameraSurfaces(). 2025-03-01 04:37:02 +03:00
Ryan C. Gordon
725af6ad16 camera: Fixed surface formats, etc, for Emscripten backend.
Fixes #12374.
2025-02-28 16:15:01 -05:00
Sam Lantinga
e50db698e2 Disable all camera drivers if SDL_CAMERA_DISABLED is defined
Fixes https://github.com/libsdl-org/SDL/issues/12182
2025-02-22 09:48:49 -08:00
Sam Lantinga
75bbcbf87b Added support for Motion JPEG pipewire camera capture 2025-02-22 00:23:03 -08:00
Anonymous Maarten
03e00cd347 v4l2: map SDL_PIXELFORMAT_MJPG to V4L2_PIX_FMT_MJPEG 2025-02-21 23:04:13 -08:00
Petar Popovic
c70f54e28b Remove redundant casts 2025-02-21 10:09:10 -08:00
Anonymous Maarten
28f0867948 SPA_FALLTHROUGH expands to nothing when using the Intel compiler 2025-02-21 04:30:19 +01:00
Sam Lantinga
6ef687c864 Simplified and fixed media foundation buffer handling 2025-02-17 08:14:30 -08:00
Sam Lantinga
de12cb92dc Fixed crash at shutdown with new hashtable code 2025-02-17 08:14:30 -08:00
Sam Lantinga
1754943596 Fixed camera frame acquisition on Windows 7
Fixes https://github.com/libsdl-org/SDL/issues/12210
2025-02-16 08:13:35 -08:00
Ryan C. Gordon
84a236c92e hashtable: Redesign the hashtable API.
This was intended to make the API public, so SDL_hashtable.h got an extreme
documentation makeover, but for now this remains a private header.

This makes several significant interface changes to SDL_HashTable, and
improves code that makes use of it in various ways.

- The ability to make "stackable" tables is removed. Apparently this still
  worked with the current implementation, but I could see a future
  implementation struggle mightily to support this. It'll be better for
  something external to build on top of the table if it needs it, inserting a
  linked list of stacked items as the hash values and managing them separately.
  There was only one place in SDL using this, unnecessarily, and that has also
  been cleaned up to not need it.
- You no longer specify "buckets" when creating a table, but rather an
  estimated number of items the table is meant to hold. The bucket count was
  crucial to our classic hashtable implementation, but meant less once we
  moved to an Open Addressing implementation anyhow, since the bucket count
  isn't static (and they aren't really "buckets" anymore either). Now you
  can just report how many items you think the hash will hold and SDL will
  allocate a reasonable default for you...or 0 to not guess, and SDL will
  start small and grow as necessary, which is often the correct thing to do.
- There's no more SDL_IterateHashTableKey because there's no more "stackable"
  hash tables.
- SDL_IterateHashTable() now uses a callback, which matches other parts of SDL,
  and also lets us hold the read-lock for the entire iteration and get rid of
  the goofy iterator state variable.
- SDL_InsertIntoHashTable() now lets you specify whether to replace existing
  keys or fail if the key already exists.
- Callbacks now use SDL conventions (userdata as the first param).
- Other naming convention fixes.

I discovered we use a lot of hash tables in SDL3 internally. :) So the bulk
of this work is fixing up that code to use the new interfaces, and simplifying
things (like checking for an item to remove it if it already exists before
inserting a replacement...just do the insert atomically, it'll do all that
for you!).
2025-02-15 18:52:56 -05:00
Petar Popovic
c16b7bcb7a SDL_Get*Driver() functions: Set error message on failure 2025-02-13 16:10:37 -08:00
Sam Lantinga
84b0c13c44 Added support for Motion JPEG camera capture
Fixes https://github.com/libsdl-org/SDL/issues/12183
2025-02-10 17:18:16 -08:00
Sam Lantinga
8e51b2468a Renamed SDL_SoftStretch() to SDL_StretchSurface()
Fixes https://github.com/libsdl-org/SDL/issues/12168
2025-02-03 08:51:32 -08:00
Timothee Besset
6beda34215 do not build camera drivers if camera support is disabled 2025-01-31 10:24:54 -08:00
Cameron Cawley
e8916b2608 pipewire: Use byte order pixel format aliases 2025-01-09 09:52:30 -05:00
Ryan C. Gordon
344e394bf4 camera: Favor v4l2 over pipewire, for now.
Reference Issue #11473.
Reference Issue #9776.
Reference Issue #11819.
Reference Issue #9989.
Reference Issue #10842.
2025-01-04 16:11:57 -05:00
Sam Lantinga
02e85a153f Use the expected plane size when capturing Android camera frames
On the Samsung Galaxy A52 the camera plane size is (pitch * (h - 1) + w) instead of (pitch * h). This led to us copying off the end of the plane when uploading the texture, so we pad out to our expected size.
2025-01-01 15:58:27 -08:00
Sam Lantinga
f2074d7af3 Updated copyright for 2025 2025-01-01 07:45:52 -08:00
L zard
f2b7495adc SDL_camera_pipewire: use SDL_CAMERA_DRIVER_PIPEWIRE_DYNAMIC 2024-12-24 07:19:38 -08:00