public static uint AddWatch(IOChannel channel, int priority, IOCondition condition, IOFunc func, DestroyNotify notify) { objs.Add(func); objs.Add(notify); return(g_io_add_watch_full(channel, priority, condition, func, IntPtr.Zero, notify)); }
private bool DataReadyHandler (IntPtr channel, IOCondition condition, IntPtr data) { DataReadEventArgs args = new DataReadEventArgs (condition); if (data_ready != null) data_ready (this, args); return args.Continue; }
bool DataReadyHandler(IntPtr channel, IOCondition condition, IntPtr data) { var args = new DataReadEventArgs(condition); if (data_ready != null) { data_ready(this, args); } return(args.Continue); }
public uint AddWatch(int priority, IOCondition condition, IOFunc func) { IOFuncWrapper func_wrapper = null; IntPtr user_data = IntPtr.Zero; DestroyNotify notify = null; if (func != null) { func_wrapper = new IOFuncWrapper(func); user_data = (IntPtr)GCHandle.Alloc(func_wrapper); notify = DestroyHelper.NotifyHandler; } return(g_io_add_watch_full(Handle, priority, (int)condition, func_wrapper.NativeDelegate, user_data, notify)); }
/// <summary> /// Process keyboard input /// </summary> static bool HandleKeyboard(IOChannel source, IOCondition condition) { if (source.ReadLine(out string str) != IOStatus.Normal) { return(true); } switch (Char.ToLower(str[0])) { case 'p': _data.Playing = !_data.Playing; var newState = _data.Playing ? State.Playing : State.Paused; _data.Pipeline.SetState(newState); Console.WriteLine("Setting state to {0}", newState); break; case 's': if (str[0] == 'S') { _data.Rate *= 2.0; } else { _data.Rate /= 2.0; } SendSeekEvent(); break; case 'd': _data.Rate *= -1.0; SendSeekEvent(); break; case 'n': if (_data.VideoSink == null) { //If we have not done so, obtain the sink through which we will send the step events _data.VideoSink = (Element)_data.Pipeline["video-sink"]; } var stepEvent = Gst.Event.NewStep(Format.Buffers, 10, Math.Abs(_data.Rate), true, false); _data.VideoSink.SendEvent(stepEvent); Console.WriteLine("Stepping one frame"); break; case 'q': _data.Loop.Quit(); break; } return(true); }
static bool ReadStdout(IOChannel source, IOCondition condition) { if ((condition & IOCondition.In) == IOCondition.In) { string txt; if (source.ReadToEnd(out txt) == IOStatus.Normal) { Console.WriteLine("[AsyncWithPipesTest output] " + txt); } } if ((condition & IOCondition.Hup) == IOCondition.Hup) { source.Dispose(); ml.Quit(); return(true); } return(true); }
static extern uint g_io_add_watch(HandleRef handle, IOCondition cond, IOFunc func, IntPtr data);
protected static extern uint g_io_add_watch_full(IOChannel channel, int priority, IOCondition condition, IOFunc func, IntPtr user_data, DestroyNotify notify);
public static uint AddWatch(IOChannel channel, IOCondition condition, IOFunc func) { objs.Add(func); return(g_io_add_watch(channel, condition, func, IntPtr.Zero)); }
protected static extern uint g_io_add_watch(IOChannel channel, IOCondition condition, IOFunc func, IntPtr user_data);
static bool ReadStdout (IOChannel source, IOCondition condition) { if ((condition & IOCondition.In) == IOCondition.In) { string txt; if (source.ReadToEnd (out txt) == IOStatus.Normal) Console.WriteLine ("[AsyncWithPipesTest output] " + txt); } if ((condition & IOCondition.Hup) == IOCondition.Hup) { source.Dispose (); ml.Quit (); return true; } return true; }
private uint AddWatch (IOCondition condition, IOFunc func) { return g_io_add_watch (handle, condition, func, IntPtr.Zero); }
public DataReadEventArgs(IOCondition condition) { Condition = condition; Continue = true; }
public static uint AddWatch(IOChannel channel, IOCondition condition, IOFunc func) { objs.Add (func); return g_io_add_watch (channel.Handle, condition, func, IntPtr.Zero); }
protected static extern uint g_io_add_watch(IntPtr channel, IOCondition condition, IOFunc func, IntPtr user_data);
private static WatchEventKind MapEventsL(IOCondition events) { WatchEventKind val = WatchEventKind.None; if((events & IOCondition.In) != 0) val |= WatchEventKind.In; else if((events & IOCondition.Out) != 0) val |= WatchEventKind.Out; else if((events & IOCondition.Err) != 0) val |= WatchEventKind.Err; else if((events & IOCondition.Hup) != 0) val |= WatchEventKind.Hup; return val; }
uint AddWatch(IOCondition ioCondition, IOFunc ioFunc) { return(g_io_add_watch(handle, ioCondition, ioFunc, IntPtr.Zero)); }
public uint AddWatch (int priority, IOCondition condition, IOFunc func) { IOFuncWrapper func_wrapper = null; IntPtr user_data = IntPtr.Zero; DestroyNotify notify = null; if (func != null) { func_wrapper = new IOFuncWrapper (func); user_data = (IntPtr) GCHandle.Alloc (func_wrapper); notify = DestroyHelper.NotifyHandler; } return g_io_add_watch_full (Handle, priority, (int) condition, func_wrapper.NativeDelegate, user_data, notify); }
public static uint AddWatch(IOChannel channel, int priority, IOCondition condition, IOFunc func, DestroyNotify notify) { objs.Add (func); objs.Add (notify); return g_io_add_watch_full (channel.Handle, priority, condition, func, IntPtr.Zero, notify); }
private uint AddWatch(IOCondition condition, IOFunc func) { return g_io_add_watch (handle, condition, func, IntPtr.Zero); }
protected static extern uint g_io_add_watch_full(IntPtr channel, int priority, IOCondition condition, IOFunc func, IntPtr user_data, DestroyNotify notify);
private bool DataReadyHandler(IntPtr channel, IOCondition condition, IntPtr data) { DataReadEventArgs args = new DataReadEventArgs (condition); if (data_ready != null) data_ready (this, args); return args.Continue; }