Commit Graph

6919 Commits (67e8522d31b875874ffd24086678ee6c861ff91c)

Author SHA1 Message Date
Ethan Lee 67e8522d31 Add SDL_GetAudioDeviceSpec.
This API is supported by pipewire, pulseaudio, coreaudio, wasapi, and disk.
2021-03-05 12:03:07 -08:00
Subs 00fabdde18 Make github CI great again
The current CI doesn't work and can be fixed. To steps, use a matrix to build on various OS + allow platform specific flags.
The linux build should cover a wider case of video backends.
2021-03-04 22:02:47 -08:00
Ozkan Sezer 686935542e dos2unix SDL_dynapi_*.h 2021-03-04 23:50:40 +03:00
Ozkan Sezer 34ecd71e80 CMake: don't add -Wl,--no-undefined to LDFLAGS for clang+windows cases
from a patchset by Vladislav Dmitrievich Turbanov:
https://github.com/libsdl-org/SDL/pull/4062
2021-03-04 18:44:04 +03:00
Ozkan Sezer 3880174a9f CMake: set OPT_DEF_LIBC to ON for clang case, too.
from a patchset by Vladislav Dmitrievich Turbanov:
https://github.com/libsdl-org/SDL/pull/4062
2021-03-04 18:40:56 +03:00
Ozkan Sezer 05cc9e3764 CMake: move GCC check after CLANG, so that CLANG is properly recognized
from a patchset by Vladislav Dmitrievich Turbanov:
https://github.com/libsdl-org/SDL/pull/4062
2021-03-04 18:40:50 +03:00
Ozkan Sezer 81cdb1bb0d test: add unifont-9.0.02.hex as a resource (so it works out-of-the-box)
from a patchset by Vladislav Dmitrievich Turbanov:
https://github.com/libsdl-org/SDL/pull/4062
2021-03-04 18:32:32 +03:00
Ozkan Sezer a52d0db532 test/CMakeLists.txt: add OpenGL module checks and adjust dependencies.
from a patchset by Vladislav Dmitrievich Turbanov:
https://github.com/libsdl-org/SDL/pull/4062
2021-03-04 18:28:10 +03:00
Ozkan Sezer e7abf96801 test/CMakeLists.txt: bump cmake minimum required to 3.0 for consistency
from a patchset by Vladislav Dmitrievich Turbanov:
https://github.com/libsdl-org/SDL/pull/4062
2021-03-04 18:28:04 +03:00
Ozkan Sezer dd5aff308a SDL_fillrect.c: updated SSE_BEGIN macro for windows clang-cl
from a patchset by Vladislav Dmitrievich Turbanov:
https://github.com/libsdl-org/SDL/pull/4062
2021-03-04 18:27:56 +03:00
Ozkan Sezer 0ed1713128 update SDL_COMPOSE_ERROR macro for windows clang-cl
from a patchset by Vladislav Dmitrievich Turbanov:
https://github.com/libsdl-org/SDL/pull/4062
2021-03-04 18:27:47 +03:00
Ozkan Sezer e228d15261 SDL_config_windows.h: added clang to list of toolchains having stdint.h
from a patchset by Vladislav Dmitrievich Turbanov:
https://github.com/libsdl-org/SDL/pull/4062
2021-03-04 18:27:37 +03:00
Ozkan Sezer c1c4f274c3 cpuinfo: updated xgetbv call for windows clang-cl.
from a patchset by Vladislav Dmitrievich Turbanov:
https://github.com/libsdl-org/SDL/pull/4062
2021-03-04 18:27:32 +03:00
Sylvain e88d78462e Update SDL_blit_auto.c 2021-03-04 14:36:33 +01:00
Sylvain ab0cf42a4b
Software nearest scaling: start at the middle of pixel
so that it matches opengl GL_NEAREST mode most of the time
2021-03-04 14:33:56 +01:00
Ozkan Sezer ac8a3fda8f fix prepare_audiospec() possibly missing a bad SDL_AUDIO_CHANNELS env. 2021-03-03 20:33:20 +03:00
Nicolas Noble 6158621610 Update cpuid code for clang-cl
The clang-cl compiler defines `__llvm__` but not `__GNUC__`. The `__cpuid` intrinsic doesn't seem to exist with clang-cl, so the code won't link properly. The `__GNUC__` versions of these functions will work properly on Windows with clang-cl.
2021-03-03 15:37:21 +03:00
Frank Praznik 4de0c74aa7 audio: pipewire: Add the application name to the stream properties 2021-03-02 12:59:04 -08:00
Frank Praznik 9ed01da701 audio: pipewire: Constify and clarify period size calculations
Constify the min/max period variables, use a #define for the base clock rate used in the calculations and note that changing the upper limit can have dire side effects as it's a hard limit in Pipewire.
2021-03-02 12:59:04 -08:00
Frank Praznik d7ca855c2b audio: pipewire: Add missing static qualifiers to globals 2021-03-02 12:59:04 -08:00
Oschowa 84c44e01d3 audio: pipewire: fix uninitialized variable warnings 2021-03-01 09:34:04 -08:00
Ozkan Sezer 0a68322170 add missing PIPEWIRE defines to SDL_config.h.in
also specify 'audio' in Pipepire configuration enable messages.
2021-03-01 15:11:50 +03:00
Frank Praznik 7001b531c6 audio: pipewire: Add vim format lines to files and fix indentation
Increase indentation spacing from 2 to 4 to comply with style standards.
2021-02-28 19:40:09 -08:00
Frank Praznik 2fcba50ec9 audio: pipewire: Code and comment cleanups
Replace "magic numbers" with #defines, explain the requirements when using the userdata pointer in the node_object struct and a few other minor code and comment cleanups.
2021-02-28 19:40:09 -08:00
Frank Praznik 4eadd147cd audio: pipewire: Fix outdated comment 2021-02-28 19:40:09 -08:00
Frank Praznik cd56f1b346 audio: pipewire: Use "rear" designation for rear channels
Use the 'R' (rear) prefixed designations for the rear audio channels instead of 'S' (surround).  Surround designated channels are only used in the 8 channel configuration.
2021-02-28 19:40:09 -08:00
Frank Praznik adc0a931dd audio: Move Pipewire bootstrap after Jack
Move the Pipewire audio driver below others in the list so it won't be mistakenly initialized when it's not the system mixer.
2021-02-28 19:40:09 -08:00
Frank Praznik 21adec93b9 audio: pipewire: Make enumeration structure and function names more descriptive
Rename the add/remove/clear list functions and rename connected_device to io_node, as a sink/source node isn't necessarily a device.
2021-02-28 19:40:09 -08:00
Frank Praznik a07f543436 audio: pipewire: Report default devices first
Further refactor the device enumeration code to retrieve the default sink/source node IDs from the metadata node.  Use the retrieved IDs to sort the device list so that the default devices are at the beginning and thus are the first reported to SDL.
2021-02-28 19:40:09 -08:00
Frank Praznik 9afd7570d6 audio: pipewire: Always buffer source audio
The latency of source nodes can change depending on the overall latency of the processing graph. Incoming audio must therefore always be buffered to ensure uninterrupted delivery.

