所以 1.0+ 的 GStreamer 文档似乎......至少可以说是缺乏。GStreamer SDK 有一些有用的提示,但不幸的是它们不够用。
所以,这就是我所做的。我在/Library/GStreamer.Framework/中构建了一个调用 GStreamer 的应用程序
我使用命令行工具构建。这是我可以构建此应用程序的唯一方法。我不能使用 XCode GUI。
我想将此应用程序提交到商店,但这样做我不能将它作为一个包提交(因此我可以捆绑 GStreamer 包安装程序),这意味着我必须将 GStreamer.framework 与我的应用程序捆绑在一起。
在上面的 GStreamer SDK 文档中,您会注意到一个名为 osxrelocator.py 的工具。这很棒,因为它将/Library/GStreamer.Framework的所有引用更改为@executable_path/../Frameworks/GStreamer.framework/
但
不幸的是,所有 GStreamer .dylibs 都有一个问题......您需要使用 install_name_tool -id 来更改他们的路径,因为 install_name_tool -change 不会改变他们自己的路径!
因此,例如使用 otool:
$ otool -L Application.app/Contents/Frameworks/GStreamer.framework/Versions/1.0/lib/libgstreamer-1.0.0.dylib
Application.app/Contents/Frameworks/GStreamer.framework/Versions/1.0/lib/libgstreamer-1.0.0.dylib:
Library/Frameworks/GStreamer.framework/Versions/1.0/lib/libgstreamer-1.0.0.dylib (compatibility version 402.0.0, current version 402.0.0)
Library/Frameworks/Frameworks/GStreamer.framework/Versions/1.0/lib/libgobject-2.0.0.dylib (compatibility version 4001.0.0, current version 4001.0.0)
Library/Frameworks/GStreamer.framework/Versions/1.0/lib/libffi.6.dylib (compatibility version 7.0.0, current version 7.1.0)
Library/Frameworks/GStreamer.framework/Versions/1.0/lib/libgmodule-2.0.0.dylib (compatibility version 4001.0.0, current version 4001.0.0)
Library/Frameworks/Frameworks/GStreamer.framework/Versions/1.0/lib/libglib-2.0.0.dylib (compatibility version 4001.0.0, current version 4001.0.0)
Library/Frameworks/Frameworks/GStreamer.framework/Versions/1.0/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.2.0)
Library/Frameworks/Frameworks/GStreamer.framework/Versions/1.0/lib/libiconv.2.dylib (compatibility version 8.0.0, current version 8.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 855.14.0)
然后使用 osxrelocator.py(调用 install_name_tool -change):
./osxrelocator.py Application.app/Contents/MacOS /Library/Frameworks/GStreamer.framework/Versions/Current/lib @executable_path/../Frameworks/GStreamer.framework/Versions/Current/lib -r
给出:
$ otool -L Application.app/Contents/Frameworks/GStreamer.framework/Versions/1.0/lib/libgstreamer-1.0.0.dylib
Application.app/Contents/Frameworks/GStreamer.framework/Versions/1.0/lib/libgstreamer-1.0.0.dylib:
/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/libgstreamer-1.0.0.dylib (compatibility version 402.0.0, current version 402.0.0)
@executable_path/../Frameworks/GStreamer.framework/Versions/1.0/lib/libgobject-2.0.0.dylib (compatibility version 4001.0.0, current version 4001.0.0)
@executable_path/../Frameworks/GStreamer.framework/Versions/1.0/lib/libffi.6.dylib (compatibility version 7.0.0, current version 7.1.0)
@executable_path/../Frameworks/GStreamer.framework/Versions/1.0/lib/libgmodule-2.0.0.dylib (compatibility version 4001.0.0, current version 4001.0.0)
@executable_path/../Frameworks/GStreamer.framework/Versions/1.0/lib/libglib-2.0.0.dylib (compatibility version 4001.0.0, current version 4001.0.0)
@executable_path/../Frameworks/GStreamer.framework/Versions/1.0/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.2.0)
@executable_path/../Frameworks/GStreamer.framework/Versions/1.0/lib/libiconv.2.dylib (compatibility version 8.0.0, current version 8.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 855.14.0)
请注意 .dylib 引用自身的第一行?这不会更改为 @executable_path/../Frameworks/GStreamer.framework/ 除非您调用 install_name_tool -id。GStreamer 框架中的每个 .dylib 都会发生这种情况!有数百个,我敢肯定手动执行此操作肯定会导致错误。
希望我已经把我的问题说清楚了。有人对该怎么做有任何建议吗?
谢谢!