]> git.sesse.net Git - vlc/commitdiff
* modules/video_filter/*: forward fullscreen event between children and parent.
authorGildas Bazin <gbazin@videolan.org>
Wed, 15 Oct 2003 22:49:48 +0000 (22:49 +0000)
committerGildas Bazin <gbazin@videolan.org>
Wed, 15 Oct 2003 22:49:48 +0000 (22:49 +0000)
modules/video_filter/adjust.c
modules/video_filter/clone.c
modules/video_filter/crop.c
modules/video_filter/deinterlace/deinterlace.c
modules/video_filter/distort.c
modules/video_filter/filter_common.h
modules/video_filter/invert.c
modules/video_filter/logo.c
modules/video_filter/motionblur.c
modules/video_filter/transform.c
modules/video_filter/wall.c

index 8ced0e52407e21f9686fd5ef0e23c032f091d1c8..68023051afbc0ad678ab2a1c8cf5e9b5b5184acf 100644 (file)
@@ -2,7 +2,7 @@
  * adjust.c : Contrast/Hue/Saturation/Brightness video plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001, 2002, 2003 VideoLAN
- * $Id: adjust.c,v 1.13 2003/05/26 01:25:12 hartman Exp $
+ * $Id: adjust.c,v 1.14 2003/10/15 22:49:48 gbazin Exp $
  *
  * Authors: Simon Latapie <garf@via.ecp.fr>
  *
@@ -156,6 +156,8 @@ static int Init( vout_thread_t *p_vout )
 
     ADD_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
 
+    ADD_PARENT_CALLBACKS( SendEventsToChild );
+
     return VLC_SUCCESS;
 }
 
@@ -187,6 +189,8 @@ static void Destroy( vlc_object_t *p_this )
     vlc_object_detach( p_vout->p_sys->p_vout );
     vout_Destroy( p_vout->p_sys->p_vout );
 
+    DEL_PARENT_CALLBACKS( SendEventsToChild );
+
     free( p_vout->p_sys );
 }
 
@@ -379,3 +383,13 @@ static int SendEvents( vlc_object_t *p_this, char const *psz_var,
     return VLC_SUCCESS;
 }
 
+/*****************************************************************************
+ * SendEventsToChild: forward events to the child/children vout
+ *****************************************************************************/
+static int SendEventsToChild( vlc_object_t *p_this, char const *psz_var,
+                       vlc_value_t oldval, vlc_value_t newval, void *p_data )
+{
+    vout_thread_t *p_vout = (vout_thread_t *)p_this;
+    var_Set( p_vout->p_sys->p_vout, psz_var, newval );
+    return VLC_SUCCESS;
+}
index b1d4325457ea5a07565ae9b505c9b45299d659de..79983cd488423627440794ecfd287651ddf773ae 100644 (file)
@@ -2,7 +2,7 @@
  * clone.c : Clone video plugin for vlc
  *****************************************************************************
  * Copyright (C) 2002, 2003 VideoLAN
- * $Id: clone.c,v 1.10 2003/05/15 22:27:37 massiot Exp $
+ * $Id: clone.c,v 1.11 2003/10/15 22:49:48 gbazin Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -243,6 +243,8 @@ static int Init( vout_thread_t *p_vout )
     if( psz_default_vout ) free( psz_default_vout );
     ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES );
 
+    ADD_PARENT_CALLBACKS( SendEventsToChild );
+
     return VLC_SUCCESS;
 }
 
@@ -272,6 +274,8 @@ static void Destroy( vlc_object_t *p_this )
 
     RemoveAllVout( p_vout );
 
+    DEL_PARENT_CALLBACKS( SendEventsToChild );
+
     free( p_vout->p_sys->pp_vout );
     free( p_vout->p_sys );
 }
@@ -367,3 +371,22 @@ static int SendEvents( vlc_object_t *p_this, char const *psz_var,
 
     return VLC_SUCCESS;
 }
