mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-31 03:27:40 +01:00
Mac deployment fixes for gstreamer.
This commit is contained in:
parent
d51c7444ab
commit
821baa2211
62
macdeploy.py
62
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 <bundle.app>' % 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))
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user