X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fvideo_filter%2Ffilter_common.h;h=2efc0521d3a6744be35a8d0b091787524e385a0c;hb=ab1e2b524cb535d8c2ef1a7914f359d679d83136;hp=bed8ed4afe5be8d47b6fc4dba483e90f0c636188;hpb=19ea8feb6db01c1deafb19f35ecee8eff81aeb02;p=vlc diff --git a/modules/video_filter/filter_common.h b/modules/video_filter/filter_common.h index bed8ed4afe..2efc0521d3 100644 --- a/modules/video_filter/filter_common.h +++ b/modules/video_filter/filter_common.h @@ -1,8 +1,8 @@ /***************************************************************************** * filter_common.h: Common filter functions ***************************************************************************** - * Copyright (C) 2001 VideoLAN - * $Id: filter_common.h,v 1.1 2002/08/04 17:23:43 sam Exp $ + * Copyright (C) 2001, 2002, 2003 the VideoLAN team + * $Id$ * * Authors: Samuel Hocevar * @@ -10,7 +10,7 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -18,7 +18,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ #define ALLOCATE_DIRECTBUFFERS( i_max ) \ @@ -43,10 +43,10 @@ } \ \ /* Allocate the picture */ \ - vout_AllocatePicture( p_vout, p_pic, \ + vout_AllocatePicture( VLC_OBJECT(p_vout), p_pic, p_vout->output.i_chroma, \ p_vout->output.i_width, \ p_vout->output.i_height, \ - p_vout->output.i_chroma ); \ + p_vout->output.i_aspect ); \ \ if( !p_pic->i_planes ) \ { \ @@ -61,3 +61,42 @@ 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 ) +{ + VLC_UNUSED(p_this); VLC_UNUSED(oldval); + 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, "mouse-clicked", 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 ); + +#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 * );