Commit Graph

14068 Commits (cbf9012c74c2e2babd3c48386dc42e3e4384337d)

Author SHA1 Message Date
Sam Lantinga efa9a45048 Clarified that testffmpeg will resize the window to the video size 2023-10-11 23:38:08 -07:00
Sam Lantinga 4368f70ff9 Added properties to various SDL objects
The following objects now have properties that can be user modified:
* SDL_AudioStream
* SDL_Gamepad
* SDL_Joystick
* SDL_RWops
* SDL_Renderer
* SDL_Sensor
* SDL_Surface
* SDL_Texture
* SDL_Window
2023-10-11 22:38:00 -07:00
Sam Lantinga 973c8b3273 Added SDL properties API
Fixes https://github.com/libsdl-org/SDL/issues/7799
2023-10-11 22:38:00 -07:00
Ryan C. Gordon 2bca4671a6
audio: Allow audio streams to be created when the subsystem isn't initialized.
You are on your own to destroy them, though!
2023-10-11 22:43:53 -04:00
Anonymous Maarten 1ae33f6751 cmake: optionally install pdb's 2023-10-12 02:26:48 +02:00
Sam Lantinga 0d5cad91b1 We need audio converters initialized in SDL_InitAudio()
These are used separately from audio streams, e.g. SDL_OutputAudioThreadIterate(), so they should always be initialized when audio is initialized.
2023-10-11 15:11:34 -07:00
Ryan C. Gordon 1c3a0ade74
audio: Whoops, this stream format change is only for capture devices. 2023-10-11 15:11:20 -04:00
Ryan C. Gordon 10fab3a39e
pulseaudio: Stop the threaded mainloop before destroying the context.
Otherwise, we might trigger an assertion in libpulse.

Reference Issue #8348.
2023-10-11 14:32:47 -04:00
Sam Lantinga 0b71898cb1 Make it clear that the string comparison isn't a boolean check 2023-10-11 10:18:12 -07:00
Sam Lantinga 6c8ad975c7 Like mutexes, operations on NULL rwlocks are no-ops
Fixes a crash when performing operations on a NULL rwlock before rwlock implementation is chosen
2023-10-11 09:49:44 -07:00
Sam Lantinga c552cc6847 We don't require the audio system to be initialized for audio format conversion
This is helpful for tools pipelines where audio devices are never used.
2023-10-11 09:23:23 -07:00
Frank Praznik 9a5f7b17c6 Use SDL wrapped getenv function 2023-10-11 11:23:24 -04:00
Ryan C. Gordon 044046bc50
audio: Fixed assertions when capture devices have wrong audio formats.
Fixes #8376.
2023-10-11 10:37:28 -04:00
Ryan C. Gordon bb2f767f5d
testaudio: Make program usable without a 3-button mouse. 2023-10-11 10:02:07 -04:00
Ryan C. Gordon 321fc18417
README-migration.md: Added note about SDL_HasRDTSC removal.
Fixes #8374.
2023-10-11 01:20:18 -04:00
Ryan C. Gordon 82f54af617
x11: Properly check for XInput2 support before using it.
This specifically fixes a crash in X11_WarpMouseInternal if XInput2 was
missing at runtime, but also cleans up a few other existing checks.

Fixes #8378.
2023-10-11 01:01:07 -04:00
Sam Lantinga b654427537 Added support for the PowerA Nintendo Switch Nano Wired Controller 2023-10-10 17:04:00 -07:00
Sam Lantinga dc2a5f6ab2 Fixed error C2054: expected '(' to follow 'inline' 2023-10-10 16:38:12 -07:00
Sam Lantinga a7ae1de9a6 Fixed warning C4028: formal parameter different from declaration 2023-10-10 16:37:17 -07:00
Sam Lantinga 3a47fb7208 The sensor and joystick instance ID generator isn't guarded by a lock. 2023-10-10 15:46:46 -07:00
Anonymous Maarten aee4862958 ci: stop FreeBSD job after 30 minutes 2023-10-11 00:22:30 +02:00
Sam Lantinga 99fa0d6cae Disable low latency audio by default when using AAudio on Android
Some devices have flat sounding audio when low latency mode is enabled. In particular this was reported on the Samsung SM-T290 running Android 11.
2023-10-10 15:17:58 -07:00
Anonymous Maarten ebfbd7327b testffmpeg: use SDL_test to parse arguments and track memory 2023-10-10 21:58:10 +02:00
Anonymous Maarten ee53e4d319 cmake: check ffmpeg capability instead of version 2023-10-10 21:58:10 +02:00
Sam Lantinga 2d62c65a75 Fixed build warning 2023-10-10 12:37:38 -07:00
Simon McVittie bf72704bfd audio: Disable NEON sample conversion until test failures are fixed
We need to do this early in the file, so that it will be taken into
account when deciding whether to define NEED_SCALAR_CONVERTER_FALLBACKS
and therefore provide a non-SIMD fallback.

