1 // This file was generated by the Gtk# code generator.
2 // Any changes made will be lost if regenerated.
7 using System.Collections;
8 using System.Collections.Generic;
9 using System.Runtime.InteropServices;
11 #region Autogenerated code
12 [StructLayout(LayoutKind.Sequential)]
13 public partial struct Context : IEquatable<Context> {
16 public static Gst.Context Zero = new Gst.Context ();
18 public static Gst.Context New(IntPtr raw) {
19 if (raw == IntPtr.Zero)
20 return Gst.Context.Zero;
21 return (Gst.Context) Marshal.PtrToStructure (raw, typeof (Gst.Context));
24 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
25 static extern IntPtr gst_context_new(IntPtr context_type, bool persistent);
27 public static Context New(string context_type, bool persistent)
29 IntPtr native_context_type = GLib.Marshaller.StringToPtrGStrdup (context_type);
30 Context result = Context.New (gst_context_new(native_context_type, persistent));
31 GLib.Marshaller.Free (native_context_type);
35 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
36 static extern IntPtr gst_context_get_type();
38 public static GLib.GType GType {
40 IntPtr raw_ret = gst_context_get_type();
41 GLib.GType ret = new GLib.GType(raw_ret);
46 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
47 static extern IntPtr gst_context_get_context_type(IntPtr raw);
49 public string ContextType {
51 IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
52 System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
53 IntPtr raw_ret = gst_context_get_context_type(this_as_native);
54 string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
55 ReadNative (this_as_native, ref this);
56 System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
61 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
62 static extern IntPtr gst_context_get_structure(IntPtr raw);
64 public Gst.Structure Structure {
66 IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
67 System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
68 IntPtr raw_ret = gst_context_get_structure(this_as_native);
69 Gst.Structure ret = raw_ret == IntPtr.Zero ? null : (Gst.Structure) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Structure), false);
70 ReadNative (this_as_native, ref this);
71 System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
76 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
77 static extern bool gst_context_has_context_type(IntPtr raw, IntPtr context_type);
79 public bool HasContextType(string context_type) {
80 IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
81 System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
82 IntPtr native_context_type = GLib.Marshaller.StringToPtrGStrdup (context_type);
83 bool raw_ret = gst_context_has_context_type(this_as_native, native_context_type);
85 ReadNative (this_as_native, ref this);
86 System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
87 GLib.Marshaller.Free (native_context_type);
91 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
92 static extern bool gst_context_is_persistent(IntPtr raw);
94 public bool IsPersistent {
96 IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
97 System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
98 bool raw_ret = gst_context_is_persistent(this_as_native);
100 ReadNative (this_as_native, ref this);
101 System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
106 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
107 static extern IntPtr gst_context_writable_structure(IntPtr raw);
109 public Gst.Structure WritableStructure() {
110 IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
111 System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
112 IntPtr raw_ret = gst_context_writable_structure(this_as_native);
113 Gst.Structure ret = raw_ret == IntPtr.Zero ? null : (Gst.Structure) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Structure), true);
114 ReadNative (this_as_native, ref this);
115 System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
119 static void ReadNative (IntPtr native, ref Gst.Context target)
121 target = New (native);
124 public bool Equals (Context other)
129 public override bool Equals (object other)
131 return other is Context && Equals ((Context) other);
134 public override int GetHashCode ()
136 return this.GetType ().FullName.GetHashCode ();
139 public static explicit operator GLib.Value (Gst.Context boxed)
141 GLib.Value val = GLib.Value.Empty;
142 val.Init (Gst.Context.GType);
147 public static explicit operator Gst.Context (GLib.Value val)
149 return (Gst.Context) val.Val;