+
+/*****************************************************************************
+ * SendEventsToChild: forward events to the child/children vout
+ *****************************************************************************/
+static int SendEventsToChild( vlc_object_t *p_this, char const *psz_var,
+                       vlc_value_t oldval, vlc_value_t newval, void *p_data )
+{
+    vout_thread_t *p_vout = (vout_thread_t *)p_this;
+    int i_vout;
+
+    for( i_vout = 0; i_vout < p_vout->p_sys->i_clones; i_vout++ )
+    {
+        var_Set( p_vout->p_sys->pp_vout[ i_vout ], psz_var, newval );
+
+        if( !strcmp( psz_var, "fullscreen" ) ) break;
+    }
+
+    return VLC_SUCCESS;
+}
index 7f4ae0692769af93497d50b10bd908e8f3b8e405..563489b235248382c044b78be765d6a1326db424 100644 (file)
@@ -2,7 +2,7 @@
  * crop.c : Crop video plugin for vlc
  *****************************************************************************
  * Copyright (C) 2002, 2003 VideoLAN
- * $Id: crop.c,v 1.12 2003/05/26 02:03:10 hartman Exp $
+ * $Id: crop.c,v 1.13 2003/10/15 22:49:48 gbazin Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -248,6 +248,8 @@ static int Init( vout_thread_t *p_vout )
 
     ADD_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
 
+    ADD_PARENT_CALLBACKS( SendEventsToChild );
+
     return VLC_SUCCESS;
 }
 
@@ -279,6 +281,8 @@ static void Destroy( vlc_object_t *p_this )
     vlc_object_detach( p_vout->p_sys->p_vout );
     vout_Destroy( p_vout->p_sys->p_vout );
 
+    DEL_PARENT_CALLBACKS( SendEventsToChild );
+
     free( p_vout->p_sys );
 }
 
@@ -492,3 +496,13 @@ static int SendEvents( vlc_object_t *p_this, char const *psz_var,
     return VLC_SUCCESS;
 }
 
+/*****************************************************************************
+ * SendEventsToChild: forward events to the child/children vout
+ *****************************************************************************/
+static int SendEventsToChild( vlc_object_t *p_this, char const *psz_var,
+                       vlc_value_t oldval, vlc_value_t newval, void *p_data )
+{
+    vout_thread_t *p_vout = (vout_thread_t *)p_this;
+    var_Set( p_vout->p_sys->p_vout, psz_var, newval );
+    return VLC_SUCCESS;
+}
index 6e545b655bf7609ae85b6d4d6d4e093c66be398f..57057aa254ec826278215271d7ce05b48a6edea3 100644 (file)
@@ -2,7 +2,7 @@
  * deinterlace.c : deinterlacer plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001, 2002, 2003 VideoLAN
- * $Id: deinterlace.c,v 1.14 2003/05/25 11:31:54 gbazin Exp $
+ * $Id: deinterlace.c,v 1.15 2003/10/15 22:49:48 gbazin Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -244,6 +244,8 @@ static int Init( vout_thread_t *p_vout )
 
     ADD_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
 
+    ADD_PARENT_CALLBACKS( SendEventsToChild );
+
     return VLC_SUCCESS;
 }
 
@@ -325,6 +327,8 @@ static void Destroy( vlc_object_t *p_this )
     vlc_object_detach( p_vout->p_sys->p_vout );
     vout_Destroy( p_vout->p_sys->p_vout );
 
+    DEL_PARENT_CALLBACKS( SendEventsToChild );
+
     free( p_vout->p_sys );
 }
 
@@ -796,3 +800,14 @@ static int FilterCallback( vlc_object_t *p_this, char const *psz_cmd,
     vlc_mutex_unlock( &p_vout->p_sys->filter_lock );
     return VLC_SUCCESS;
 }
+
+/*****************************************************************************
+ * SendEventsToChild: forward events to the child/children vout
+ *****************************************************************************/
+static int SendEventsToChild( vlc_object_t *p_this, char const *psz_var,
+                       vlc_value_t oldval, vlc_value_t newval, void *p_data )
+{
+    vout_thread_t *p_vout = (vout_thread_t *)p_this;
+    var_Set( p_vout->p_sys->p_vout, psz_var, newval );
+    return VLC_SUCCESS;
+}
index 1569de7a21ad8d1a8068b33f63410ff6e36a461e..f4d8958e08a97c33fa0ba5e0356fb922f7f2565b 100644 (file)
@@ -2,7 +2,7 @@
  * distort.c : Misc video effects plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001, 2002, 2003 VideoLAN
- * $Id: distort.c,v 1.10 2003/05/15 22:27:37 massiot Exp $
+ * $Id: distort.c,v 1.11 2003/10/15 22:49:48 gbazin Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -201,6 +201,8 @@ static int Init( vout_thread_t *p_vout )
 
     ADD_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
 
