More macos fixes

This commit is contained in:
Jonas Kvinge
2018-07-03 17:51:52 +02:00
parent efdaf57f99
commit ab3569a285
25 changed files with 2393 additions and 106 deletions

View File

@@ -398,7 +398,6 @@ bool GstEngine::ValidOutput(const QString &output) {
}
bool GstEngine::CustomDeviceSupport(const QString &output) {
return (output == kALSASink || output == kOpenALSASink || output == kOSSSink || output == kOSS4Sink || output == kPulseSink || output == kA2DPSink || output == kAVDTPSink);
}
@@ -429,9 +428,12 @@ void GstEngine::SetEnvironment() {
// On windows and mac we bundle the gstreamer plugins with strawberry
#if defined(Q_OS_MACOS)
scanner_path = QCoreApplication::applicationDirPath() + "/../PlugIns/gst-plugin-scanner";
plugin_path = QCoreApplication::applicationDirPath() + "/../PlugIns/gstreamer";
#elif defined(Q_OS_WIN32)
//scanner_path = QCoreApplication::applicationDirPath() + "/../PlugIns/gst-plugin-scanner";
//plugin_path = QCoreApplication::applicationDirPath() + "/../PlugIns/gstreamer";
scanner_path = "/usr/local/Cellar/gstreamer/1.14.1/libexec/gstreamer-1.0/gst-plugin-scanner";
plugin_path = "/usr/local/lib/gstreamer-1.0";
#endif
#if defined(Q_OS_WIN32)
plugin_path = QDir::toNativeSeparators(QCoreApplication::applicationDirPath() + "/gstreamer-plugins");
#endif
@@ -451,9 +453,9 @@ void GstEngine::SetEnvironment() {
Utilities::SetEnv("GST_REGISTRY", registry_filename);
}
#ifdef Q_OS_MACOS
Utilities::SetEnv("GIO_EXTRA_MODULES", QCoreApplication::applicationDirPath() + "/../PlugIns/gio-modules");
#endif
//#ifdef Q_OS_MACOS
//Utilities::SetEnv("GIO_EXTRA_MODULES", QCoreApplication::applicationDirPath() + "/../PlugIns/gio-modules");
//#endif
Utilities::SetEnv("PULSE_PROP_media.role", "music");

View File

@@ -206,17 +206,19 @@ bool GstEnginePipeline::InitAudioBin() {
if (device_.isValid() && g_object_class_find_property(G_OBJECT_GET_CLASS(audiosink_), "device")) {
switch (device_.type()) {
case QVariant::Int:
g_object_set(G_OBJECT(audiosink_), "device", device_.toInt(), nullptr);
break;
case QVariant::String:
if (device_.toString().isEmpty()) break;
g_object_set(G_OBJECT(audiosink_), "device", device_.toString().toUtf8().constData(), nullptr);
break;
case QVariant::ByteArray: {
case QVariant::ByteArray:
g_object_set(G_OBJECT(audiosink_), "device", device_.toByteArray().constData(), nullptr);
break;
}
case QVariant::LongLong:
g_object_set(G_OBJECT(audiosink_), "device", device_.toLongLong(), nullptr);
break;
case QVariant::Int:
g_object_set(G_OBJECT(audiosink_), "device", device_.toInt(), nullptr);
break;
default:
qLog(Warning) << "Unknown device type" << device_;
break;

View File

@@ -102,11 +102,13 @@ QList<DeviceFinder::Device> OsxDeviceFinder::ListDevices() {
}
Device dev;
dev.description = QString::fromUtf8(CFStringGetCStringPtr(*device_name, CFStringGetSystemEncoding()));
dev.value = id;
dev.description = QString::fromUtf8(CFStringGetCStringPtr(*device_name, CFStringGetSystemEncoding()));
if (dev.description.isEmpty()) dev.description = QString("Unknown device " + dev.value.toString());
dev.iconname = GuessIconName(dev.description);
ret.append(dev);
}
return ret;
}