summaryrefslogtreecommitdiff
path: root/sources/generated/Gst.Sdp/SDPBandwidth.cs
blob: ca30997abadde5f13f0ecb62911ae771c8d1b7a0 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
// This file was generated by the Gtk# code generator.
// Any changes made will be lost if regenerated.

namespace Gst.Sdp {

	using System;
	using System.Collections;
	using System.Collections.Generic;
	using System.Runtime.InteropServices;

#region Autogenerated code
	[StructLayout(LayoutKind.Sequential)]
	public partial struct SDPBandwidth : IEquatable<SDPBandwidth> {

		public string Bwtype;
		public uint Bandwidth;

		public static Gst.Sdp.SDPBandwidth Zero = new Gst.Sdp.SDPBandwidth ();

		public static Gst.Sdp.SDPBandwidth New(IntPtr raw) {
			if (raw == IntPtr.Zero)
				return Gst.Sdp.SDPBandwidth.Zero;
			return (Gst.Sdp.SDPBandwidth) Marshal.PtrToStructure (raw, typeof (Gst.Sdp.SDPBandwidth));
		}

		[DllImport("gstsdp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern int gst_sdp_bandwidth_clear(IntPtr raw);

		public Gst.Sdp.SDPResult Clear() {
			IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
			System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
			int raw_ret = gst_sdp_bandwidth_clear(this_as_native);
			Gst.Sdp.SDPResult ret = (Gst.Sdp.SDPResult) raw_ret;
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			return ret;
		}

		[DllImport("gstsdp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern int gst_sdp_bandwidth_set(IntPtr raw, IntPtr bwtype, uint bandwidth);

		public Gst.Sdp.SDPResult Set(string bwtype, uint bandwidth) {
			IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
			System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
			IntPtr native_bwtype = GLib.Marshaller.StringToPtrGStrdup (bwtype);
			int raw_ret = gst_sdp_bandwidth_set(this_as_native, native_bwtype, bandwidth);
			Gst.Sdp.SDPResult ret = (Gst.Sdp.SDPResult) raw_ret;
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			GLib.Marshaller.Free (native_bwtype);
			return ret;
		}

		static void ReadNative (IntPtr native, ref Gst.Sdp.SDPBandwidth target)
		{
			target = New (native);
		}

		public bool Equals (SDPBandwidth other)
		{
			return true && Bwtype.Equals (other.Bwtype) && Bandwidth.Equals (other.Bandwidth);
		}

		public override bool Equals (object other)
		{
			return other is SDPBandwidth && Equals ((SDPBandwidth) other);
		}

		public override int GetHashCode ()
		{
			return this.GetType ().FullName.GetHashCode () ^ Bwtype.GetHashCode () ^ Bandwidth.GetHashCode ();
		}

		private static GLib.GType GType {
			get { return GLib.GType.Pointer; }
		}
#endregion
	}
}