Commit e1c7a031 authored by Martin Finkel's avatar Martin Finkel

LibVLC: Add libvlc version binding

(cherry picked from commit 94225ca3385f2e02ab61c8b526d154d2d7fb1288)
parent 33f76453
......@@ -148,5 +148,12 @@ namespace LibVLCSharp.Tests
Assert.AreEqual(IntPtr.Zero, _libVLC.NativeReference);
Assert.IsFalse(_libVLC.DialogHandlersSet);
}
[Test]
public void LibVLCVersion()
{
var version = _libVLC.Version;
Assert.True(version.StartsWith("3"));
}
}
}
\ No newline at end of file
......@@ -143,6 +143,9 @@ namespace LibVLCSharp.Shared
EntryPoint = "libvlc_retain")]
internal static extern void LibVLCRetain(IntPtr libVLC);
[DllImport(Constants.LibraryName, CallingConvention = CallingConvention.Cdecl,
EntryPoint = "libvlc_get_version")]
internal static extern IntPtr LibVLCVersion();
#if ANDROID
[DllImport(Constants.LibraryName, CallingConvention = CallingConvention.Cdecl,
......@@ -625,6 +628,9 @@ namespace LibVLCSharp.Shared
/// <summary>Increments the native reference counter for this libvlc instance</summary>
public void Retain() => Native.LibVLCRetain(NativeReference);
/// <summary>The version of the LibVLC engine currently used by LibVLCSharp</summary>
public string Version => Native.LibVLCVersion().FromUtf8();
}
/// <summary>Logging messages level.</summary>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment