[vlc-devel] [PATCH] for changing the mosaic-order in execution time - in construction

Mateus Krepsky Ludwich mateus at csp.com.br
Thu May 4 22:56:31 CEST 2006


I did this, but do not work. It seems that when I typed "mosaic-order 
X,Y" in rc, the function MosaicCallback in mosaic module does not been 
called.

Index: modules/video_filter/mosaic.c
===================================================================
--- modules/video_filter/mosaic.c       (revisão 15531)
+++ modules/video_filter/mosaic.c       (cópia de trabalho)
@@ -859,6 +859,37 @@
          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 the order of mosaic");
+
+        char *psz_order;
+        int i_index;
+        p_sys->i_order_length = 0;
+        p_sys->ppsz_order = NULL;
+        psz_order = newval.psz_string;
+
+        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 );


Index: modules/control/rc.c
===================================================================
--- modules/control/rc.c        (revisão 15531)
+++ modules/control/rc.c        (cópia de trabalho)
@@ -428,6 +428,8 @@
      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 );
@@ -1547,6 +1549,14 @@
              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)

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list