The SDL_AudioStream path was removed in the input callback as the only thing it was used for was buffering audio outside of Pipewire's min/max period sizes, and that case is now handled by the omnipresent buffer.
2021-02-28 19:40:09 -08:00
Frank Praznik 106dc009ac audio: pipewire: Pass proper parameter to user audio callback
The audio callbacks should pass the callbackspec.userdata parameter to the callback, not spec.userdata

Co-authored-by: Oschowa <Oschowa@web.de>
2021-02-28 19:40:09 -08:00
Frank Praznik f3ebbc06d3 audio: pipewire: Retrieve the channel count and default sample rate for sinks/sources
Extend device enumeration to retrieve the channel count and default sample rate for sink and source nodes.  This required a fairly significant rework of the enumeration procedure as multiple callbacks are involved now.  Sink/source nodes are tracked in a separate list during the enumeration process so they can be cleaned up if a device is removed before completion.  These changes also simplify any future efforts that may be needed to retrieve additional configuration information from the nodes.
2021-02-28 19:40:09 -08:00
Frank Praznik 2f0b99a774 audio: Add Pipewire playback/capture sink 2021-02-28 19:40:09 -08:00
Ethan Lee 57a927e8d7 wayland: Explicitly set min/max size for xdg-shell 2021-02-28 19:37:31 -08:00
Cacodemon345 33598563b3 Fix coding style 2021-02-26 09:32:04 -08:00
Cacodemon345 69a600b00e Implement requested changes 2021-02-26 09:32:04 -08:00
Cacodemon345 0e35f0be1f Fix KMSDRM-related warnings 2021-02-26 09:32:04 -08:00
Cameron Gutman dfa64eadd3 KMSDRM: Add hint to enable the backend without DRM master
In some cases, it can be useful to have the KMSDRM backend even if it cannot
be used for rendering. An app may want to use SDL for input processing while
using another rendering API (such as an MMAL overlay on Raspberry Pi) or
using its own code to render to DRM overlays that SDL doesn't support.

