]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/logo.c
Use var_InheritString for --decklink-video-connection.
[vlc] / modules / video_filter / logo.c
index c31e8108ab50c5244c8e00c55ba60dfc3534dee2..7bf4cc46a3e2fcb2ee5f4151abbe3563ec6e11c7 100644 (file)
@@ -34,9 +34,9 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_filter.h>
+#include <vlc_url.h>
 
 #include <vlc_image.h>
-#include <vlc_osd.h>
 
 #ifdef LoadImage
 #   undef LoadImage
@@ -94,8 +94,8 @@ vlc_module_begin ()
     add_shortcut( "logo" )
 
     add_file( CFG_PREFIX "file", NULL, NULL, FILE_TEXT, FILE_LONGTEXT, false )
-    add_integer( CFG_PREFIX "x", 0, NULL, POSX_TEXT, POSX_LONGTEXT, true )
-    add_integer( CFG_PREFIX "y", 0, NULL, POSY_TEXT, POSY_LONGTEXT, true )
+    add_integer( CFG_PREFIX "x", -1, NULL, POSX_TEXT, POSX_LONGTEXT, true )
+    add_integer( CFG_PREFIX "y", -1, NULL, POSY_TEXT, POSY_LONGTEXT, true )
     /* default to 1000 ms per image, continuously cycle through them */
     add_integer( CFG_PREFIX "delay", 1000, NULL, DELAY_TEXT, DELAY_LONGTEXT, true )
     add_integer( CFG_PREFIX "repeat", -1, NULL, REPEAT_TEXT, REPEAT_LONGTEXT, true )
@@ -231,7 +231,6 @@ static int OpenCommon( vlc_object_t *p_this, bool b_sub )
         return VLC_EGENERIC;
     }
 
-
     /* */
     p_filter->p_sys = p_sys = malloc( sizeof( *p_sys ) );
     if( !p_sys )
@@ -299,7 +298,7 @@ static int OpenCommon( vlc_object_t *p_this, bool b_sub )
     else
     {
         p_filter->pf_video_filter = FilterVideo;
-        p_filter->pf_mouse = Mouse;
+        p_filter->pf_video_mouse = Mouse;
     }
 
     free( psz_filename );
@@ -401,7 +400,7 @@ static subpicture_t *FilterSub( filter_t *p_filter, mtime_t date )
     /*  where to locate the logo: */
     if( p_sys->i_pos < 0 )
     {   /*  set to an absolute xy */
-        p_region->i_align = OSD_ALIGN_RIGHT | OSD_ALIGN_TOP;
+        p_region->i_align = SUBPICTURE_ALIGN_RIGHT | SUBPICTURE_ALIGN_TOP;
         p_spu->b_absolute = true;
     }
     else
@@ -534,6 +533,14 @@ static int Mouse( filter_t *p_filter, vlc_mouse_t *p_mouse,
                                     p_filter->fmt_in.video.i_width  - i_logo_w );
             p_sys->i_pos_y = __MIN( __MAX( p_sys->i_pos_y + i_dy, 0 ),
                                     p_filter->fmt_in.video.i_height - i_logo_h );
+
+            /* object under mouse has moved */
+            var_SetBool( p_filter->p_parent, "mouse-object", true );
+        }
+        else if( b_over )
+        {
+            /* object under mouse stoped moving */
+            var_SetBool( p_filter->p_parent, "mouse-object", false );
         }
 
         if( p_sys->b_mouse_grab || b_over )
@@ -608,7 +615,9 @@ static picture_t *LoadImage( vlc_object_t *p_this, const char *psz_filename )
     if( !p_image )
         return NULL;
 
-    picture_t *p_pic = image_ReadUrl( p_image, psz_filename, &fmt_in, &fmt_out );
+    char *psz_url = make_URI( psz_filename, NULL );
+    picture_t *p_pic = image_ReadUrl( p_image, psz_url, &fmt_in, &fmt_out );
+    free( psz_url );
     image_HandlerDelete( p_image );
 
     return p_pic;