summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@igalia.com>2018-05-09 08:31:35 -0300
committerThibault Saunier <tsaunier@igalia.com>2018-06-01 09:15:48 -0400
commit2f6752b3fe9c5d321cddc6cc589e0b6a2ed116b5 (patch)
tree8f8ecc1a3685d5feb7dd9c8ae31783493fcd8718
parentc40730fe93d0bd111c8e372cb324f870c50600a4 (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
-rw-r--r--README.md8
-rw-r--r--sources/custom/Application.cs15
2 files changed, 19 insertions, 4 deletions
diff --git a/README.md b/README.md
index fd730f2..04dbfe2 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 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;
}
}