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
  	public partial class RTSPConnection : GLib.Opaque {
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern void gst_rtsp_connection_clear_auth_params(IntPtr raw);
  
  		public void ClearAuthParams() {
  			gst_rtsp_connection_clear_auth_params(Handle);
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_connection_close(IntPtr raw);
  
  		public Gst.Rtsp.RTSPResult Close() {
  			int raw_ret = gst_rtsp_connection_close(Handle);
  			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
  			return ret;
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_connection_connect(IntPtr raw, IntPtr timeout);
  
  		[Obsolete]
  		public Gst.Rtsp.RTSPResult Connect(IntPtr timeout) {
  			int raw_ret = gst_rtsp_connection_connect(Handle, timeout);
  			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
  			return ret;
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_connection_connect_usec(IntPtr raw, long timeout);
  
  		public Gst.Rtsp.RTSPResult ConnectUsec(long timeout) {
  			int raw_ret = gst_rtsp_connection_connect_usec(Handle, timeout);
  			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
  			return ret;
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_connection_connect_with_response(IntPtr raw, IntPtr timeout, IntPtr response);
  
  		[Obsolete]
  		public Gst.Rtsp.RTSPResult ConnectWithResponse(IntPtr timeout, Gst.Rtsp.RTSPMessage response) {
  			IntPtr native_response = GLib.Marshaller.StructureToPtrAlloc (response);
  			int raw_ret = gst_rtsp_connection_connect_with_response(Handle, timeout, native_response);
  			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
  			Marshal.FreeHGlobal (native_response);
  			return ret;
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_connection_connect_with_response_usec(IntPtr raw, long timeout, IntPtr response);
  
  		public Gst.Rtsp.RTSPResult ConnectWithResponseUsec(long timeout, Gst.Rtsp.RTSPMessage response) {
  			IntPtr native_response = GLib.Marshaller.StructureToPtrAlloc (response);
  			int raw_ret = gst_rtsp_connection_connect_with_response_usec(Handle, timeout, native_response);
  			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
  			Marshal.FreeHGlobal (native_response);
  			return ret;
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_connection_do_tunnel(IntPtr raw, IntPtr conn2);
  
  		public Gst.Rtsp.RTSPResult DoTunnel(Gst.Rtsp.RTSPConnection conn2) {
  			int raw_ret = gst_rtsp_connection_do_tunnel(Handle, conn2 == null ? IntPtr.Zero : conn2.Handle);
  			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
  			return ret;
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_connection_flush(IntPtr raw, bool flush);
  
  		public Gst.Rtsp.RTSPResult Flush(bool flush) {
  			int raw_ret = gst_rtsp_connection_flush(Handle, flush);
  			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
  			return ret;
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_connection_free(IntPtr raw);
  
  		public Gst.Rtsp.RTSPResult Free() {
  			int raw_ret = gst_rtsp_connection_free(Handle);
  			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
  			return ret;
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_rtsp_connection_get_ip(IntPtr raw);
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern void gst_rtsp_connection_set_ip(IntPtr raw, IntPtr ip);
  
  		public string Ip { 
  			get {
  				IntPtr raw_ret = gst_rtsp_connection_get_ip(Handle);
  				string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
  				return ret;
  			}
  			set {
  				IntPtr native_value = GLib.Marshaller.StringToPtrGStrdup (value);
  				gst_rtsp_connection_set_ip(Handle, native_value);
  				GLib.Marshaller.Free (native_value);
  			}
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_rtsp_connection_get_read_socket(IntPtr raw);
  
  		public GLib.Socket ReadSocket { 
  			get {
  				IntPtr raw_ret = gst_rtsp_connection_get_read_socket(Handle);
  				GLib.Socket ret = raw_ret == IntPtr.Zero ? null : (GLib.Socket) GLib.Opaque.GetOpaque (raw_ret, typeof (GLib.Socket), false);
  				return ret;
  			}
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern bool gst_rtsp_connection_get_remember_session_id(IntPtr raw);
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern void gst_rtsp_connection_set_remember_session_id(IntPtr raw, bool remember);
  
  		public bool RememberSessionId { 
  			get {
  				bool raw_ret = gst_rtsp_connection_get_remember_session_id(Handle);
  				bool ret = raw_ret;
  				return ret;
  			}
  			set {
  				gst_rtsp_connection_set_remember_session_id(Handle, value);
  			}
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern unsafe IntPtr gst_rtsp_connection_get_tls(IntPtr raw, out IntPtr error);
  
  		public unsafe GLib.TlsConnection GetTls() {
  			IntPtr error = IntPtr.Zero;
  			IntPtr raw_ret = gst_rtsp_connection_get_tls(Handle, out error);
  			GLib.TlsConnection ret = GLib.Object.GetObject(raw_ret) as GLib.TlsConnection;
  			if (error != IntPtr.Zero) throw new GLib.GException (error);
  			return ret;
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_rtsp_connection_get_tls_database(IntPtr raw);
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern void gst_rtsp_connection_set_tls_database(IntPtr raw, IntPtr database);
  
  		public GLib.TlsDatabase TlsDatabase { 
  			get {
  				IntPtr raw_ret = gst_rtsp_connection_get_tls_database(Handle);
  				GLib.TlsDatabase ret = GLib.Object.GetObject(raw_ret, true) as GLib.TlsDatabase;
  				return ret;
  			}
  			set {
  				gst_rtsp_connection_set_tls_database(Handle, value == null ? IntPtr.Zero : value.Handle);
  			}
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_rtsp_connection_get_tls_interaction(IntPtr raw);
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern void gst_rtsp_connection_set_tls_interaction(IntPtr raw, IntPtr interaction);
  
  		public GLib.TlsInteraction TlsInteraction { 
  			get {
  				IntPtr raw_ret = gst_rtsp_connection_get_tls_interaction(Handle);
  				GLib.TlsInteraction ret = GLib.Object.GetObject(raw_ret, true) as GLib.TlsInteraction;
  				return ret;
  			}
  			set {
  				gst_rtsp_connection_set_tls_interaction(Handle, value == null ? IntPtr.Zero : value.Handle);
  			}
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_connection_get_tls_validation_flags(IntPtr raw);
  
  		public GLib.TlsCertificateFlags TlsValidationFlags { 
  			get {
  				int raw_ret = gst_rtsp_connection_get_tls_validation_flags(Handle);
  				GLib.TlsCertificateFlags ret = (GLib.TlsCertificateFlags) raw_ret;
  				return ret;
  			}
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_rtsp_connection_get_tunnelid(IntPtr raw);
  
  		public string Tunnelid { 
  			get {
  				IntPtr raw_ret = gst_rtsp_connection_get_tunnelid(Handle);
  				string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
  				return ret;
  			}
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_rtsp_connection_get_url(IntPtr raw);
  
  		public Gst.Rtsp.RTSPUrl Url { 
  			get {
  				IntPtr raw_ret = gst_rtsp_connection_get_url(Handle);
  				Gst.Rtsp.RTSPUrl ret = Gst.Rtsp.RTSPUrl.New (raw_ret);
  				return ret;
  			}
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_rtsp_connection_get_write_socket(IntPtr raw);
  
  		public GLib.Socket WriteSocket { 
  			get {
  				IntPtr raw_ret = gst_rtsp_connection_get_write_socket(Handle);
  				GLib.Socket ret = raw_ret == IntPtr.Zero ? null : (GLib.Socket) GLib.Opaque.GetOpaque (raw_ret, typeof (GLib.Socket), false);
  				return ret;
  			}
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern bool gst_rtsp_connection_is_tunneled(IntPtr raw);
  
  		public bool IsTunneled { 
  			get {
  				bool raw_ret = gst_rtsp_connection_is_tunneled(Handle);
  				bool ret = raw_ret;
  				return ret;
  			}
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_connection_next_timeout(IntPtr raw, IntPtr timeout);
  
  		[Obsolete]
  		public Gst.Rtsp.RTSPResult NextTimeout(IntPtr timeout) {
  			int raw_ret = gst_rtsp_connection_next_timeout(Handle, timeout);
  			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
  			return ret;
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern long gst_rtsp_connection_next_timeout_usec(IntPtr raw);
  
  		public long NextTimeoutUsec() {
  			long raw_ret = gst_rtsp_connection_next_timeout_usec(Handle);
  			long ret = raw_ret;
  			return ret;
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_connection_poll(IntPtr raw, int events, int revents, IntPtr timeout);
  
  		[Obsolete]
  		public Gst.Rtsp.RTSPResult Poll(Gst.Rtsp.RTSPEvent events, Gst.Rtsp.RTSPEvent revents, IntPtr timeout) {
  			int raw_ret = gst_rtsp_connection_poll(Handle, (int) events, (int) revents, timeout);
  			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
  			return ret;
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_connection_poll_usec(IntPtr raw, int events, int revents, long timeout);
  
  		public Gst.Rtsp.RTSPResult PollUsec(Gst.Rtsp.RTSPEvent events, Gst.Rtsp.RTSPEvent revents, long timeout) {
  			int raw_ret = gst_rtsp_connection_poll_usec(Handle, (int) events, (int) revents, timeout);
  			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
  			return ret;
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_connection_read(IntPtr raw, byte data, uint size, IntPtr timeout);
  
  		[Obsolete]
  		public Gst.Rtsp.RTSPResult Read(byte data, uint size, IntPtr timeout) {
  			int raw_ret = gst_rtsp_connection_read(Handle, data, size, timeout);
  			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
  			return ret;
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_connection_read_usec(IntPtr raw, byte data, uint size, long timeout);
  
  		public Gst.Rtsp.RTSPResult ReadUsec(byte data, uint size, long timeout) {
  			int raw_ret = gst_rtsp_connection_read_usec(Handle, data, size, timeout);
  			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
  			return ret;
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_connection_receive(IntPtr raw, IntPtr message, IntPtr timeout);
  
  		[Obsolete]
  		public Gst.Rtsp.RTSPResult Receive(Gst.Rtsp.RTSPMessage message, IntPtr timeout) {
  			IntPtr native_message = GLib.Marshaller.StructureToPtrAlloc (message);
  			int raw_ret = gst_rtsp_connection_receive(Handle, native_message, timeout);
  			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
  			Marshal.FreeHGlobal (native_message);
  			return ret;
  		}
  
  		[DllImport("gstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_rtsp_connection_receive_usec(IntPtr raw, IntPtr message, long timeout);
  
  		public Gst.Rtsp.RTSPResult ReceiveUsec(Gst.Rtsp.RTSPMessage message, long timeout) {
  			IntPtr native_message = GLib.Marshaller.StructureToPtrAlloc (message);
  			int raw_ret = gst_rtsp_connection_receive_usec(Handle, native_message, timeout);
  
gt: 			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;