Fix macos build

This commit is contained in:
Jonas Kvinge
2018-07-01 22:26:46 +02:00
parent c4e75dea65
commit ada7325a04
51 changed files with 453 additions and 399 deletions

View File

@@ -38,7 +38,7 @@
# include "pulsedevicefinder.h"
#endif
#ifdef Q_OS_DARWIN
#ifdef Q_OS_MACOS
# include "osxdevicefinder.h"
#endif
@@ -63,7 +63,7 @@ void EngineDevice::Init() {
#ifdef HAVE_LIBPULSE
device_finders.append(new PulseDeviceFinder);
#endif
#ifdef Q_OS_DARWIN
#ifdef Q_OS_MACOS
device_finders.append(new OsxDeviceFinder);
#endif
#ifdef Q_OS_WIN32

View File

@@ -106,8 +106,8 @@ GstEngine::GstEngine(TaskManager *task_manager)
ReloadSettings();
#ifdef Q_OS_DARWIN
QDir resources_dir(mac::GetResourcesPath());
#ifdef Q_OS_MACOS___ // FIXME
QDir resources_dir(mac::getResourcesPath());
QString ca_cert_path = resources_dir.filePath("cacert.pem");
GError *error = nullptr;
tls_database_ = g_tls_file_database_new(ca_cert_path.toUtf8().data(), &error);
@@ -121,7 +121,7 @@ GstEngine::~GstEngine() {
current_pipeline_.reset();
#ifdef Q_OS_DARWIN
#ifdef Q_OS_MACOS
g_object_unref(tls_database_);
#endif
}
@@ -428,14 +428,14 @@ void GstEngine::SetEnvironment() {
QString registry_filename;
// On windows and mac we bundle the gstreamer plugins with strawberry
#if defined(Q_OS_DARWIN)
#if defined(Q_OS_MACOS)
scanner_path = QCoreApplication::applicationDirPath() + "/../PlugIns/gst-plugin-scanner";
plugin_path = QCoreApplication::applicationDirPath() + "/../PlugIns/gstreamer";
#elif defined(Q_OS_WIN32)
plugin_path = QDir::toNativeSeparators(QCoreApplication::applicationDirPath() + "/gstreamer-plugins");
#endif
#if defined(Q_OS_WIN32) || defined(Q_OS_DARWIN)
#if defined(Q_OS_WIN32) || defined(Q_OS_MACOS)
registry_filename = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + QString("/gst-registry-%1-bin").arg(QCoreApplication::applicationVersion());
#endif
@@ -451,7 +451,7 @@ void GstEngine::SetEnvironment() {
Utilities::SetEnv("GST_REGISTRY", registry_filename);
}
#ifdef Q_OS_DARWIN
#ifdef Q_OS_MACOS
Utilities::SetEnv("GIO_EXTRA_MODULES", QCoreApplication::applicationDirPath() + "/../PlugIns/gio-modules");
#endif

View File

@@ -49,7 +49,7 @@
class TaskManager;
class GstEnginePipeline;
#ifdef Q_OS_DARWIN
#ifdef Q_OS_MACOS
struct _GTlsDatabase;
typedef struct _GTlsDatabase GTlsDatabase;
#endif
@@ -111,7 +111,7 @@ class GstEngine : public Engine::Base, public GstBufferConsumer {
void AddBufferConsumer(GstBufferConsumer *consumer);
void RemoveBufferConsumer(GstBufferConsumer *consumer);
#ifdef Q_OS_DARWIN
#ifdef Q_OS_MACOS
GTlsDatabase *tls_database() const { return tls_database_; }
#endif
@@ -202,6 +202,10 @@ class GstEngine : public Engine::Base, public GstBufferConsumer {
bool have_new_buffer_;
int scope_chunks_;
#ifdef Q_OS_MACOS
GTlsDatabase* tls_database_;
#endif
};
#endif /* GSTENGINE_H */

View File

@@ -513,7 +513,7 @@ void GstEnginePipeline::TaskEnterCallback(GstTask *, GThread *, gpointer) {
// Bump the priority of the thread only on OS X
#ifdef Q_OS_DARWIN
#ifdef Q_OS_MACOS
sched_param param;
memset(&param, 0, sizeof(param));
@@ -835,7 +835,7 @@ void GstEnginePipeline::SourceSetupCallback(GstPlayBin *bin, GParamSpec *pspec,
if (g_object_class_find_property(G_OBJECT_GET_CLASS(element), "user-agent")) {
QString user_agent = QString("%1 %2").arg(QCoreApplication::applicationName(), QCoreApplication::applicationVersion()); g_object_set(element, "user-agent", user_agent.toUtf8().constData(), nullptr);
#ifdef Q_OS_DARWIN
#ifdef Q_OS_MACOS
g_object_set(element, "tls-database", instance->engine_->tls_database(), nullptr);
g_object_set(element, "ssl-use-system-ca-file", false, nullptr);
g_object_set(element, "ssl-strict", TRUE, nullptr);

View File

@@ -425,7 +425,7 @@ void XineEngine::SetEnvironment() {
putenv(QString("XINE_PLUGIN_PATH=" + QCoreApplication::applicationDirPath() + "/xine-plugins").toLatin1().constData());
#endif
#ifdef Q_OS_DARWIN
#ifdef Q_OS_MACOS
setenv("XINE_PLUGIN_PATH", QString(QCoreApplication::applicationDirPath() + "/../PlugIns/xine").toLatin1().constData(), 1);
#endif