diff options
author | Thibault Saunier <tsaunier@igalia.com> | 2018-05-09 08:31:35 -0300 |
---|---|---|
committer | Thibault Saunier <tsaunier@igalia.com> | 2018-06-01 09:15:48 -0400 |
commit | 2f6752b3fe9c5d321cddc6cc589e0b6a2ed116b5 (patch) | |
tree | 8f8ecc1a3685d5feb7dd9c8ae31783493fcd8718 /sources | |
parent | c40730fe93d0bd111c8e372cb324f870c50600a4 (diff) |
Make sure GStreamer is at least 1.14
Since we broke ABI with https://bugzilla.gnome.org/show_bug.cgi?id=743062#c30
it is the safest way to do handle.
Update the README accordingly
Diffstat (limited to 'sources')
-rw-r--r-- | sources/custom/Application.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sources/custom/Application.cs b/sources/custom/Application.cs index 27ef4c5..4ac9abb 100644 --- a/sources/custom/Application.cs +++ b/sources/custom/Application.cs @@ -21,6 +21,9 @@ namespace Gst { partial class Application { + // Because of: https://bugzilla.gnome.org/show_bug.cgi?id=743062#c30 + private static uint MIN_GSTREAMER_MINOR = 14; + static Application () { GLib.GType.Register (List.GType, typeof(List)); GLib.GType.Register (Fraction.GType, typeof(Fraction)); @@ -38,9 +41,15 @@ namespace Gst { [DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern void gst_init(IntPtr argc, IntPtr argv); + private static void CheckVersion() { + if (Gst.Version.Minor < MIN_GSTREAMER_MINOR) + throw new Exception(Gst.Version.Description + " found but GStreamer 1." + + MIN_GSTREAMER_MINOR + " required."); + } public static void Init() { gst_init (IntPtr.Zero, IntPtr.Zero); + CheckVersion(); } public static void Init(ref string[] argv) { @@ -52,6 +61,8 @@ namespace Gst { gst_init(ref cnt_argv, ref native_argv); foreach (var native_arg in native_arg_list) GLib.Marshaller.Free (native_arg); + + CheckVersion(); } [DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)] @@ -63,6 +74,8 @@ namespace Gst { public static bool InitCheck() { IntPtr error = IntPtr.Zero; bool ret = gst_init_check (IntPtr.Zero, IntPtr.Zero, out error); + + CheckVersion(); if (error != IntPtr.Zero) throw new GLib.GException (error); return ret; } @@ -78,6 +91,8 @@ namespace Gst { foreach (var native_arg in native_arg_list) GLib.Marshaller.Free (native_arg); if (error != IntPtr.Zero) throw new GLib.GException (error); + + CheckVersion(); return ret; } } |