diff --git a/README.md b/README.md index fd730f237c..04dbfe2c2c 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ the core and base gstreamer libraries. Prerequisites ---- -These libraries are needed for clutter-sharp to compile: -* gstreamer core, base and good 1.4 or higher -* [gtk-sharp] 3.22.6 or higher - *NOTE: This can be built as a meson subproject if using the meson build system.* +These libraries are needed for gstreamer-sharp to compile: +* gstreamer core, base and good 1.14 or higher +* [gtk-sharp] 3.22.0 or higher - *NOTE: This can be built as a meson subproject.* You will also need various .NET/mono bits (mcs and al). On debian-based distros you can install these with: @@ -70,5 +70,5 @@ License gstreamer-sharp is licensed under the [LGPL 2.1](https://www.gnu.org/licenses/lgpl-2.1.html) [bindinator]:https://github.com/GLibSharp/bindinator -[gtk-sharp]:https://github.com/GLibSharp/GtlSharp +[gtk-sharp]:https://github.com/GLibSharp/GtkSharp [gstreamer]: http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/ diff --git a/sources/custom/Application.cs b/sources/custom/Application.cs index 27ef4c5c2e..4ac9abb47c 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; } }