From: Gildas Bazin Date: Wed, 15 Oct 2003 22:49:48 +0000 (+0000) Subject: * modules/video_filter/*: forward fullscreen event between children and parent. X-Git-Tag: 0.7.0~792 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=8b784013ef6e0ff9b62bb9070abfc6bd2b82b914;p=vlc * modules/video_filter/*: forward fullscreen event between children and parent. --- diff --git a/modules/video_filter/adjust.c b/modules/video_filter/adjust.c index 8ced0e5240..68023051af 100644 --- a/modules/video_filter/adjust.c +++ b/modules/video_filter/adjust.c @@ -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 * @@ -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; +} diff --git a/modules/video_filter/clone.c b/modules/video_filter/clone.c index b1d4325457..79983cd488 100644 --- a/modules/video_filter/clone.c +++ b/modules/video_filter/clone.c @@ -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 * @@ -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; +} diff --git a/modules/video_filter/crop.c b/modules/video_filter/crop.c index 7f4ae06927..563489b235 100644 --- a/modules/video_filter/crop.c +++ b/modules/video_filter/crop.c @@ -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 * @@ -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; +} diff --git a/modules/video_filter/deinterlace/deinterlace.c b/modules/video_filter/deinterlace/deinterlace.c index 6e545b655b..57057aa254 100644 --- a/modules/video_filter/deinterlace/deinterlace.c +++ b/modules/video_filter/deinterlace/deinterlace.c @@ -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 * @@ -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; +} diff --git a/modules/video_filter/distort.c b/modules/video_filter/distort.c index 1569de7a21..f4d8958e08 100644 --- a/modules/video_filter/distort.c +++ b/modules/video_filter/distort.c @@ -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 * @@ -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; +} diff --git a/modules/video_filter/filter_common.h b/modules/video_filter/filter_common.h index 6a3433cdb1..b4868c0f9a 100644 --- a/modules/video_filter/filter_common.h +++ b/modules/video_filter/filter_common.h @@ -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 * @@ -61,7 +61,20 @@ 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 ); \ @@ -69,9 +82,22 @@ 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 * ); diff --git a/modules/video_filter/invert.c b/modules/video_filter/invert.c index 79c623997e..454a13c867 100644 --- a/modules/video_filter/invert.c +++ b/modules/video_filter/invert.c @@ -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 * @@ -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; +} diff --git a/modules/video_filter/logo.c b/modules/video_filter/logo.c index 62ec22e4b6..0106637337 100644 --- a/modules/video_filter/logo.c +++ b/modules/video_filter/logo.c @@ -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 * @@ -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; +} diff --git a/modules/video_filter/motionblur.c b/modules/video_filter/motionblur.c index 76f60c1ffd..fd4536fa9a 100644 --- a/modules/video_filter/motionblur.c +++ b/modules/video_filter/motionblur.c @@ -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 * @@ -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; +} diff --git a/modules/video_filter/transform.c b/modules/video_filter/transform.c index b983254c35..a90fdff441 100644 --- a/modules/video_filter/transform.c +++ b/modules/video_filter/transform.c @@ -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 * @@ -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; +} diff --git a/modules/video_filter/wall.c b/modules/video_filter/wall.c index ce94b3359b..fd3ec5e2d6 100644 --- a/modules/video_filter/wall.c +++ b/modules/video_filter/wall.c @@ -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 * @@ -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; +}