[vlc-commits] ci_filters: handle mouse events

Thomas Guillem git at videolan.org
Fri Sep 29 13:18:27 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Sep 29 13:06:43 2017 +0200| [c41d3aa342f627a85b9c8b6275a1f5b5dc3a83e6] | committer: Thomas Guillem

ci_filters: handle mouse events

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c41d3aa342f627a85b9c8b6275a1f5b5dc3a83e6
---

 modules/video_filter/ci_filters.m | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/modules/video_filter/ci_filters.m b/modules/video_filter/ci_filters.m
index 9f6c0db093..7630be18a4 100644
--- a/modules/video_filter/ci_filters.m
+++ b/modules/video_filter/ci_filters.m
@@ -32,6 +32,7 @@
 #include <vlc_picture.h>
 #include <vlc_plugin.h>
 #include <vlc_modules.h>
+#include <vlc_mouse.h>
 #include "filter_picture.h"
 #include "vt_utils.h"
 
@@ -78,6 +79,9 @@ struct  ci_filters_ctx
 struct filter_sys_t
 {
     char const *                psz_filter;
+    bool                        mouse_moved;
+    vlc_mouse_t                 old_mouse;
+    vlc_mouse_t                 mouse;
     struct ci_filters_ctx *     ctx;
 };
 
@@ -349,16 +353,30 @@ Filter(filter_t *filter, picture_t *src)
             return NULL;
     }
 
+    filter->p_sys->mouse_moved = false;
     return dst;
 
 error:
     if (dst)
         picture_Release(dst);
     picture_Release(src);
+    filter->p_sys->mouse_moved = false;
     return NULL;
 }
 
 static int
+Mouse(filter_t *filter, struct vlc_mouse_t *mouse,
+      const struct vlc_mouse_t *old, const struct vlc_mouse_t *new)
+{
+    VLC_UNUSED(mouse);
+    filter_sys_t *sys = filter->p_sys;
+    sys->old_mouse = *old;
+    sys->mouse = *new;
+    sys->mouse_moved = true;
+    return VLC_EGENERIC;
+}
+
+static int
 Open_FilterInit(filter_t *filter, struct filter_chain *fchain)
 {
     struct filter_param_desc const *filter_param_descs =
@@ -605,6 +623,7 @@ Open(vlc_object_t *obj, char const *psz_filter)
     filter->p_sys->ctx = ctx;
 
     filter->pf_video_filter = Filter;
+    filter->pf_video_mouse = Mouse;
 
     return VLC_SUCCESS;
 



More information about the vlc-commits mailing list