mirror of
https://github.com/iDescriptor/iDescriptor.git
synced 2026-06-21 19:35:49 +08:00
refactor(main.rs): only set gstreamer plugin envs in release build
This commit is contained in:
+18
-13
@@ -150,7 +150,24 @@ fn main() {
|
||||
// "their default values.");
|
||||
// }
|
||||
// QQmlApplicationEngine engine;
|
||||
#ifdef __APPLE__
|
||||
QString appPath = QCoreApplication::applicationDirPath();
|
||||
QString frameworksPath =
|
||||
QDir::toNativeSeparators(appPath + "/../Frameworks");
|
||||
QString gstPluginPath =
|
||||
QDir::toNativeSeparators(frameworksPath + "/gstreamer");
|
||||
QString gstPluginScannerPath =
|
||||
QDir::toNativeSeparators(frameworksPath + "/gst-plugin-scanner");
|
||||
|
||||
setenv("GST_PLUGIN_PATH", gstPluginPath.toUtf8().constData(), 1);
|
||||
setenv("GST_PLUGIN_SYSTEM_PATH", gstPluginPath.toUtf8().constData(), 1);
|
||||
setenv("GST_PLUGIN_SCANNER", gstPluginScannerPath.toUtf8().constData(), 1);
|
||||
#endif
|
||||
});
|
||||
|
||||
// in the release build we bundle gstreamer plugins
|
||||
if !cfg!(debug_assertions) {
|
||||
cpp!(unsafe [] {
|
||||
#ifdef WIN32
|
||||
QString appPath = QCoreApplication::applicationDirPath();
|
||||
QString gstPluginPath =
|
||||
@@ -173,20 +190,8 @@ fn main() {
|
||||
qputenv("GST_PLUGIN_SCANNER_1_0", gstPluginScannerPath.toUtf8());
|
||||
qDebug() << "GST_PLUGIN_SCANNER_1_0=" << gstPluginScannerPath;
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
QString appPath = QCoreApplication::applicationDirPath();
|
||||
QString frameworksPath =
|
||||
QDir::toNativeSeparators(appPath + "/../Frameworks");
|
||||
QString gstPluginPath =
|
||||
QDir::toNativeSeparators(frameworksPath + "/gstreamer");
|
||||
QString gstPluginScannerPath =
|
||||
QDir::toNativeSeparators(frameworksPath + "/gst-plugin-scanner");
|
||||
|
||||
setenv("GST_PLUGIN_PATH", gstPluginPath.toUtf8().constData(), 1);
|
||||
setenv("GST_PLUGIN_SYSTEM_PATH", gstPluginPath.toUtf8().constData(), 1);
|
||||
setenv("GST_PLUGIN_SCANNER", gstPluginScannerPath.toUtf8().constData(), 1);
|
||||
#endif
|
||||
});
|
||||
}
|
||||
|
||||
if cfg!(compiled_qml) {
|
||||
// For some reason on some devices QML detects that debugger is connected and fails to load pre-compiled qml files
|
||||
|
||||
Reference in New Issue
Block a user