]> git.sesse.net Git - vlc/blobdiff - src/misc/filter_chain.c
ML: Media Library Core
[vlc] / src / misc / filter_chain.c
index 823d24dc53cc1bd0d36d5fbe27de507ba7b02e0e..3fd4c31991ce7e43b6a75788a436a850109cb6a9 100644 (file)
@@ -97,15 +97,16 @@ static int filter_chain_DeleteFilterInternal( filter_chain_t *, filter_t * );
 
 static int UpdateBufferFunctions( filter_chain_t * );
 
+#undef filter_chain_New
 /**
  * Filter chain initialisation
  */
-filter_chain_t *__filter_chain_New( vlc_object_t *p_this,
-                                    const char *psz_capability,
-                                    bool b_allow_fmt_out_change,
-                                    int  (*pf_buffer_allocation_init)( filter_t *, void * ),
-                                    void (*pf_buffer_allocation_clean)( filter_t * ),
-                                    void *p_buffer_allocation_data )
+filter_chain_t *filter_chain_New( vlc_object_t *p_this,
+                                  const char *psz_capability,
+                                  bool b_allow_fmt_out_change,
+                                  int  (*pf_buffer_allocation_init)( filter_t *, void * ),
+                                  void (*pf_buffer_allocation_clean)( filter_t * ),
+                                  void *p_buffer_allocation_data )
 {
     assert( p_this );
     assert( psz_capability );
@@ -283,6 +284,25 @@ int filter_chain_MouseFilter( filter_chain_t *p_chain, vlc_mouse_t *p_dst, const
     return VLC_SUCCESS;
 }
 
+int filter_chain_MouseEvent( filter_chain_t *p_chain,
+                             const vlc_mouse_t *p_mouse,
+                             const video_format_t *p_fmt )
+{
+    for( chained_filter_t *f = p_chain->first; f != NULL; f = f->next )
+    {
+        filter_t *p_filter = &f->filter;
+
+        if( p_filter->pf_sub_mouse )
+        {
+            vlc_mouse_t old = *f->mouse;
+            *f->mouse = *p_mouse;
+            if( p_filter->pf_sub_mouse( p_filter, &old, p_mouse, p_fmt ) )
+                return VLC_EGENERIC;
+        }
+    }
+
+    return VLC_SUCCESS;
+}
 
 /* Helpers */
 static filter_t *filter_chain_AppendFilterInternal( filter_chain_t *p_chain,