context: // This file was generated by the Gtk# code generator.
  // Any changes made will be lost if regenerated.
  
  namespace Gst {
  
  	using System;
  	using System.Runtime.InteropServices;
  
  #region Autogenerated code
  	public partial class Tag {
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern bool gst_tag_exists(IntPtr tag);
  
  		public static bool Exists(string tag) {
  			IntPtr native_tag = GLib.Marshaller.StringToPtrGStrdup (tag);
  			bool raw_ret = gst_tag_exists(native_tag);
  			bool ret = raw_ret;
  			GLib.Marshaller.Free (native_tag);
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_tag_get_description(IntPtr tag);
  
  		public static string GetDescription(string tag) {
  			IntPtr native_tag = GLib.Marshaller.StringToPtrGStrdup (tag);
  			IntPtr raw_ret = gst_tag_get_description(native_tag);
  			string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
  			GLib.Marshaller.Free (native_tag);
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_tag_get_flag(IntPtr tag);
  
  		public static Gst.TagFlag GetFlag(string tag) {
  			IntPtr native_tag = GLib.Marshaller.StringToPtrGStrdup (tag);
  			int raw_ret = gst_tag_get_flag(native_tag);
  			Gst.TagFlag ret = (Gst.TagFlag) raw_ret;
  			GLib.Marshaller.Free (native_tag);
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_tag_get_nick(IntPtr tag);
  
  		public static string GetNick(string tag) {
  			IntPtr native_tag = GLib.Marshaller.StringToPtrGStrdup (tag);
  			IntPtr raw_ret = gst_tag_get_nick(native_tag);
  			string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
  			GLib.Marshaller.Free (native_tag);
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_tag_get_type(IntPtr tag);
  
  		public static GLib.GType GetType(string tag) {
  			IntPtr native_tag = GLib.Marshaller.StringToPtrGStrdup (tag);
  			IntPtr raw_ret = gst_tag_get_type(native_tag);
  			GLib.GType ret = new GLib.GType(raw_ret);
  			GLib.Marshaller.Free (native_tag);
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern bool gst_tag_is_fixed(IntPtr tag);
  
  		public static bool IsFixed(string tag) {
  			IntPtr native_tag = GLib.Marshaller.StringToPtrGStrdup (tag);
  			bool raw_ret = gst_tag_is_fixed(native_tag);
  			bool ret = raw_ret;
  			GLib.Marshaller.Free (native_tag);
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern bool gst_tag_list_copy_value(IntPtr dest, IntPtr list, IntPtr tag);
  
  		public static bool ListCopyValue(ref GLib.Value dest, Gst.TagList list, string tag) {
  			IntPtr native_dest = GLib.Marshaller.StructureToPtrAlloc (dest);
  			IntPtr native_tag = GLib.Marshaller.StringToPtrGStrdup (tag);
  			bool raw_ret = gst_tag_list_copy_value(native_dest, list == null ? IntPtr.Zero : list.Handle, native_tag);
  			bool ret = raw_ret;
  			dest = (GLib.Value) Marshal.PtrToStructure (native_dest, typeof (GLib.Value));
  			Marshal.FreeHGlobal (native_dest);
  			GLib.Marshaller.Free (native_tag);
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern void gst_tag_merge_strings_with_comma(IntPtr dest, IntPtr src);
  
  		public static GLib.Value MergeStringsWithComma(GLib.Value src) {
  			GLib.Value dest;
  			IntPtr native_dest = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (GLib.Value)));
  			IntPtr native_src = GLib.Marshaller.StructureToPtrAlloc (src);
  			gst_tag_merge_strings_with_comma(native_dest, native_src);
  			dest = (GLib.Value) Marshal.PtrToStructure (native_dest, typeof (GLib.Value));
  			Marshal.FreeHGlobal (native_dest);
  			Marshal.FreeHGlobal (native_src);
  			return dest;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern void gst_tag_merge_use_first(IntPtr dest, IntPtr src);
  
  		public static GLib.Value MergeUseFirst(GLib.Value src) {
  			GLib.Value dest;
  			IntPtr native_dest = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (GLib.Value)));
  			IntPtr native_src = GLib.Marshaller.StructureToPtrAlloc (src);
  			gst_tag_merge_use_first(native_dest, native_src);
  			dest = (GLib.Value) Marshal.PtrToStructure (native_dest, typeof (GLib.Value));
  			Marshal.FreeHGlobal (native_dest);
  			Marshal.FreeHGlobal (native_src);
  			return dest;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern bool gst_tag_check_language_code(IntPtr lang_code);
  
  		public static bool CheckLanguageCode(string lang_code) {
  			IntPtr native_lang_code = GLib.Marshaller.StringToPtrGStrdup (lang_code);
  			bool raw_ret = gst_tag_check_language_code(native_lang_code);
  			bool ret = raw_ret;
  			GLib.Marshaller.Free (native_lang_code);
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_tag_freeform_string_to_utf8(IntPtr[] data, int size, IntPtr[] env_vars);
  
  		public static string FreeformStringToUtf8(string[] data, int size, string[] env_vars) {
  			int cnt_data = data == null ? 0 : data.Length;
  			IntPtr[] native_data = new IntPtr [cnt_data];
  			for (int i = 0; i < cnt_data; i++)
  				native_data [i] = GLib.Marshaller.StringToPtrGStrdup(data[i]);
  			int cnt_env_vars = env_vars == null ? 0 : env_vars.Length;
  			IntPtr[] native_env_vars = new IntPtr [cnt_env_vars + 1];
  			for (int i = 0; i < cnt_env_vars; i++)
  				native_env_vars [i] = GLib.Marshaller.StringToPtrGStrdup(env_vars[i]);
  			native_env_vars [cnt_env_vars] = IntPtr.Zero;
  			IntPtr raw_ret = gst_tag_freeform_string_to_utf8(native_data, size, native_env_vars);
  			string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_tag_from_id3_tag(IntPtr id3_tag);
  
  		public static string FromId3Tag(string id3_tag) {
  			IntPtr native_id3_tag = GLib.Marshaller.StringToPtrGStrdup (id3_tag);
  			IntPtr raw_ret = gst_tag_from_id3_tag(native_id3_tag);
  			string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
  			GLib.Marshaller.Free (native_id3_tag);
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_tag_from_id3_user_tag(IntPtr type, IntPtr id3_user_tag);
  
  		public static string FromId3UserTag(string type, string id3_user_tag) {
  			IntPtr native_type = GLib.Marshaller.StringToPtrGStrdup (type);
  			IntPtr native_id3_user_tag = GLib.Marshaller.StringToPtrGStrdup (id3_user_tag);
  			IntPtr raw_ret = gst_tag_from_id3_user_tag(native_type, native_id3_user_tag);
  			string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
  			GLib.Marshaller.Free (native_type);
  			GLib.Marshaller.Free (native_id3_user_tag);
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_tag_from_vorbis_tag(IntPtr vorbis_tag);
  
  		public static string FromVorbisTag(string vorbis_tag) {
  			IntPtr native_vorbis_tag = GLib.Marshaller.StringToPtrGStrdup (vorbis_tag);
  			IntPtr raw_ret = gst_tag_from_vorbis_tag(native_vorbis_tag);
  			string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
  			GLib.Marshaller.Free (native_vorbis_tag);
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern uint gst_tag_get_id3v2_tag_size(IntPtr buffer);
  
  		public static uint GetId3v2TagSize(Gst.Buffer buffer) {
  			uint raw_ret = gst_tag_get_id3v2_tag_size(buffer == null ? IntPtr.Zero : buffer.Handle);
  			uint ret = raw_ret;
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_tag_get_language_code_iso_639_1(IntPtr lang_code);
  
  		public static string GetLanguageCodeIso6391(string lang_code) {
  			IntPtr native_lang_code = GLib.Marshaller.StringToPtrGStrdup (lang_code);
  			IntPtr raw_ret = gst_tag_get_language_code_iso_639_1(native_lang_code);
  			string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
  			GLib.Marshaller.Free (native_lang_code);
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_tag_get_language_code_iso_639_2B(IntPtr lang_code);
  
  		public static string GetLanguageCodeIso6392B(string lang_code) {
  			IntPtr native_lang_code = GLib.Marshaller.StringToPtrGStrdup (lang_code);
  			IntPtr raw_ret = gst_tag_get_language_code_iso_639_2B(native_lang_code);
  			string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
  			GLib.Marshaller.Free (native_lang_code);
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_tag_get_language_code_iso_639_2T(IntPtr lang_code);
  
  		public static string GetLanguageCodeIso6392T(string lang_code) {
  			IntPtr native_lang_code = GLib.Marshaller.StringToPtrGStrdup (lang_code);
  			IntPtr raw_ret = gst_tag_get_language_code_iso_639_2T(native_lang_code);
  			string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
  			GLib.Marshaller.Free (native_lang_code);
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_tag_get_language_codes();
  
  		public static string[] GetLanguageCodes() {
  			IntPtr raw_ret = gst_tag_get_language_codes();
  			string[] ret = GLib.Marshaller.NullTermPtrToStringArray (raw_ret, true);
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_tag_get_language_name(IntPtr language_code);
  
  		public static string GetLanguageName(string language_code) {
  			IntPtr native_language_code = GLib.Marshaller.StringToPtrGStrdup (language_code);
  			IntPtr raw_ret = gst_tag_get_language_name(native_language_code);
  			string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
  			GLib.Marshaller.Free (native_language_code);
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_tag_get_license_description(IntPtr license_ref);
  
  		public static string GetLicenseDescription(string license_ref) {
  			IntPtr native_license_ref = GLib.Marshaller.StringToPtrGStrdup (license_ref);
  			IntPtr raw_ret = gst_tag_get_license_description(native_license_ref);
  			string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
  			GLib.Marshaller.Free (native_license_ref);
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern int gst_tag_get_license_flags(IntPtr license_ref);
  
  		public static Gst.Tags.TagLicenseFlags GetLicenseFlags(string license_ref) {
  			IntPtr native_license_ref = GLib.Marshaller.StringToPtrGStrdup (license_ref);
  			int raw_ret = gst_tag_get_license_flags(native_license_ref);
  			Gst.Tags.TagLicenseFlags ret = (Gst.Tags.TagLicenseFlags) raw_ret;
  			GLib.Marshaller.Free (native_license_ref);
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_tag_get_license_jurisdiction(IntPtr license_ref);
  
  		public static string GetLicenseJurisdiction(string license_ref) {
  			IntPtr native_license_ref = GLib.Marshaller.StringToPtrGStrdup (license_ref);
  			IntPtr raw_ret = gst_tag_get_license_jurisdiction(native_license_ref);
  			string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
  			GLib.Marshaller.Free (native_license_ref);
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_tag_get_license_nick(IntPtr license_ref);
  
  		public static string GetLicenseNick(string license_ref) {
  			IntPtr native_license_ref = GLib.Marshaller.StringToPtrGStrdup (license_ref);
  			IntPtr raw_ret = gst_tag_get_license_nick(native_license_ref);
  			string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
  			GLib.Marshaller.Free (native_license_ref);
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_tag_get_license_title(IntPtr license_ref);
  
  		public static string GetLicenseTitle(string license_ref) {
  			IntPtr native_license_ref = GLib.Marshaller.StringToPtrGStrdup (license_ref);
  			IntPtr raw_ret = gst_tag_get_license_title(native_license_ref);
  			string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
  			GLib.Marshaller.Free (native_license_ref);
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_tag_get_license_version(IntPtr license_ref);
  
  		public static string GetLicenseVersion(string license_ref) {
  			IntPtr native_license_ref = GLib.Marshaller.StringToPtrGStrdup (license_ref);
  			IntPtr raw_ret = gst_tag_get_license_version(native_license_ref);
  			string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
  			GLib.Marshaller.Free (native_license_ref);
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_tag_get_licenses();
  
  		public static string[] GetLicenses() {
  			IntPtr raw_ret = gst_tag_get_licenses();
  			string[] ret = GLib.Marshaller.NullTermPtrToStringArray (raw_ret, true);
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern uint gst_tag_id3_genre_count();
  
  		public static uint Id3GenreCount() {
  			uint raw_ret = gst_tag_id3_genre_count();
  			uint ret = raw_ret;
  			return ret;
  		}
  
  		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gst_tag_id3_genre_get(uint id);
  
  		public static string Id3GenreGet(uint id) {
  			IntPtr raw_ret = gst_tag_id3_genre_get(id);
  
gt: 			string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);