gstreamer/subprojects/gstreamer-sharp/sources/custom/Version.cs

81 lines
2.1 KiB
C#
Raw Normal View History

//
// Version.cs: Lightweight Version Object for GStreamer
//
// Authors:
// Aaron Bockover <abockover@novell.com>
// Stephan Sundermann <stephansundermann@gmail.com>
//
// Copyright (C) 2006 Novell, Inc.
//
2013-07-31 11:19:42 +00:00
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
// 02110-1301 USA
2013-07-31 11:19:42 +00:00
using System;
using System.Runtime.InteropServices;
namespace Gst {
public static class Version {
2014-11-25 14:56:17 +00:00
private static uint major;
private static uint minor;
private static uint micro;
private static uint nano;
private static string version_string;
2013-07-31 11:19:42 +00:00
static Version() {
gst_version(out major, out minor, out micro, out nano);
2014-11-25 14:56:17 +00:00
}
2013-07-31 11:19:42 +00:00
2014-11-25 14:56:17 +00:00
public static string Description {
get {
if (version_string == null) {
IntPtr version_string_ptr = gst_version_string();
version_string = GLib.Marshaller.Utf8PtrToString(version_string_ptr);
2014-11-25 14:56:17 +00:00
}
2013-07-31 11:19:42 +00:00
2014-11-25 14:56:17 +00:00
return version_string;
}
}
2013-07-31 11:19:42 +00:00
2014-11-25 14:56:17 +00:00
public static uint Major {
get {
return major;
}
}
2013-07-31 11:19:42 +00:00
2014-11-25 14:56:17 +00:00
public static uint Minor {
get {
return minor;
}
}
2013-07-31 11:19:42 +00:00
2014-11-25 14:56:17 +00:00
public static uint Micro {
get {
return micro;
}
}
2013-07-31 11:19:42 +00:00
2014-11-25 14:56:17 +00:00
public static uint Nano {
get {
return nano;
}
}
2013-07-31 11:19:42 +00:00
[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern void gst_version(out uint major, out uint minor, out uint micro, out uint nano);
2013-07-31 11:19:42 +00:00
[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr gst_version_string();
2014-11-25 14:56:17 +00:00
}
}