86 lines
2.6 KiB
Diff
86 lines
2.6 KiB
Diff
--- a/src/3rdparty/chromium/media/audio/linux/audio_manager_linux.cc
|
|
+++ b/src/3rdparty/chromium/media/audio/linux/audio_manager_linux.cc
|
|
@@ -20,6 +20,10 @@
|
|
#include "media/audio/pulse/audio_manager_pulse.h"
|
|
#include "media/audio/pulse/pulse_util.h"
|
|
#endif
|
|
+#if defined(USE_SNDIO)
|
|
+#include <sndio.h>
|
|
+#include "media/audio/openbsd/audio_manager_openbsd.h"
|
|
+#endif
|
|
|
|
namespace media {
|
|
|
|
@@ -27,7 +31,8 @@ enum LinuxAudioIO {
|
|
kPulse,
|
|
kAlsa,
|
|
kCras,
|
|
- kAudioIOMax = kCras // Must always be equal to largest logged entry.
|
|
+ kSndio,
|
|
+ kAudioIOMax = kSndio // Must always be equal to largest logged entry.
|
|
};
|
|
|
|
std::unique_ptr<media::AudioManager> CreateAudioManager(
|
|
@@ -41,6 +46,17 @@ std::unique_ptr<media::AudioManager> CreateAudioManager(
|
|
}
|
|
#endif
|
|
|
|
+#if defined(USE_SNDIO)
|
|
+ struct sio_hdl * hdl = NULL;
|
|
+ if ((hdl=sio_open(SIO_DEVANY, SIO_PLAY, 1)) != NULL) {
|
|
+ sio_close(hdl);
|
|
+ UMA_HISTOGRAM_ENUMERATION("Media.LinuxAudioIO", kSndio, kAudioIOMax +1);
|
|
+ return std::make_unique<AudioManagerOpenBSD>(std::move(audio_thread),
|
|
+ audio_log_factory);
|
|
+ }
|
|
+ DVLOG(1) << "Sndio is not available on the OS";
|
|
+#endif
|
|
+
|
|
#if defined(USE_PULSEAUDIO)
|
|
pa_threaded_mainloop* pa_mainloop = nullptr;
|
|
pa_context* pa_context = nullptr;
|
|
--- a/src/3rdparty/chromium/media/BUILD.gn 2020-03-24 10:16:30.000000000 +0100
|
|
+++ - 2020-04-06 14:32:27.960817513 +0200
|
|
@@ -65,6 +65,9 @@
|
|
if (use_cras) {
|
|
defines += [ "USE_CRAS" ]
|
|
}
|
|
+ if (use_sndio) {
|
|
+ defines += [ "USE_SNDIO" ]
|
|
+ }
|
|
}
|
|
|
|
# Internal grouping of the configs necessary to support sub-folders having their
|
|
--- a/src/3rdparty/chromium/media/media_options.gni 2020-03-24 10:16:30.000000000 +0100
|
|
+++ - 2020-04-06 14:29:22.958630783 +0200
|
|
@@ -114,6 +114,9 @@
|
|
# Enables runtime selection of ALSA library for audio.
|
|
use_alsa = false
|
|
|
|
+ # Enables runtime selection of sndio library for audio.
|
|
+ use_sndio = false
|
|
+
|
|
# Alsa should be used on non-Android, non-Mac POSIX systems.
|
|
# Alsa should be used on desktop Chromecast and audio-only Chromecast builds.
|
|
if (is_posix && !is_android && !is_mac &&
|
|
--- a/src/3rdparty/chromium/media/audio/BUILD.gn 2021-02-23 16:36:59.000000000 +0100
|
|
+++ - 2021-03-07 22:00:34.889682069 +0100
|
|
@@ -238,6 +238,17 @@
|
|
sources += [ "linux/audio_manager_linux.cc" ]
|
|
}
|
|
|
|
+ if (use_sndio) {
|
|
+ libs += [ "sndio" ]
|
|
+ sources += [
|
|
+ "openbsd/audio_manager_openbsd.cc",
|
|
+ "sndio/sndio_input.cc",
|
|
+ "sndio/sndio_input.h",
|
|
+ "sndio/sndio_output.cc",
|
|
+ "sndio/sndio_output.h"
|
|
+ ]
|
|
+ }
|
|
+
|
|
if (use_alsa) {
|
|
libs += [ "asound" ]
|
|
sources += [
|