Exemplo n.º 1
0
		static IntPtr GetProtocolsFull_cb (IntPtr gtype)
		{
			try {
				Gst.GLib.GType gt = new Gst.GLib.GType (gtype);
				System.Type t = (System.Type) gt;

				if (protocols_cache.Contains (gtype)) {
				  return (IntPtr) protocols_cache[gtype];
				}

				System.Reflection.PropertyInfo pi = t.GetProperty ("Protocols", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.FlattenHierarchy);
				string[] __result;
				if (pi != null && pi.PropertyType == typeof (string[]))
				  __result = (string[]) pi.GetValue (null, null);
				else
				  __result = new string[] {};
				IntPtr ret = Gst.Marshaller.StringArrayToNullTermPointer (__result);
				protocols_cache.Add (gtype, ret);

				return ret;
			} catch (Exception e) {
				Gst.GLib.ExceptionManager.RaiseUnhandledException (e, true);
				// NOTREACHED: above call does not return.
				throw e;
			}
		}
Exemplo n.º 2
0
Arquivo: Tag.cs Projeto: jwzl/ossbuild
		public static Gst.GLib.GType GetGType(string tag) {
			IntPtr native_tag = Gst.GLib.Marshaller.StringToPtrGStrdup (tag);
			IntPtr raw_ret = gst_tag_get_type(native_tag);
			Gst.GLib.GType ret = new Gst.GLib.GType(raw_ret);
			Gst.GLib.Marshaller.Free (native_tag);
			return ret;
		}
Exemplo n.º 3
0
		static int GetTypeFull_cb (IntPtr gtype)
		{
			try {
				Gst.GLib.GType gt = new Gst.GLib.GType (gtype);
				System.Type t = (System.Type) gt;

				System.Reflection.PropertyInfo pi = t.GetProperty ("Type", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.FlattenHierarchy);
				Gst.URIType __result = Gst.URIType.Unknown;
				if (pi != null && pi.PropertyType == typeof (Gst.URIType))
				  __result = (Gst.URIType) pi.GetValue (null, null);

				return (int) __result;
			} catch (Exception e) {
				Gst.GLib.ExceptionManager.RaiseUnhandledException (e, true);
				// NOTREACHED: above call does not return.
				throw e;
			}
		}
Exemplo n.º 4
0
		static IntPtr ConstructorCallback (IntPtr gtypeval, uint n_construct_properties, IntPtr construct_properties)
		{
			GType gtype = new Gst.GLib.GType (gtypeval);
			GObjectClass threshold_class = (GObjectClass) Marshal.PtrToStructure (gtype.GetThresholdType ().GetClassPtr (), typeof (GObjectClass));
			IntPtr raw = threshold_class.constructor_cb (gtypeval, n_construct_properties, construct_properties);
			bool construct_needed = true;
			for (int i = 0; i < n_construct_properties; i++) {
				IntPtr p = new IntPtr (construct_properties.ToInt64 () + i * 2 * IntPtr.Size);

				string prop_name = Marshaller.Utf8PtrToString (g_param_spec_get_name (Marshal.ReadIntPtr (p)));
				if (prop_name != "gtk-sharp-managed-instance")
					continue;

				Value val = (Value) Marshal.PtrToStructure (Marshal.ReadIntPtr (p, IntPtr.Size), typeof (Value));
				if ((IntPtr) val.Val != IntPtr.Zero) {
					GCHandle gch = (GCHandle) (IntPtr) val.Val;
					Object o = (Gst.GLib.Object) gch.Target;
					o.Raw = raw;
					construct_needed = false;
					break;
				}
			}

			if (construct_needed)
				GetObject (raw, false);

			return raw;
		}