From 821baa2211131e9c5b8e71aa3f1b6f9d012d3635 Mon Sep 17 00:00:00 2001 From: John Maguire Date: Mon, 12 Apr 2010 12:36:30 +0000 Subject: [PATCH] Mac deployment fixes for gstreamer. --- macdeploy.py | 62 +++++++++++++++++++++++-- src/engines/gstenginepipeline.cpp | 9 ++++ src/globalshortcuts/globalshortcuts.cpp | 2 + src/main.cpp | 8 ++++ 4 files changed, 77 insertions(+), 4 deletions(-) diff --git a/macdeploy.py b/macdeploy.py index 900681a5c..5d17bb539 100755 --- a/macdeploy.py +++ b/macdeploy.py @@ -21,7 +21,7 @@ import subprocess import sys FRAMEWORK_SEARCH_PATH=[ -# '/usr/local/Trolltech/Qt-4.7.0/lib', + '/usr/local/Trolltech/Qt-4.7.0/lib', '/Library/Frameworks', os.path.join(os.environ['HOME'], 'Library/Frameworks') ] @@ -53,6 +53,45 @@ XINEPLUGIN_SEARCH_PATH=[ '/sw/lib/xine/plugins', ] +GSTREAMER_PLUGINS=[ + # Core plugins + 'libgstaudioconvert.so', + 'libgstaudioresample.so', + 'libgstautodetect.so', + 'libgstcoreelements.so', + 'libgstdecodebin.so', + 'libgstgio.so', + 'libgstladspa.so', + 'libgstosxaudio.so', + 'libgsttypefindfunctions.so', + 'libgstvolume.so', + + # Codecs + 'libgstaacparse.so', + 'libgstaiff.so', + 'libgstequalizer.so', + 'libgstfaac.so', + 'libgstfaad.so', + 'libgstflac.so', + 'libgstid3demux.so', + 'libgstmad.so', + 'libgstmpegaudioparse.so', + 'libgstmusepack.so', + 'libgstogg.so', + 'libgstpnm.so', + 'libgstvorbis.so', + + # HTTP src support + 'libgstneonhttpsrc.so', +] + +GSTREAMER_SEARCH_PATH=[ + '/usr/local/gstreamer-0.10', + '/usr/local/gstreamer-0.10/gstreamer-0.10', + '/sw/lib/gstreamer-0.10', + '/sw/lib/gstreamer-0.10/gstreamer-0.10', +] + QT_PLUGINS = [ 'accessible/libqtaccessiblewidgets.dylib', 'codecs/libqcncodecs.dylib', @@ -69,7 +108,7 @@ QT_PLUGINS = [ 'sqldrivers/libqsqlite.dylib', ] QT_PLUGINS_SEARCH_PATH=[ -# '/usr/local/Trolltech/Qt-4.7.0/plugins', + '/usr/local/Trolltech/Qt-4.7.0/plugins', '/Developer/Applications/Qt/plugins', ] @@ -94,6 +133,10 @@ class CouldNotFindQtPluginError(Error): pass +class CouldNotFindGstreamerPluginError(Error): + pass + + if len(sys.argv) < 2: print 'Usage: %s ' % sys.argv[0] @@ -286,10 +329,21 @@ def FindQtPlugin(name): raise CouldNotFindQtPluginError(name) +def FindGstreamerPlugin(name): + for path in GSTREAMER_SEARCH_PATH: + if os.path.exists(path): + for dir, dirs, files in os.walk(path): + if name in files: + return os.path.join(dir, name) + raise CouldNotFindGstreamerPluginError(name) + + FixBinary(binary) -for plugin in XINE_PLUGINS: - FixPlugin(FindXinePlugin(plugin), 'xine') +for plugin in GSTREAMER_PLUGINS: + FixPlugin(FindGstreamerPlugin(plugin), 'gstreamer') + +FixPlugin(FindGstreamerPlugin('gst-plugin-scanner'), '.') for plugin in QT_PLUGINS: FixPlugin(FindQtPlugin(plugin), os.path.dirname(plugin)) diff --git a/src/engines/gstenginepipeline.cpp b/src/engines/gstenginepipeline.cpp index ac2d50297..2f19f89a1 100644 --- a/src/engines/gstenginepipeline.cpp +++ b/src/engines/gstenginepipeline.cpp @@ -59,7 +59,16 @@ bool GstEnginePipeline::Init(const QUrl &url) { // audiosink // Source + #ifdef Q_OS_DARWIN + // giosrc from Fink does not support HTTP. + if (url.scheme() == "http") { + src_ = GstEngine::CreateElement("neonhttpsrc"); + } else { + src_ = GstEngine::CreateElement("giosrc"); + } + #else src_ = GstEngine::CreateElement("giosrc"); + #endif if (!src_) return false; diff --git a/src/globalshortcuts/globalshortcuts.cpp b/src/globalshortcuts/globalshortcuts.cpp index ff0b1c674..7e41ba84f 100644 --- a/src/globalshortcuts/globalshortcuts.cpp +++ b/src/globalshortcuts/globalshortcuts.cpp @@ -57,6 +57,7 @@ bool GlobalShortcuts::RegisterGnome() { } bool GlobalShortcuts::RegisterQxt() { +#ifndef Q_OS_DARWIN QxtGlobalShortcut* play_pause = new QxtGlobalShortcut(QKeySequence("Media Play"), this); QxtGlobalShortcut* stop = new QxtGlobalShortcut(QKeySequence("Media Stop"), this); QxtGlobalShortcut* next = new QxtGlobalShortcut(QKeySequence("Media Next"), this); @@ -66,6 +67,7 @@ bool GlobalShortcuts::RegisterQxt() { connect(stop, SIGNAL(activated()), SIGNAL(Stop())); connect(next, SIGNAL(activated()), SIGNAL(Next())); connect(prev, SIGNAL(activated()), SIGNAL(Previous())); +#endif return true; } diff --git a/src/main.cpp b/src/main.cpp index e69adf61c..e39c04acc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -115,6 +115,14 @@ int main(int argc, char *argv[]) { MPRIS mpris; #endif + #ifdef Q_OS_DARWIN + QString scanner_path = QCoreApplication::applicationDirPath() + "/../PlugIns/gst-plugin-scanner"; + QString plugin_path = QCoreApplication::applicationDirPath() + "/../PlugIns/gstreamer"; + setenv("GST_PLUGIN_SCANNER", scanner_path.toAscii().constData(), 1); + setenv("GST_PLUGIN_PATH", plugin_path.toAscii().constData(), 1); + #endif + + // Window MainWindow w(&network);; a.setActivationWindow(&w);