///Push new Custom Function Return Data public void PushReturnData(FlowReturn call, System.Type type) { if (returnData == null) { returnData = new Stack <ReturnData>(); } returnData.Push(new ReturnData(call, type)); }
///Invokes the function and callbacks when a Return node is hit. public void InvokeAsync(Flow f, FlowHandler flowCallback, params object[] args) { this.args = args; FlowReturn returnCallback = (o) => { this.returnValue = o; flowCallback(f); }; var invocationFlow = new Flow(); invocationFlow.SetReturnData(returnCallback, returns.type); onInvoke.Call(invocationFlow); }
///Invokes the function and return it's return value public object Invoke(Flow f, params object[] args) { this.args = args; FlowReturn returnCallback = (o) => { this.returnValue = o; }; var invocationFlow = new Flow(); invocationFlow.SetReturnData(returnCallback, returns.type); onInvoke.Call(invocationFlow); return(returnValue); }
///Invokes the function and callbacks when a Return node is hit. public void InvokeAsync(Flow f, FlowHandler flowCallback, params object[] args) { if (isInvoking) { Logger.LogWarning("Invoking a Custom Function which is already running.", "Execution", this); } this.args = args; isInvoking = true; FlowReturn returnCallback = (o) => { this.returnValue = o; isInvoking = false; flowCallback(f); }; var invocationFlow = new Flow(); invocationFlow.SetReturnData(returnCallback, returns.type); onInvoke.Call(invocationFlow); }
public void TestPushUnlinked() { Pad src = new Pad("src", PadDirection.Src); Assert.IsNotNull(src, "Could not create src"); Caps caps = src.AllowedCaps; Assert.IsNull(caps); caps = Caps.FromString("foo/bar"); src.SetCaps(caps); Gst.Buffer buffer = new Gst.Buffer(); Assert.AreEqual(src.Push(buffer), FlowReturn.NotLinked); ulong handler_id = src.AddBufferProbe(new PadBufferProbeCallback(ProbeHandler)); buffer = new Gst.Buffer(new byte[] { 0 }); FlowReturn flowreturn = src.Push(buffer); Assert.AreEqual(flowreturn, FlowReturn.Ok); }
///---------------------------------------------------------------------------------------------- ///Set Return Data to be calledback when Return is called public void SetReturnData(FlowReturn call, System.Type expectedType) { returnData = new ReturnData(call, expectedType); }
public ReturnData(FlowReturn call, System.Type type) { returnCall = call; returnType = type; }