Skip to content

Commit

Permalink
GStreamer: validate install before accepting install
Browse files Browse the repository at this point in the history
  • Loading branch information
meee1 committed Aug 28, 2024
1 parent 16efc0a commit 2eacbd1
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions ExtLibs/Utilities/GStreamer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1490,7 +1490,7 @@ private static void SetGSTPath(string gstdir)
WinNativeMethods.SetDefaultDllDirectories(WinNativeMethods.LOAD_LIBRARY_SEARCH_DEFAULT_DIRS);
WinNativeMethods.AddDllDirectory(Path.Combine(gstdir, "bin"));
WinNativeMethods.LoadLibrary(orig);
}catch { }
}catch { }
}

//C:\ProgramData\Mission Planner\gstreamer\1.0\x86_64\bin
Expand Down Expand Up @@ -1573,6 +1573,19 @@ public static string LookForGstreamer()
{
log.Info("Found gstreamer " + ans.First());
SetGSTPath(ans.First());
try
{
uint v1 = 0, v2 = 0, v3 = 0, v4 = 0;
NativeMethods.gst_version(out v1, out v2, out v3, out v4);

log.InfoFormat("GStreamer {0}.{1}.{2}.{3}", v1, v2, v3, v4);
}
catch (Exception ex)
{
log.Error(ex);
return "";
}

return ans.First();
}
}
Expand Down Expand Up @@ -2169,13 +2182,15 @@ public static void DownloadGStreamer(Action<int, string> status = null)
{
try
{
Download.getFilefromNet(url, output, status: status);
if (Download.getFilefromNet(url, output, status: status))
{

status?.Invoke(50, "Extracting..");
ZipFile.ExtractToDirectory(output, Settings.GetDataDirectory());
status?.Invoke(100, "Done.");
status?.Invoke(50, "Extracting..");
ZipFile.ExtractToDirectory(output, Settings.GetDataDirectory());
status?.Invoke(100, "Done.");

break;
break;
}
}
catch (Exception ex)
{
Expand Down

0 comments on commit 2eacbd1

Please sign in to comment.