context: // This file was generated by the Gtk# code generator.
  // Any changes made will be lost if regenerated.
  
  namespace Gst.Rtsp {
  
  	using System;
  	using System.Collections;
  	using System.Collections.Generic;
  	using System.Runtime.InteropServices;
  
  #region Autogenerated code
  	[StructLayout(LayoutKind.Sequential)]
  	public partial struct RTSPMessage : IEquatable<RTSPMessage> {
  
  		public Gst.Rtsp.RTSPMsgType Type;
  		private IntPtr HdrFieldsPtr;
  		private IntPtr _body;
  		private uint body_size;
  		private IntPtr _body_buffer;
  		[MarshalAs (UnmanagedType.ByValArray, SizeConst=3)]
  		private IntPtr[] _gstGstReserved;
  
  		public static Gst.Rtsp.RTSPMessage Zero = new Gst.Rtsp.RTSPMessage ();
  
  		public static Gst.Rtsp.RTSPMessage New(IntPtr raw) {
  			if (raw == IntPtr.Zero)
  				return Gst.Rtsp.RTSPMessage.Zero;
  			return (Gst.Rtsp.RTSPMessage) Marshal.PtrToStructure (raw, typeof (Gst.Rtsp.RTSPMessage));
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_rtsp_msg_get_type();
  
  		public static GLib.GType GType { 
  			get {
  				IntPtr raw_ret = gst_rtsp_msg_get_type();
  				GLib.GType ret = new GLib.GType(raw_ret);
  				return ret;
  			}
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_message_add_header(IntPtr raw, int field, IntPtr value);
  
  		public Gst.Rtsp.RTSPResult AddHeader(Gst.Rtsp.RTSPHeaderField field, string value) {
  			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_value = GLib.Marshaller.StringToPtrGStrdup (value);
  			int raw_ret = gst_rtsp_message_add_header(this_as_native, (int) field, native_value);
  			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
  			ReadNative (this_as_native, ref this);
  			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
  			GLib.Marshaller.Free (native_value);
  			return ret;
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_message_add_header_by_name(IntPtr raw, IntPtr header, IntPtr value);
  
  		public Gst.Rtsp.RTSPResult AddHeaderByName(string header, string value) {
  			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_header = GLib.Marshaller.StringToPtrGStrdup (header);
  			IntPtr native_value = GLib.Marshaller.StringToPtrGStrdup (value);
  			int raw_ret = gst_rtsp_message_add_header_by_name(this_as_native, native_header, native_value);
  			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
  			ReadNative (this_as_native, ref this);
  			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
  			GLib.Marshaller.Free (native_header);
  			GLib.Marshaller.Free (native_value);
  			return ret;
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_message_append_headers(IntPtr raw, IntPtr str);
  
  		public Gst.Rtsp.RTSPResult AppendHeaders(string str) {
  			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_rtsp_message_append_headers(this_as_native, new GLib.GString (str).Handle);
  			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
  			ReadNative (this_as_native, ref this);
  			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
  			return ret;
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_message_dump(IntPtr raw);
  
  		public Gst.Rtsp.RTSPResult Dump() {
  			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_rtsp_message_dump(this_as_native);
  			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
  			ReadNative (this_as_native, ref this);
  			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
  			return ret;
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_message_get_body_buffer(IntPtr raw, out IntPtr buffer);
  
  		public Gst.Rtsp.RTSPResult GetBodyBuffer(out Gst.Buffer buffer) {
  			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_buffer;
  			int raw_ret = gst_rtsp_message_get_body_buffer(this_as_native, out native_buffer);
  			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
  			ReadNative (this_as_native, ref this);
  			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
  			buffer = native_buffer == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (native_buffer, typeof (Gst.Buffer), false);
  			return ret;
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_message_get_header(IntPtr raw, int field, out IntPtr value, int indx);
  
  		public Gst.Rtsp.RTSPResult GetHeader(Gst.Rtsp.RTSPHeaderField field, out string value, int indx) {
  			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_value;
  			int raw_ret = gst_rtsp_message_get_header(this_as_native, (int) field, out native_value, indx);
  			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
  			ReadNative (this_as_native, ref this);
  			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
  			value = GLib.Marshaller.Utf8PtrToString (native_value);
  			return ret;
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_message_get_header_by_name(IntPtr raw, IntPtr header, out IntPtr value, int index);
  
  		public Gst.Rtsp.RTSPResult GetHeaderByName(string header, out string value, int index) {
  			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_header = GLib.Marshaller.StringToPtrGStrdup (header);
  			IntPtr native_value;
  			int raw_ret = gst_rtsp_message_get_header_by_name(this_as_native, native_header, out native_value, index);
  			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
  			ReadNative (this_as_native, ref this);
  			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
  			GLib.Marshaller.Free (native_header);
  			value = GLib.Marshaller.Utf8PtrToString (native_value);
  			return ret;
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_message_get_type(IntPtr raw);
  
  		public Gst.Rtsp.RTSPMsgType MessageType { 
  			get {
  				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_rtsp_message_get_type(this_as_native);
  				Gst.Rtsp.RTSPMsgType ret = (Gst.Rtsp.RTSPMsgType) raw_ret;
  				ReadNative (this_as_native, ref this);
  				System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
  				return ret;
  			}
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern bool gst_rtsp_message_has_body_buffer(IntPtr raw);
  
  		public bool HasBodyBuffer { 
  			get {
  				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);
  				bool raw_ret = gst_rtsp_message_has_body_buffer(this_as_native);
  				bool ret = raw_ret;
  				ReadNative (this_as_native, ref this);
  				System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
  				return ret;
  			}
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_message_init(IntPtr raw);
  
  		public Gst.Rtsp.RTSPResult Init() {
  			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_rtsp_message_init(this_as_native);
  			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
  			ReadNative (this_as_native, ref this);
  			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
  			return ret;
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_message_init_data(IntPtr raw, byte channel);
  
  		public Gst.Rtsp.RTSPResult InitData(byte channel) {
  			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_rtsp_message_init_data(this_as_native, channel);
  			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
  			ReadNative (this_as_native, ref this);
  			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
  			return ret;
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_message_init_request(IntPtr raw, int method, IntPtr uri);
  
  		public Gst.Rtsp.RTSPResult InitRequest(Gst.Rtsp.RTSPMethod method, string uri) {
  			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_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
  			int raw_ret = gst_rtsp_message_init_request(this_as_native, (int) method, native_uri);
  			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
  
gt: 			ReadNative (this_as_native, ref this);