mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 00:06:36 +00:00
aa7bb8fa1c
glib-sharp will only get a new release with the new API that we need for 3.0 in a year or something. Instead of waiting a year before we can release something we now have our own internal copy of glib-sharp trunk that will be dropped once glib-sharp 3.0 is released. Everything is now compilable and working without any additional patches.
56 lines
1.1 KiB
C#
56 lines
1.1 KiB
C#
//
|
|
// Copyright (c) 2009 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
|
//
|
|
// This class implements some helper functions to handle GError
|
|
//
|
|
|
|
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace Gst {
|
|
|
|
[StructLayout (LayoutKind.Sequential) ]
|
|
internal struct GError {
|
|
uint domain_quark;
|
|
int code;
|
|
IntPtr message;
|
|
|
|
public uint Domain {
|
|
get {
|
|
return domain_quark;
|
|
}
|
|
set {
|
|
domain_quark = value;
|
|
}
|
|
}
|
|
|
|
public int Code {
|
|
get {
|
|
return code;
|
|
}
|
|
set {
|
|
code = value;
|
|
}
|
|
}
|
|
|
|
public string Message {
|
|
get {
|
|
if (message == IntPtr.Zero)
|
|
return null;
|
|
return Gst.GLib.Marshaller.Utf8PtrToString (message);
|
|
}
|
|
set {
|
|
if (message != IntPtr.Zero)
|
|
Gst.GLib.Marshaller.Free (message);
|
|
message = Gst.GLib.Marshaller.StringToPtrGStrdup (value);
|
|
}
|
|
}
|
|
|
|
public void Unset () {
|
|
Gst.GLib.Marshaller.Free (message);
|
|
message = IntPtr.Zero;
|
|
code = 0;
|
|
domain_quark = 0;
|
|
}
|
|
}
|
|
}
|