summaryrefslogtreecommitdiff
path: root/gstreamer-sharp/Version.cs
blob: 6105030ba2f4c44276dad936cdd5ac80e62a625b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//
// Version.cs: Lightweight Version Object for GStreamer
//
// Authors:
//   Aaron Bockover (abockover@novell.com)
//
// Copyright (C) 2006 Novell, Inc.
//

using System;
using System.Runtime.InteropServices;

namespace Gst {
  public static class Version {
    private static uint major;
    private static uint minor;
    private static uint micro;
    private static uint nano;
    private static string version_string;

    static Version() {
      gst_version (out major, out minor, out micro, out nano);
    }

    public static string Description {
      get {
        if (version_string == null) {
          IntPtr version_string_ptr = gst_version_string();
          version_string = GLib.Marshaller.Utf8PtrToString (version_string_ptr);
        }

        return version_string;
      }
    }

    public static uint Major {
      get {
        return major;
      }
    }

    public static uint Minor {
      get {
        return minor;
      }
    }

    public static uint Micro {
      get {
        return micro;
      }
    }

    public static uint Nano {
      get {
        return nano;
      }
    }

    [DllImport ("gstreamer-0.10.dll") ]
    private static extern void gst_version (out uint major, out uint minor, out uint micro, out uint nano);

    [DllImport ("gstreamer-0.10.dll") ]
    private static extern IntPtr gst_version_string();
  }
}