Commit Graph

1037 Commits (f52b330ed84c477a94094302aa6a3baaca87019d)

Author SHA1 Message Date
Sam Lantinga 39a961ba41 Added support for "%[]" sscanf syntax
Fixes https://github.com/libsdl-org/SDL/issues/8423
2023-10-24 17:28:15 -07:00
Ryan C. Gordon c6f08c2553
testaudio: Removed debugging code. 2023-10-16 15:25:34 -04:00
Ryan C. Gordon d5dac0ad27
testaudio: Deal with a texture being unexpectedly NULL when scaling.
This happens to work because our current textures are all 128x128, but in
theory one shouldn't hit this case anyhow...right?!

Reference Issue #8344.
2023-10-16 14:03:58 -04:00
Ryan C. Gordon b19e68c8ec
testaudio: Properly display playback progress, regardless of data source. 2023-10-16 13:56:43 -04:00
Ryan C. Gordon 354611a0c6
testaudio: Fixed some bugs Valgrind pointed out. 2023-10-16 10:04:02 -04:00
Ryan C. Gordon 1c6d996108
testaudio: if the SDL_Renderer is already gone, don't destroy SDL_Textures. 2023-10-14 23:17:59 -04:00
Ryan C. Gordon b17151eb16
testaudio: Don't crash if renderer is NULL (happens during shutdown). 2023-10-14 13:43:22 -04:00
Anonymous Maarten 382751c4b5 testffmpeg: print usage of options to change audio/video codec 2023-10-13 02:30:14 +02:00
Sam Lantinga f91bde64d5 testffmpeg: Only enable blending if we're using a texture format that supports it 2023-10-12 14:26:46 -07:00
Sam Lantinga 516d6f9efc testffmpeg: added support for YUVA formats using swscale
Fixes https://github.com/libsdl-org/SDL/issues/8377
2023-10-12 14:10:25 -07:00
Sam Lantinga d18f910248 testffmpeg: added the ability to specify audio and video codecs 2023-10-12 11:38:14 -07:00
Sam Lantinga bf64fecf19 testffmpeg: allow resizing of the video window 2023-10-12 00:04:00 -07:00
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
Anonymous Maarten 1ae33f6751 cmake: optionally install pdb's 2023-10-12 02:26:48 +02: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
Ryan C. Gordon bb2f767f5d
testaudio: Make program usable without a 3-button mouse. 2023-10-11 10:02:07 -04: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 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 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
Anonymous Maarten 183606d3d4 testdrawchessboard: clean up renderer and window 2023-10-05 13:41:01 +02:00
Frank Praznik 64ec208479 Fix log message spelling 2023-10-02 19:47:39 -04:00
Frank Praznik 9111c5e178 tests: Disable mouse warp test under Wayland
Wayland does not allow warping the mouse pointer, thus these tests are unreliable and should be skipped.
2023-10-02 19:44:02 -04:00
Simon McVittie 6248472c0c test: Accept small numerical differences in more mathematical tests
We can't rely on irrational numbers like pi being represented exactly,
particularly when compiling for i386, where the i387 floating-point
interface carries out calculations in registers that have higher
precision than the actual double-precision variable. The 1980s were a
strange time.

Resolves: https://github.com/libsdl-org/SDL/issues/8311
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-09-28 09:37:12 -07:00
Anonymous Maarten f5886f11d0 cmake: let every test depends on pretest 2023-09-25 18:02:40 +02:00
Anonymous Maarten f45761908a Move check for SDL_Delay upper bounds to testtimer 2023-09-25 18:02:40 +02:00
Anonymous Maarten 474c8d0073 testautomation: don't do float equality tests 2023-09-25 18:02:40 +02:00
Anonymous Maarten 85e3099ba4 testautomation: only require accelated renderer with non-dummy video driver 2023-09-25 18:02:40 +02:00
Anonymous Maarten 0e955a9127 cmake: run testautomation with CTest 2023-09-25 18:02:40 +02:00
Ryan C. Gordon e0b0f9a36e
testaudio: Fix mouseover testing.
Not sure how this line got lost.
2023-09-20 17:02:44 -04:00
Ryan C. Gordon b656720bc6 loopwave: Use SDL_GetAudioStreamQueued() for more accurate results. 2023-09-20 10:15:03 -04:00
Anonymous Maarten 4c3e84897f testspriteminimal: make standalone by embedding icon.bmp 2023-09-19 17:58:25 +02:00
Anonymous Maarten 2a01f9dcb5 tests: plug leaks when running with --trackmem
(using SDL_VIDEO_DRIVER=x11/wayland on Linux)
2023-09-19 17:58:25 +02:00
Brick a62e62f97a Refactored SDL_audiocvt.c 2023-09-17 13:13:23 -07:00
Ryan C. Gordon 2f43f7bc53
audio: Allow querying of device buffer size. 2023-09-13 11:03:17 -04:00
Ryan C. Gordon 8b26e95f91
audio: Change SDL_AudioStreamCallback
Now it offers the total requested bytes in addition to the amount
immediately needed (and immediately needed might be zero if the stream
already has enough queued to satisfy the request.
2023-09-13 10:11:23 -04:00
Sam Lantinga cd633b9a88 Renamed SDL_IsAudioDevicePaused() to SDL_AudioDevicePaused()
This aligns with the SDL3 convention of removing "Is" from self-explanatory function names

Also improved some documentation in SDL_audio.h
2023-09-12 12:11:09 -07:00
Ryan C. Gordon 3a992af446 audio: Added a postmix callback to logical devices.
You can see it in action in testaudio by mousing over a logical device; it
will show a visualizer for the current PCM (whatever is currently being
recorded on a capture device, or whatever is being mixed for output on
playback devices).

Fixes #8122.
2023-09-09 16:26:37 -04:00