refactor(main.rs): only set gstreamer plugin envs in release build

This commit is contained in:
uncor3
2026-06-09 21:52:21 +03:00
parent a9163757c0
commit 628099bbec
+18 -13
View File
@@ -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