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;
		}
Beispiel #3
0
        bool DataReadyHandler(IntPtr channel, IOCondition condition, IntPtr data)
        {
            var args = new DataReadEventArgs(condition);

            if (data_ready != null)
            {
                data_ready(this, args);
            }

            return(args.Continue);
        }
Beispiel #4
0
        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);
 }
Beispiel #7
0
 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);
Beispiel #11
0
		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);
		}
Beispiel #13
0
 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);
Beispiel #16
0
 public DataReadEventArgs(IOCondition condition)
 {
     Condition = condition;
     Continue  = true;
 }
Beispiel #17
0
 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;
 }
Beispiel #18
0
 uint AddWatch(IOCondition ioCondition, IOFunc ioFunc)
 {
     return(g_io_add_watch(handle, ioCondition, ioFunc, IntPtr.Zero));
 }
Beispiel #19
0
 static extern uint g_io_add_watch(HandleRef handle, IOCondition cond, IOFunc func, IntPtr data);
Beispiel #20
0
		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);
        }
Beispiel #22
0
 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);
Beispiel #24
0
        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;
        }