Commit 8b784013 authored by Gildas Bazin's avatar Gildas Bazin

* modules/video_filter/*: forward fullscreen event between children and parent.
parent 205c1ecf
......@@ -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;
}
......@@ -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;
}
......@@ -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;
}
......@@ -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;
}
......@@ -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;
}
......@@ -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>
*
......@@ -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 * );
......@@ -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;
}
......@@ -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;
}
......@@ -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;
}
......@@ -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;
}
......@@ -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;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment