// 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
	public partial class Global {

		[DllImport("libgstsdp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_sdp_address_is_multicast(IntPtr nettype, IntPtr addrtype, IntPtr addr);

		public static bool SdpAddressIsMulticast(string nettype, string addrtype, string addr) {
			IntPtr native_nettype = GLib.Marshaller.StringToPtrGStrdup (nettype);
			IntPtr native_addrtype = GLib.Marshaller.StringToPtrGStrdup (addrtype);
			IntPtr native_addr = GLib.Marshaller.StringToPtrGStrdup (addr);
			bool raw_ret = gst_sdp_address_is_multicast(native_nettype, native_addrtype, native_addr);
			bool ret = raw_ret;
			GLib.Marshaller.Free (native_nettype);
			GLib.Marshaller.Free (native_addrtype);
			GLib.Marshaller.Free (native_addr);
			return ret;
		}

		[DllImport("libgstsdp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_sdp_make_keymgmt(IntPtr uri, IntPtr base64);

		public static string SdpMakeKeymgmt(string uri, string base64) {
			IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
			IntPtr native_base64 = GLib.Marshaller.StringToPtrGStrdup (base64);
			IntPtr raw_ret = gst_sdp_make_keymgmt(native_uri, native_base64);
			string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
			GLib.Marshaller.Free (native_uri);
			GLib.Marshaller.Free (native_base64);
			return ret;
		}

		[DllImport("libgstsdp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern int gst_sdp_media_new(IntPtr media);

		public static Gst.Sdp.SDPResult SdpMediaNew(out Gst.Sdp.SDPMedia media) {
			IntPtr native_media = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (Gst.Sdp.SDPMedia)));
			int raw_ret = gst_sdp_media_new(native_media);
			Gst.Sdp.SDPResult ret = (Gst.Sdp.SDPResult) raw_ret;
			media = Gst.Sdp.SDPMedia.New (native_media);
			Marshal.FreeHGlobal (native_media);
			return ret;
		}

		[DllImport("libgstsdp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern int gst_sdp_media_set_media_from_caps(IntPtr caps, IntPtr media);

		public static Gst.Sdp.SDPResult SdpMediaSetMediaFromCaps(Gst.Caps caps, Gst.Sdp.SDPMedia media) {
			IntPtr native_media = GLib.Marshaller.StructureToPtrAlloc (media);
			int raw_ret = gst_sdp_media_set_media_from_caps(caps == null ? IntPtr.Zero : caps.Handle, native_media);
			Gst.Sdp.SDPResult ret = (Gst.Sdp.SDPResult) raw_ret;
			Marshal.FreeHGlobal (native_media);
			return ret;
		}

		[DllImport("libgstsdp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_sdp_message_as_uri(IntPtr scheme, IntPtr msg);

		public static string SdpMessageAsUri(string scheme, Gst.Sdp.SDPMessage msg) {
			IntPtr native_scheme = GLib.Marshaller.StringToPtrGStrdup (scheme);
			IntPtr raw_ret = gst_sdp_message_as_uri(native_scheme, msg == null ? IntPtr.Zero : msg.Handle);
			string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
			GLib.Marshaller.Free (native_scheme);
			return ret;
		}

		[DllImport("libgstsdp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern int gst_sdp_message_new(out IntPtr msg);

		public static Gst.Sdp.SDPResult SdpMessageNew(out Gst.Sdp.SDPMessage msg) {
			IntPtr native_msg;
			int raw_ret = gst_sdp_message_new(out native_msg);
			Gst.Sdp.SDPResult ret = (Gst.Sdp.SDPResult) raw_ret;
			msg = native_msg == IntPtr.Zero ? null : (Gst.Sdp.SDPMessage) GLib.Opaque.GetOpaque (native_msg, typeof (Gst.Sdp.SDPMessage), true);
			return ret;
		}

		[DllImport("libgstsdp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern int gst_sdp_message_parse_buffer(byte[] data, uint size, IntPtr msg);

		public static Gst.Sdp.SDPResult SdpMessageParseBuffer(byte[] data, uint size, Gst.Sdp.SDPMessage msg) {
			int raw_ret = gst_sdp_message_parse_buffer(data, size, msg == null ? IntPtr.Zero : msg.Handle);
			Gst.Sdp.SDPResult ret = (Gst.Sdp.SDPResult) raw_ret;
			return ret;
		}

		[DllImport("libgstsdp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern int gst_sdp_message_parse_uri(IntPtr uri, IntPtr msg);

		public static Gst.Sdp.SDPResult SdpMessageParseUri(string uri, Gst.Sdp.SDPMessage msg) {
			IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
			int raw_ret = gst_sdp_message_parse_uri(native_uri, msg == null ? IntPtr.Zero : msg.Handle);
			Gst.Sdp.SDPResult ret = (Gst.Sdp.SDPResult) raw_ret;
			GLib.Marshaller.Free (native_uri);
			return ret;
		}

#endregion
	}
}