This also moves the check for DRM master to an earlier point where we can fail
initialization of the backend, rather than allowing the backend to initialize
then failing the creation of a window later.
2021-02-25 18:48:36 -08:00
Cameron Gutman 8c5b7af2d2 Wayland: Fix mouse pointer hiding on Plasma Wayland
Unlike Mutter and Sway, KWin actually checks the serial passed in
wl_pointer_set_cursor(). The serial provided is supposed to be the
serial of the pointer enter event, but We were always passing 0.
This caused KWin to drop our requests to hide the cursor.

Thanks to the KDE folks for spotting this in my debug logs.

Fixes #3576
2021-02-25 18:47:12 -08:00
Cacodemon345 d2d834b990 KMSDRM: Add gamma support 2021-02-25 11:39:10 -08:00
Ozkan Sezer 72f7a10cef disable pixman ARM blitters for __aarch64__ | _M_ARM64
Closes:  https://github.com/libsdl-org/SDL/issues/4095
2021-02-25 11:38:14 -08:00
Cameron Cawley 2f4e9294aa Update the Linux build instructions 2021-02-25 19:24:50 +03:00
Ozkan Sezer e561ce3a75 SDL_cpuinfo.c: replaced gcc i386 checks with __i386__ . 2021-02-25 01:40:02 +03:00
Ozkan Sezer 55a385a333 removed a useless restriction from Watcom version of SDL_Swap32()
also did a little whitespace tidy-up.
2021-02-24 20:03:50 +03:00
Ozkan Sezer b8d2185277 added Watcom i386 inline asm for SDL_Swap64() 2021-02-23 17:37:20 +03:00
JibbSmart c287087fcc Only change joystick->nbuttons for Joy-Cons, since they're the only ones that have these "paddles" 2021-02-22 17:54:32 -08:00
JibbSmart ee52624f95 Switch Joy-Con SL and SR buttons are now mapped to matching paddle positions so that all buttons can be accessed when using SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS 2021-02-22 17:54:32 -08:00
Mathieu Eyraud 7a2b6f331b Guard Inotify stuff with macro
This fix implicit declaration of close and unused variable warning.
2021-02-22 09:07:07 -08:00
Mathieu Eyraud 8481229ff7 Fix error handling in KMSDRM_AddDisplay
Add missing `goto cleanup` and check that `dispdata` is not NULL before dereferencing it.
2021-02-22 09:01:36 -08:00
Mathieu Eyraud 2df9c15e96 Fix memory leak in KMSDRM_Vulkan_CreateSurface
Variable `device_props` is never freed.
2021-02-22 09:00:45 -08:00