+    ADD_PARENT_CALLBACKS( SendEventsToChild );
+
     p_vout->p_sys->f_angle = 0.0;
     p_vout->p_sys->last_date = 0;
 
@@ -235,6 +237,8 @@ static void Destroy( vlc_object_t *p_this )
     vlc_object_detach( p_vout->p_sys->p_vout );
     vout_Destroy( p_vout->p_sys->p_vout );
 
+    DEL_PARENT_CALLBACKS( SendEventsToChild );
+
     free( p_vout->p_sys );
 }
 
@@ -437,3 +441,13 @@ static int SendEvents( vlc_object_t *p_this, char const *psz_var,
     return VLC_SUCCESS;
 }
 
+/*****************************************************************************
+ * SendEventsToChild: forward events to the child/children vout
+ *****************************************************************************/
+static int SendEventsToChild( vlc_object_t *p_this, char const *psz_var,
+                       vlc_value_t oldval, vlc_value_t newval, void *p_data )
+{
+    vout_thread_t *p_vout = (vout_thread_t *)p_this;
+    var_Set( p_vout->p_sys->p_vout, psz_var, newval );
+    return VLC_SUCCESS;
+}
index 6a3433cdb13f37eb37d7cffcdd7f3385466d865a..b4868c0f9a5ae9250cce8d010ee0fa00f4a883c5 100644 (file)
@@ -2,7 +2,7 @@
  * filter_common.h: Common filter functions
  *****************************************************************************
  * Copyright (C) 2001, 2002, 2003 VideoLAN
- * $Id: filter_common.h,v 1.2 2003/01/17 16:18:03 sam Exp $
+ * $Id: filter_common.h,v 1.3 2003/10/15 22:49:48 gbazin Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
         I_OUTPUTPICTURES++;                                                   \
     }                                                                         \
 
+/*****************************************************************************
+ * SetParentVal: forward variable value to parent whithout triggering the
+ *               callback
+ *****************************************************************************/
+static int SetParentVal( vlc_object_t *p_this, char const *psz_var,
+                       vlc_value_t oldval, vlc_value_t newval, void *p_data )
+{
+    var_Change( (vlc_object_t *)p_data, psz_var, VLC_VAR_SETVALUE,
+                 &newval, NULL );
+    return VLC_SUCCESS;
+}
+
 #define ADD_CALLBACKS( newvout, handler ) \
+    var_AddCallback( newvout, "fullscreen", SetParentVal, p_vout );           \
     var_AddCallback( newvout, "mouse-x", SendEvents, p_vout );                \
     var_AddCallback( newvout, "mouse-y", SendEvents, p_vout );                \
     var_AddCallback( newvout, "mouse-moved", SendEvents, p_vout );            \
     var_AddCallback( newvout, "key-pressed", SendEvents, p_vout )
 
 #define DEL_CALLBACKS( newvout, handler ) \
+    var_DelCallback( newvout, "fullscreen", SetParentVal, p_vout );           \
     var_DelCallback( newvout, "mouse-x", SendEvents, p_vout );                \
     var_DelCallback( newvout, "mouse-y", SendEvents, p_vout );                \
     var_DelCallback( newvout, "mouse-moved", SendEvents, p_vout );            \
     var_DelCallback( newvout, "mouse-clicked", SendEvents, p_vout );          \
     var_DelCallback( newvout, "key-pressed", SendEvents, p_vout )
 
+#define ADD_PARENT_CALLBACKS( handler ) \
+    var_AddCallback( p_vout, "fullscreen", handler, NULL );                   \
+    var_AddCallback( p_vout, "aspect-ratio", handler, NULL );                 \
+    var_AddCallback( p_vout, "crop", handler, NULL );
+
+#define DEL_PARENT_CALLBACKS( handler ) \
+    var_DelCallback( p_vout, "fullscreen", handler, NULL );                   \
+    var_DelCallback( p_vout, "aspect-ratio", handler, NULL );                 \
+    var_DelCallback( p_vout, "crop", handler, NULL );
+
+static int  SendEventsToChild( vlc_object_t *, char const *,
+                               vlc_value_t, vlc_value_t, void * );
index 79c623997e4d074ae4e56f4f674e52179d9930a8..454a13c867c204b1fe60b0b0ec46e1e032df6b5b 100644 (file)
@@ -2,7 +2,7 @@
  * invert.c : Invert video plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001, 2002, 2003 VideoLAN
