Add gstsink to devicefinder
This commit is contained in:
parent
416beb6b8e
commit
008c39cd00
@ -35,7 +35,7 @@
|
||||
#include "alsadevicefinder.h"
|
||||
|
||||
AlsaDeviceFinder::AlsaDeviceFinder()
|
||||
: DeviceFinder("alsa") {
|
||||
: DeviceFinder("alsa", "alsasink") {
|
||||
|
||||
}
|
||||
|
||||
@ -59,18 +59,20 @@ QList<DeviceFinder::Device> AlsaDeviceFinder::ListDevices() {
|
||||
if (card < 0) break;
|
||||
|
||||
char str[32];
|
||||
snprintf(str, sizeof(str) - 1, "hw:%d", card);
|
||||
|
||||
snd_ctl_t* handle;
|
||||
snprintf(str, 31, "hw:%d", card);
|
||||
result = snd_ctl_open(&handle, str, 0);
|
||||
if (result < 0) {
|
||||
qLog(Error) << "Unable to open soundcard" << card << ":" << snd_strerror(result);
|
||||
continue;
|
||||
}
|
||||
BOOST_SCOPE_EXIT(&handle) { snd_ctl_close(handle); }
|
||||
BOOST_SCOPE_EXIT_END
|
||||
|
||||
result = snd_ctl_card_info(handle, cardinfo);
|
||||
if (result < 0) {
|
||||
qLog(Error) << "Control hardware failure for card" << card << ":" << snd_strerror(result);
|
||||
BOOST_SCOPE_EXIT(&handle) { snd_ctl_close(handle); }
|
||||
BOOST_SCOPE_EXIT_END
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -103,8 +105,6 @@ QList<DeviceFinder::Device> AlsaDeviceFinder::ListDevices() {
|
||||
ret.append(device);
|
||||
|
||||
}
|
||||
BOOST_SCOPE_EXIT(&handle) { snd_ctl_close(handle); }
|
||||
BOOST_SCOPE_EXIT_END
|
||||
}
|
||||
|
||||
snd_config_update_free_global();
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
#include "devicefinder.h"
|
||||
|
||||
DeviceFinder::DeviceFinder(const QString &name): name_(name) {
|
||||
DeviceFinder::DeviceFinder(const QString &name, const QString &gstsink): name_(name), gstsink_(gstsink) {
|
||||
}
|
||||
|
||||
QString DeviceFinder::GuessIconName(const QString &description) {
|
||||
|
@ -51,12 +51,13 @@ class DeviceFinder {
|
||||
virtual QList<Device> ListDevices() = 0;
|
||||
|
||||
protected:
|
||||
explicit DeviceFinder(const QString &name);
|
||||
explicit DeviceFinder(const QString &name, const QString &gstsink);
|
||||
|
||||
static QString GuessIconName(const QString &description);
|
||||
|
||||
private:
|
||||
QString name_;
|
||||
QString gstsink_;
|
||||
|
||||
};
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include "core/logging.h"
|
||||
|
||||
DirectSoundDeviceFinder::DirectSoundDeviceFinder()
|
||||
: DeviceFinder("directsound") {
|
||||
: DeviceFinder("directsound", "directsoundsink") {
|
||||
}
|
||||
|
||||
QList<DeviceFinder::Device> DirectSoundDeviceFinder::ListDevices() {
|
||||
|
@ -62,7 +62,7 @@ std::unique_ptr<T> GetProperty(const AudioDeviceID& device_id, const AudioObject
|
||||
|
||||
|
||||
OsxDeviceFinder::OsxDeviceFinder()
|
||||
: DeviceFinder("osxaudio") {
|
||||
: DeviceFinder("osxaudio", "osxaudiosink") {
|
||||
}
|
||||
|
||||
QList<DeviceFinder::Device> OsxDeviceFinder::ListDevices() {
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "devicefinder.h"
|
||||
#include "pulsedevicefinder.h"
|
||||
|
||||
PulseDeviceFinder::PulseDeviceFinder() : DeviceFinder("pulseaudio"), mainloop_(nullptr), context_(nullptr) {
|
||||
PulseDeviceFinder::PulseDeviceFinder() : DeviceFinder("pulseaudio", "pulsesink"), mainloop_(nullptr), context_(nullptr) {
|
||||
}
|
||||
|
||||
bool PulseDeviceFinder::Initialise() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user