Mitigates: https://github.com/libsdl-org/SDL/issues/8352
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-10-10 13:12:55 -04:00
Ryan C. Gordon 0fe95cfba3
Sync wiki -> header 2023-10-10 10:49:24 -04:00
Sam Lantinga adcace6f95 Added a "--software" option to testffmpeg
This allows easy performance comparison between hardware and software decoding
2023-10-10 04:07:22 -07:00
Ozkan Sezer 86ada8a9f0 fix testffmpeg.c build. 2023-10-10 14:02:40 +03:00
Sam Lantinga 303f4e965c testffmpeg works with ffmpeg 5.1.3 and newer 2023-10-10 03:58:57 -07:00
Sam Lantinga 2bd478ae65 Added SDL_GetTextureDXGIResource() to get the DXGI resource associated with a render texture.
Also switched the D3D11 and D3D12 renderers to use real NV12 textures for NV12 data.

The combination of these two changes allows us to implement 0-copy video decode and playback for D3D11 in testffmpeg without any access to the renderer internals.
2023-10-10 03:32:46 -07:00
Sam Lantinga a842446f62 Added support for 0-copy decode and display using D3D11
FIXME: We need a way to do this that doesn't involve reaching into the D3D11 texture internals
2023-10-10 03:32:46 -07:00
Sam Lantinga d830cd140b Added support for 0-copy decode and display using Apple VideoToolbox 2023-10-10 03:32:46 -07:00
Sam Lantinga 1bf913b29a Added support for 0-copy decode and display using VAAPI and EGL 2023-10-10 03:32:46 -07:00
Sam Lantinga ce8161e0cf Make sure we're building with ffmpeg 6.0 or newer 2023-10-10 03:32:46 -07:00
Sam Lantinga ed6381b68d Allow setting any number of sprites over the video
Default to no sprites over the video
2023-10-10 03:32:46 -07:00
Anonymous Maarten ebf5e08fa1 cmake: use *_STATIC_* variables when linking to a static ffmpeg 2023-10-10 03:32:46 -07:00
Sam Lantinga 88f2fb9dcf Added an example of video decoding with ffmpeg 2023-10-10 03:32:46 -07:00
Simon McVittie d88bf687a8 surface: Document the in-memory layout of the pixels
I don't think we ever explicitly said this.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-10-10 03:24:43 -07:00
Simon McVittie 3698630bbc pixels: Document the naming convention
Whenever I have to fix something endianness-related, I always get
confused about whether the byte-oriented format that guarantees to put
red in byte 0 is RGBA8888 or RGBA32. (The answer is that it's RGBA32.)

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-10-10 03:24:43 -07:00
Simon McVittie 04edb38cdf shape: Use SDL[Test]_ReadSurfacePixel
This avoids assuming that the pixels are suitably aligned for direct
access, which there's no guarantee that they are; in particular,
3-bytes-per-pixel RGB images are likely to have 3 out of 4 pixels
misaligned. On x86, dereferencing a misaligned pointer does what you
would expect, but on other architectures it's undefined whether it will
work, crash with SIGBUS, or silently give a wrong answer.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-10-10 03:23:20 -07:00
Simon McVittie f5745c3a67 surface: Add a private SDL_ReadSurfacePixel
This shares its implementation with SDLTest_ReadSurfacePixel: the same
code is compiled twice, to get it into the static test library and also
the public shared library.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-10-10 03:23:20 -07:00
Simon McVittie 0d68f45879 test: Extract SDLTest_ReadSurfacePixel
This is essentially the same as was added in d95d2d70, but with clearer
error handling. It's implemented in a private header file so that it
can be shared with SDL_shape, which also wants this functionality.

Resolves: https://github.com/libsdl-org/SDL/issues/8319
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-10-10 03:23:20 -07:00
Ryan C. Gordon 55a1458ed0
audio: Changes to one logical device must update all sibling logical devices.
Fixes #8226.
2023-10-09 20:28:58 -04:00
Ryan C. Gordon 8e03ea4383
hashtable: Use Create/Destroy naming, in the SDL3 style. 2023-10-09 19:20:43 -04:00
Ryan C. Gordon 568902b64e
hashtable: Added src/SDL_hashtable.[ch].
Reference Issue #7799.
2023-10-09 19:19:01 -04:00
Ryan C. Gordon 8745a9949b
add-source-to-projects.pl: Fix adding files in the base src dir. 2023-10-09 19:19:01 -04:00
Frank Praznik 836927edf8 wayland: Try to skip the Wayland driver if not connecting to or in a Wayland session
When initializing the Wayland driver, check if the application is being started in, or trying to connect to, a Wayland session and skip to another driver if not. If neither WAYLAND_DISPLAY nor XDG_SESSION_TYPE are set, try to start anyway, and if the Wayland library is missing or no Wayland sessions are started, initialization will fail later in the process as it previously did.

This fixes the case where a Wayland session is running on a different VT, but an application wishes to run via KMSDRM on the current VT.
2023-10-09 12:47:11 -04:00
Etaash Mathamsetty 2a9480c815 wayland: Add null check for zenity version string 2023-10-06 14:51:55 -07:00
Mathieu Eyraud f30392da5b Fix assertion in LINUX_JoystickSetSensorsEnabled()
Calling LINUX_JoystickSetSensorsEnabled() after the joystick is unplugged will trigger this assertion.
2023-10-05 13:06:48 -07:00