- * $Id: invert.c,v 1.7 2003/03/30 18:14:38 gbazin Exp $
+ * $Id: invert.c,v 1.8 2003/10/15 22:49:48 gbazin Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -127,6 +127,8 @@ static int Init( vout_thread_t *p_vout )
 
     ADD_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
 
+    ADD_PARENT_CALLBACKS( SendEventsToChild );
+
     return VLC_SUCCESS;
 }
 
@@ -158,6 +160,8 @@ static void Destroy( vlc_object_t *p_this )
     vlc_object_detach( p_vout->p_sys->p_vout );
     vout_Destroy( p_vout->p_sys->p_vout );
 
+    DEL_PARENT_CALLBACKS( SendEventsToChild );
+
     free( p_vout->p_sys );
 }
 
@@ -244,3 +248,13 @@ static int SendEvents( vlc_object_t *p_this, char const *psz_var,
     return VLC_SUCCESS;
 }
 
+/*****************************************************************************
+ * SendEventsToChild: forward events to the child/children vout
+ *****************************************************************************/
+static int SendEventsToChild( vlc_object_t *p_this, char const *psz_var,
+                       vlc_value_t oldval, vlc_value_t newval, void *p_data )
+{
+    vout_thread_t *p_vout = (vout_thread_t *)p_this;
+    var_Set( p_vout->p_sys->p_vout, psz_var, newval );
+    return VLC_SUCCESS;
+}
index 62ec22e4b602eba12554012d81c523e3dc861525..01066373374df4614e6b262d8d8d06cbebb0b724 100644 (file)
@@ -2,7 +2,7 @@
  * logo.c : logo video plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001, 2002, 2003 VideoLAN
- * $Id: logo.c,v 1.3 2003/09/18 21:42:54 garf Exp $
+ * $Id: logo.c,v 1.4 2003/10/15 22:49:48 gbazin Exp $
  *
  * Authors: Simon Latapie <garf@videolan.org>
  *
@@ -276,7 +276,9 @@ static int Init( vout_thread_t *p_vout )
     ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES );
 
     ADD_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
-    
+
+    ADD_PARENT_CALLBACKS( SendEventsToChild );
+
     p_vout->p_sys->posx = config_GetInt( p_vout, "logo_x" );
     p_vout->p_sys->posy = config_GetInt( p_vout, "logo_y" );
     p_vout->p_sys->trans = (int)(config_GetFloat( p_vout, "logo_transparency" ) * 255);
@@ -328,6 +330,8 @@ static void Destroy( vlc_object_t *p_this )
 {
     vout_thread_t *p_vout = (vout_thread_t *)p_this;
 
+    DEL_PARENT_CALLBACKS( SendEventsToChild );
+
     free( p_vout->p_sys );
 }
 
@@ -499,3 +503,14 @@ static int MouseEvent( vlc_object_t *p_this, char const *psz_var,
 
     return VLC_SUCCESS;
 }
+
+/*****************************************************************************
+ * SendEventsToChild: forward events to the child/children vout
+ *****************************************************************************/
+static int SendEventsToChild( vlc_object_t *p_this, char const *psz_var,
+                       vlc_value_t oldval, vlc_value_t newval, void *p_data )
+{
+    vout_thread_t *p_vout = (vout_thread_t *)p_this;
+    var_Set( p_vout->p_sys->p_vout, psz_var, newval );
+    return VLC_SUCCESS;
+}
index 76f60c1ffd78b007d0f0e3cbe3b1616aa8184d64..fd4536fa9a263fd8107fea47a8464a7eed2f0d8c 100644 (file)
@@ -2,7 +2,7 @@
  * motion_blur.c : motion blur filter for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001, 2002, 2003 VideoLAN
- * $Id: motionblur.c,v 1.12 2003/05/26 01:25:12 hartman Exp $
+ * $Id: motionblur.c,v 1.13 2003/10/15 22:49:48 gbazin Exp $
  *
  * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
  *
@@ -167,6 +167,8 @@ static int Init( vout_thread_t *p_vout )
 
     ADD_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
 
+    ADD_PARENT_CALLBACKS( SendEventsToChild );
+
     return VLC_SUCCESS;
 }
 
@@ -198,6 +200,8 @@ static void Destroy( vlc_object_t *p_this )
     vlc_object_detach( p_vout->p_sys->p_vout );
     vout_Destroy( p_vout->p_sys->p_vout );
 
+    DEL_PARENT_CALLBACKS( SendEventsToChild );
+
     free( p_vout->p_sys );
 }
 
