Fix pulseaudio device selection
This commit is contained in:
@@ -48,6 +48,9 @@ QString DeviceFinder::GuessIconName(const QString &description) {
|
||||
if (description_lower.contains("headset")) {
|
||||
return "headset";
|
||||
}
|
||||
if (description_lower.contains("pulseaudio")) {
|
||||
return "pulseaudio";
|
||||
}
|
||||
|
||||
return "soundcard";
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "devicefinder.h"
|
||||
#include "enginedevice.h"
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
#ifdef HAVE_ALSA
|
||||
# include "alsadevicefinder.h"
|
||||
#endif
|
||||
|
||||
@@ -57,7 +57,7 @@ void EngineDevice::Init() {
|
||||
|
||||
QList<DeviceFinder*> device_finders;
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
#ifdef HAVE_ALSA
|
||||
device_finders.append(new AlsaDeviceFinder);
|
||||
#endif
|
||||
#ifdef HAVE_LIBPULSE
|
||||
|
||||
@@ -67,21 +67,6 @@
|
||||
# include "ext/gstafc/gstafcsrc.h"
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
# include "alsadevicefinder.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBPULSE
|
||||
# include "pulsedevicefinder.h"
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_DARWIN
|
||||
# include "osxdevicefinder.h"
|
||||
#endif
|
||||
#ifdef Q_OS_WIN32
|
||||
# include "directsounddevicefinder.h"
|
||||
#endif
|
||||
|
||||
#include "settings/backendsettingspage.h"
|
||||
|
||||
using std::shared_ptr;
|
||||
@@ -852,7 +837,13 @@ shared_ptr<GstEnginePipeline> GstEngine::CreatePipeline(const QByteArray &url, q
|
||||
|
||||
bool GstEngine::ALSADeviceSupport(const QString &name) {
|
||||
|
||||
return (name == kALSASink || name == kOSSSink || name == kPulseSink);
|
||||
return (name == kALSASink || name == kOSSSink);
|
||||
|
||||
}
|
||||
|
||||
bool GstEngine::PulseDeviceSupport(const QString &name) {
|
||||
|
||||
return (name == kPulseSink);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -87,6 +87,7 @@ class GstEngine : public Engine::Base, public GstBufferConsumer {
|
||||
const Engine::Scope &scope(int chunk_length);
|
||||
|
||||
static bool ALSADeviceSupport(const QString &name);
|
||||
static bool PulseDeviceSupport(const QString &name);
|
||||
|
||||
GstElement *CreateElement(const QString &factoryName, GstElement *bin = 0, bool fatal = true, bool showerror = true);
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ void PulseDeviceFinder::GetSinkInfoCallback(pa_context *c, const pa_sink_info *i
|
||||
Device dev;
|
||||
dev.description = QString::fromUtf8(info->description);
|
||||
dev.value = QString::fromUtf8(info->name);
|
||||
dev.iconname = QString::fromUtf8(pa_proplist_gets(info->proplist, "device.iconname"));
|
||||
dev.iconname = GuessIconName(dev.description);
|
||||
|
||||
state->devices.append(dev);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user