]> git.sesse.net Git - vlc/commitdiff
"[PATCH] for changing the mosaic-order in execution time" by Mateus Krepsky Ludwich...
authorAntoine Cellerier <dionoea@videolan.org>
Fri, 5 May 2006 20:34:42 +0000 (20:34 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Fri, 5 May 2006 20:34:42 +0000 (20:34 +0000)
modules/control/rc.c
modules/video_filter/mosaic.c

index 42177a6b796548bddb7f35724a7306ba55d8d1d4..05c104b1829b6586a02e3e8b483ca2d5e1473cb7 100644 (file)
@@ -428,6 +428,8 @@ static void RegisterCallbacks( intf_thread_t *p_intf )
     var_AddCallback( p_intf, "mosaic-rows", Other, NULL );
     var_Create( p_intf, "mosaic-cols", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
     var_AddCallback( p_intf, "mosaic-cols", Other, NULL );
+    var_Create( p_intf, "mosaic-order", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
+    var_AddCallback( p_intf, "mosaic-order", Other, NULL );
     var_Create( p_intf, "mosaic-keep-aspect-ratio",
                      VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
     var_AddCallback( p_intf, "mosaic-keep-aspect-ratio", Other, NULL );
@@ -953,6 +955,7 @@ static void Help( intf_thread_t *p_intf, vlc_bool_t b_longhelp)
         msg_rc(_("| mosaic-position {0=auto,1=fixed} . . . .position"));
         msg_rc(_("| mosaic-rows #. . . . . . . . . . .number of rows"));
         msg_rc(_("| mosaic-cols #. . . . . . . . . . .number of cols"));
+        msg_rc(_("| mosaic-order id(,id)* . . . . order of pictures "));
         msg_rc(_("| mosaic-keep-aspect-ratio {0,1} . . .aspect ratio"));
         msg_rc(  "| ");
         msg_rc(_("| check-updates [newer] [equal] [older]\n"
@@ -1551,6 +1554,14 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
             var_Set( p_input->p_libvlc, "mosaic-cols", val );
         }
     }
+    else if( !strcmp( psz_cmd, "mosaic-order" ) )
+    {
+        if( strlen( newval.psz_string ) > 0)
+        {
+            val.psz_string = newval.psz_string;
+            var_Set( p_input->p_libvlc, "mosaic-order", val );
+        }
+    }
     else if( !strcmp( psz_cmd, "mosaic-keep-aspect-ratio" ) )
     {
         if( strlen( newval.psz_string ) > 0)
index ef6473b5af51e7a0ca5d1f8ef6ebb0e1792e6abf..fbca6ee34fd1dfd278a103aabf3a83bd4a85b2dc 100644 (file)
@@ -296,6 +296,9 @@ static int CreateFilter( vlc_object_t *p_this )
     p_sys->ppsz_order = NULL;
     psz_order = var_CreateGetString( p_filter, "mosaic-order" );
 
+    var_Create( p_libvlc, "mosaic-order", VLC_VAR_STRING);
+    var_AddCallback( p_libvlc, "mosaic-order", MosaicCallback, p_sys );
+
     if( psz_order[0] != 0 )
     {
         char *psz_end = NULL;
@@ -859,6 +862,41 @@ static int MosaicCallback( vlc_object_t *p_this, char const *psz_var,
         p_sys->i_cols = __MAX( newval.i_int, 1 );
         vlc_mutex_unlock( &p_sys->lock );
     }
+    else if( !strcmp( psz_var, "mosaic-order" ) )
+    {
+        vlc_mutex_lock( &p_sys->lock );
+        msg_Dbg( p_this, "Changing mosaic order to %s", newval.psz_string );
+
+        char *psz_order;
+        int i_index;
+        p_sys->i_order_length = 0;
+        p_sys->ppsz_order = NULL;
+        psz_order = newval.psz_string;
+
+        while( p_sys->i_order_length-- )
+        {
+            printf("%d\n", p_sys->ppsz_order);
+            free( p_sys->ppsz_order );
+        }
+        if( psz_order[0] != 0 )
+        {
+            char *psz_end = NULL;
+            i_index = 0;
+            do
+            {
+                psz_end = strchr( psz_order, ',' );
+                i_index++;
+                p_sys->ppsz_order = realloc( p_sys->ppsz_order,
+                                    i_index * sizeof(char *) );
+                p_sys->ppsz_order[i_index - 1] = strndup( psz_order,
+                                           psz_end - psz_order );
+                psz_order = psz_end+1;
+            } while( NULL !=  psz_end );
+            p_sys->i_order_length = i_index;
+        }
+
+        vlc_mutex_unlock( &p_sys->lock );
+    }
     else if( !strcmp( psz_var, "mosaic-keep-aspect-ratio" ) )
     {
         vlc_mutex_lock( &p_sys->lock );