mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-07-29 12:19:15 +00:00
Add app name SDL hint
This allows pulseaudio to label the audio stream "scrcpy" rather than "SDL Application". PR #6107 <https://github.com/Genymobile/scrcpy/pull/6107> Signed-off-by: Romain Vimont <rom@rom1v.com>
This commit is contained in:
parent
52f5d08d1f
commit
d2cc930975
2 changed files with 19 additions and 0 deletions
|
@ -75,6 +75,14 @@
|
|||
# define SCRCPY_SDL_HAS_THREAD_PRIORITY_TIME_CRITICAL
|
||||
#endif
|
||||
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 18)
|
||||
# define SCRCPY_SDL_HAS_HINT_APP_NAME
|
||||
#endif
|
||||
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 14)
|
||||
# define SCRCPY_SDL_HAS_HINT_AUDIO_DEVICE_APP_NAME
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRDUP
|
||||
char *strdup(const char *s);
|
||||
#endif
|
||||
|
|
|
@ -107,6 +107,17 @@ sdl_set_hints(const char *render_driver) {
|
|||
LOGW("Could not set render driver");
|
||||
}
|
||||
|
||||
// App name used in various contexts (such as PulseAudio)
|
||||
#if defined(SCRCPY_SDL_HAS_HINT_APP_NAME)
|
||||
if (!SDL_SetHint(SDL_HINT_APP_NAME, "scrcpy")) {
|
||||
LOGW("Could not set app name");
|
||||
}
|
||||
#elif defined(SCRCPY_SDL_HAS_HINT_AUDIO_DEVICE_APP_NAME)
|
||||
if (!SDL_SetHint(SDL_HINT_AUDIO_DEVICE_APP_NAME, "scrcpy")) {
|
||||
LOGW("Could not set audio device app name");
|
||||
}
|
||||
#endif
|
||||
|
||||
// Linear filtering
|
||||
if (!SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "1")) {
|
||||
LOGW("Could not enable linear filtering");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue