public static Gst.Interfaces.NavigationEventType EventGetType(Gst.Event evnt)
        {
            int raw_ret = gst_navigation_event_get_type(evnt == null ? IntPtr.Zero : evnt.Handle);

            Gst.Interfaces.NavigationEventType ret = (Gst.Interfaces.NavigationEventType)raw_ret;
            return(ret);
        }
    protected override bool OnSrcEvent(Gst.Event evt)
    {
        NavigationEventType t = NavigationEvent.EventGetType(evt);

        if (t == NavigationEventType.MouseButtonPress)
        {
            double x, y;
            int    btn;

            if (NavigationEvent.ParseMouseButtonEvent(evt, out btn, out x, out y))
            {
                if (btn == 1)
                {
                    lastX = (int)x;
                    lastY = (int)y;
                }
            }
        }
        else if (t == NavigationEventType.MouseButtonRelease)
        {
            lastX = lastY = -1;
        }

        return(base.OnSrcEvent(evt));
    }
        public static bool ParseCommand(Gst.Event evnt, out Gst.Interfaces.NavigationCommand command)
        {
            int  raw_command;
            bool ret = gst_navigation_event_parse_command(evnt.Handle, out raw_command);

            command = (Gst.Interfaces.NavigationCommand)raw_command;

            return(ret);
        }
        public static bool ParseKeyEvent(Gst.Event evnt, out string key)
        {
            IntPtr raw_key;
            bool   ret = gst_navigation_event_parse_key_event(evnt.Handle, out raw_key);

            key = GLib.Marshaller.Utf8PtrToString(raw_key);

            return(ret);
        }
Пример #5
0
            bool on_event(Gst.Pad pad, Gst.Event evnt)
            {
                if (evnt.Type == Gst.EventType.Eos)
                {
                    this.PostMessage(Message.NewEos(this));
                }

                return(true);
            }
Пример #6
0
 public static Gst.Event NewStillFrame(bool in_still)
 {
     Gst.Event ev = (Gst.Event)Gst.MiniObject.GetObject(gst_video_event_new_still_frame(in_still), true);
     return(ev);
 }
Пример #7
0
        public static bool ParseStillFrame(Gst.Event evnt, out bool in_still)
        {
            bool ret = gst_video_event_parse_still_frame(evnt.Handle, out in_still);

            return(ret);
        }
 public static bool ParseMouseMoveEvent(Gst.Event evnt, out double x, out double y)
 {
     return(gst_navigation_event_parse_mouse_move_event(evnt.Handle, out x, out y));
 }
 public static bool ParseMouseButtonEvent(Gst.Event evnt, out int button, out double x, out double y)
 {
     return(gst_navigation_event_parse_mouse_button_event(evnt.Handle, out button, out x, out y));
 }