Beispiel #1
0
		static IntPtr GetValues_cb (IntPtr inst, uint prop_id, IntPtr pspec)
		{
			try {
				PropertyProbeImplementor __obj = Gst.GLib.Object.GetObject (inst, false) as PropertyProbeImplementor;
				Gst.PropertyInfo pi = new Gst.PropertyInfo (pspec);
				object[] values = __obj.GetValues (pi.Name);
				Gst.GLib.ValueArray va = new Gst.GLib.ValueArray ((uint) values.Length);

				foreach (object v in values)
					va.Append (new Gst.GLib.Value (v));
				return va.Handle;
			} catch (Exception e) {
				Gst.GLib.ExceptionManager.RaiseUnhandledException (e, false);
				// NOTREACHED: above call does not return.
				throw e;
			}
		}
Beispiel #2
0
		private void InternalChildRemoved (Gst.Object child)
		{
			Gst.GLib.Value ret = Gst.GLib.Value.Empty;
			Gst.GLib.ValueArray inst_and_params = new Gst.GLib.ValueArray (2);
			Gst.GLib.Value[] vals = new Gst.GLib.Value [2];
			vals [0] = new Gst.GLib.Value (this);
			inst_and_params.Append (vals [0]);
			vals [1] = new Gst.GLib.Value (child);
			inst_and_params.Append (vals [1]);
			g_signal_chain_from_overridden (inst_and_params.ArrayPtr, ref ret);
			foreach (Gst.GLib.Value v in vals)
				v.Dispose ();
		}
Beispiel #3
0
		public object[] ProbeAndGetValues (string name) {
			IntPtr raw_name = Gst.GLib.Marshaller.StringToPtrGStrdup (name);
			IntPtr raw_ret = gst_property_probe_probe_and_get_values_name (Handle, raw_name);
			Gst.GLib.Marshaller.Free (raw_name);
			if (raw_ret == IntPtr.Zero)
				return new object[] {};

			Gst.GLib.ValueArray va = new Gst.GLib.ValueArray (raw_ret);
			ArrayList ret = new ArrayList ();
			foreach (Gst.GLib.Value v in va)
			  ret.Add ((object) v.Val);

			va.Dispose ();

			return (object[]) ret.ToArray (typeof (object));		
		}
Beispiel #4
0
		public static object Emit (Gst.GLib.Object instance, string detailed_signal, params object[] args)
		{
			uint gquark, signal_id;
			string signal_name;
			ParseSignalDetail (detailed_signal, out signal_name, out gquark);
			signal_id = GetSignalId (signal_name, instance);
			if (signal_id <= 0)
				throw new ArgumentException ("Invalid signal name: " + signal_name);
			Gst.GLib.Value[] vals = new Gst.GLib.Value [args.Length + 1];
			Gst.GLib.ValueArray inst_and_params = new Gst.GLib.ValueArray ((uint) args.Length + 1);
			
			vals [0] = new Gst.GLib.Value (instance);
			inst_and_params.Append (vals [0]);
			for (int i = 1; i < vals.Length; i++) {
				vals [i] = new Gst.GLib.Value (args [i - 1]);
				inst_and_params.Append (vals [i]);
			}

			object ret_obj = null;
			Query query;
			g_signal_query (signal_id, out query);
			if (query.return_type != GType.None.Val) {
				Gst.GLib.Value ret = Gst.GLib.Value.Empty;
				g_signal_emitv (inst_and_params.ArrayPtr, signal_id, gquark, ref ret);
				ret_obj = ret.Val;
				ret.Dispose ();
			} else
				g_signal_emitv (inst_and_params.ArrayPtr, signal_id, gquark, IntPtr.Zero);
			
			foreach (Gst.GLib.Value val in vals)
				val.Dispose ();

			return ret_obj;
		}