@@ -345,3 +349,13 @@ static int SendEvents( vlc_object_t *p_this, char const *psz_var,
     return VLC_SUCCESS;
 }
 
+/*****************************************************************************
+ * SendEventsToChild: forward events to the child/children vout
+ *****************************************************************************/
+static int SendEventsToChild( vlc_object_t *p_this, char const *psz_var,
+                       vlc_value_t oldval, vlc_value_t newval, void *p_data )
+{
+    vout_thread_t *p_vout = (vout_thread_t *)p_this;
+    var_Set( p_vout->p_sys->p_vout, psz_var, newval );
+    return VLC_SUCCESS;
+}
index b983254c353d892f39e8e67b64ab3737e1de8767..a90fdff441f060874bb19424408cf911f851e83c 100644 (file)
@@ -2,7 +2,7 @@
  * transform.c : transform image plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001, 2002, 2003 VideoLAN
- * $Id: transform.c,v 1.13 2003/08/22 13:38:03 hartman Exp $
+ * $Id: transform.c,v 1.14 2003/10/15 22:49:48 gbazin Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -202,6 +202,8 @@ static int Init( vout_thread_t *p_vout )
 
     ADD_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
 
+    ADD_PARENT_CALLBACKS( SendEventsToChild );
+
     return VLC_SUCCESS;
 }
 
@@ -233,6 +235,8 @@ static void Destroy( vlc_object_t *p_this )
     vlc_object_detach( p_vout->p_sys->p_vout );
     vout_Destroy( p_vout->p_sys->p_vout );
 
+    DEL_PARENT_CALLBACKS( SendEventsToChild );
+
     free( p_vout->p_sys );
 }
 
@@ -463,3 +467,13 @@ static int SendEvents( vlc_object_t *p_this, char const *psz_var,
     return VLC_SUCCESS;
 }
 
+/*****************************************************************************
+ * SendEventsToChild: forward events to the child/children vout
+ *****************************************************************************/
+static int SendEventsToChild( vlc_object_t *p_this, char const *psz_var,
+                       vlc_value_t oldval, vlc_value_t newval, void *p_data )
+{
+    vout_thread_t *p_vout = (vout_thread_t *)p_this;
+    var_Set( p_vout->p_sys->p_vout, psz_var, newval );
+    return VLC_SUCCESS;
+}
index ce94b3359b7baf5b7b61650734ffcf965922320b..fd3ec5e2d6b8436cc480ecc80d04891da9b3c23e 100644 (file)
@@ -2,7 +2,7 @@
  * wall.c : Wall video plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001, 2002, 2003 VideoLAN
- * $Id: wall.c,v 1.10 2003/05/15 22:27:37 massiot Exp $
+ * $Id: wall.c,v 1.11 2003/10/15 22:49:48 gbazin Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -273,6 +273,8 @@ static int Init( vout_thread_t *p_vout )
 
     ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES );
 
+    ADD_PARENT_CALLBACKS( SendEventsToChild );
+
     return VLC_SUCCESS;
 }
 
@@ -302,6 +304,8 @@ static void Destroy( vlc_object_t *p_this )
 
     RemoveAllVout( p_vout );
 
+    DEL_PARENT_CALLBACKS( SendEventsToChild );
+
     free( p_vout->p_sys->pp_vout );
     free( p_vout->p_sys );
 }
@@ -474,3 +478,24 @@ static int SendEvents( vlc_object_t *p_this, char const *psz_var,
     return VLC_SUCCESS;
 }
 
+/*****************************************************************************
+ * SendEventsToChild: forward events to the child/children vout
+ *****************************************************************************/
+static int SendEventsToChild( vlc_object_t *p_this, char const *psz_var,
+                       vlc_value_t oldval, vlc_value_t newval, void *p_data )
+{
+    vout_thread_t *p_vout = (vout_thread_t *)p_this;
+    int i_row, i_col, i_vout = 0;
+
+    for( i_row = 0; i_row < p_vout->p_sys->i_row; i_row++ )
+    {
+        for( i_col = 0; i_col < p_vout->p_sys->i_col; i_col++ )
+        {
+            var_Set( p_vout->p_sys->pp_vout[ i_vout ].p_vout, psz_var, newval);
+            if( !strcmp( psz_var, "fullscreen" ) ) break;
+            i_vout++;
+        }
+    }
+
+    return VLC_SUCCESS;
+}