Back to development
[platform/upstream/gstreamer.git] / subprojects / gstreamer-sharp / sources / generated / Gst.Net / NetTimePacket.cs
1 // This file was generated by the Gtk# code generator.
2 // Any changes made will be lost if regenerated.
3
4 namespace Gst.Net {
5
6         using System;
7         using System.Collections;
8         using System.Collections.Generic;
9         using System.Runtime.InteropServices;
10
11 #region Autogenerated code
12         [StructLayout(LayoutKind.Sequential)]
13         public partial struct NetTimePacket : IEquatable<NetTimePacket> {
14
15                 public ulong LocalTime;
16                 public ulong RemoteTime;
17
18                 public static Gst.Net.NetTimePacket Zero = new Gst.Net.NetTimePacket ();
19
20                 public static Gst.Net.NetTimePacket New(IntPtr raw) {
21                         if (raw == IntPtr.Zero)
22                                 return Gst.Net.NetTimePacket.Zero;
23                         return (Gst.Net.NetTimePacket) Marshal.PtrToStructure (raw, typeof (Gst.Net.NetTimePacket));
24                 }
25
26                 [DllImport("gstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
27                 static extern IntPtr gst_net_time_packet_new(byte[] buffer);
28
29                 public static NetTimePacket New(byte[] buffer)
30                 {
31                         NetTimePacket result = NetTimePacket.New (gst_net_time_packet_new(buffer));
32                         return result;
33                 }
34
35                 [DllImport("gstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
36                 static extern IntPtr gst_net_time_packet_get_type();
37
38                 public static GLib.GType GType { 
39                         get {
40                                 IntPtr raw_ret = gst_net_time_packet_get_type();
41                                 GLib.GType ret = new GLib.GType(raw_ret);
42                                 return ret;
43                         }
44                 }
45
46                 [DllImport("gstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
47                 static extern unsafe bool gst_net_time_packet_send(IntPtr raw, IntPtr socket, IntPtr dest_address, out IntPtr error);
48
49                 public unsafe bool Send(GLib.Socket socket, GLib.SocketAddress dest_address) {
50                         IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
51                         System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
52                         IntPtr error = IntPtr.Zero;
53                         bool raw_ret = gst_net_time_packet_send(this_as_native, socket == null ? IntPtr.Zero : socket.Handle, dest_address == null ? IntPtr.Zero : dest_address.Handle, out error);
54                         bool ret = raw_ret;
55                         ReadNative (this_as_native, ref this);
56                         System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
57                         if (error != IntPtr.Zero) throw new GLib.GException (error);
58                         return ret;
59                 }
60
61                 [DllImport("gstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
62                 static extern byte gst_net_time_packet_serialize(IntPtr raw);
63
64                 public byte Serialize() {
65                         IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
66                         System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
67                         byte raw_ret = gst_net_time_packet_serialize(this_as_native);
68                         byte ret = raw_ret;
69                         ReadNative (this_as_native, ref this);
70                         System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
71                         return ret;
72                 }
73
74                 [DllImport("gstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
75                 static extern unsafe IntPtr gst_net_time_packet_receive(IntPtr socket, out IntPtr src_address, out IntPtr error);
76
77                 public static unsafe Gst.Net.NetTimePacket Receive(GLib.Socket socket, out GLib.SocketAddress src_address) {
78                         IntPtr native_src_address;
79                         IntPtr error = IntPtr.Zero;
80                         IntPtr raw_ret = gst_net_time_packet_receive(socket == null ? IntPtr.Zero : socket.Handle, out native_src_address, out error);
81                         Gst.Net.NetTimePacket ret = Gst.Net.NetTimePacket.New (raw_ret);
82                         src_address = GLib.Object.GetObject(native_src_address, true) as GLib.SocketAddress;
83                         if (error != IntPtr.Zero) throw new GLib.GException (error);
84                         return ret;
85                 }
86
87                 static void ReadNative (IntPtr native, ref Gst.Net.NetTimePacket target)
88                 {
89                         target = New (native);
90                 }
91
92                 public bool Equals (NetTimePacket other)
93                 {
94                         return true && LocalTime.Equals (other.LocalTime) && RemoteTime.Equals (other.RemoteTime);
95                 }
96
97                 public override bool Equals (object other)
98                 {
99                         return other is NetTimePacket && Equals ((NetTimePacket) other);
100                 }
101
102                 public override int GetHashCode ()
103                 {
104                         return this.GetType ().FullName.GetHashCode () ^ LocalTime.GetHashCode () ^ RemoteTime.GetHashCode ();
105                 }
106
107                 public static explicit operator GLib.Value (Gst.Net.NetTimePacket boxed)
108                 {
109                         GLib.Value val = GLib.Value.Empty;
110                         val.Init (Gst.Net.NetTimePacket.GType);
111                         val.Val = boxed;
112                         return val;
113                 }
114
115                 public static explicit operator Gst.Net.NetTimePacket (GLib.Value val)
116                 {
117                         return (Gst.Net.NetTimePacket) val.Val;
118                 }
119 #endregion
120         }
121 }