Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

filter_common.h

00001 /*****************************************************************************
00002  * filter_common.h: Common filter functions
00003  *****************************************************************************
00004  * Copyright (C) 2001, 2002, 2003 the VideoLAN team
00005  * $Id: filter_common.h 11664 2005-07-09 06:17:09Z courmisch $
00006  *
00007  * Authors: Samuel Hocevar <[email protected]>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
00022  *****************************************************************************/
00023 
00024 #define ALLOCATE_DIRECTBUFFERS( i_max ) \
00025     /* Try to initialize i_max direct buffers */                              \
00026     while( I_OUTPUTPICTURES < ( i_max ) )                                     \
00027     {                                                                         \
00028         p_pic = NULL;                                                         \
00029                                                                               \
00030         /* Find an empty picture slot */                                      \
00031         for( i_index = 0 ; i_index < VOUT_MAX_PICTURES ; i_index++ )          \
00032         {                                                                     \
00033             if( p_vout->p_picture[ i_index ].i_status == FREE_PICTURE )       \
00034             {                                                                 \
00035                 p_pic = p_vout->p_picture + i_index;                          \
00036                 break;                                                        \
00037             }                                                                 \
00038         }                                                                     \
00039                                                                               \
00040         if( p_pic == NULL )                                                   \
00041         {                                                                     \
00042             break;                                                            \
00043         }                                                                     \
00044                                                                               \
00045         /* Allocate the picture */                                            \
00046         vout_AllocatePicture( VLC_OBJECT(p_vout), p_pic, p_vout->output.i_chroma, \
00047                               p_vout->output.i_width,                         \
00048                               p_vout->output.i_height,                        \
00049                               p_vout->output.i_aspect );                      \
00050                                                                               \
00051         if( !p_pic->i_planes )                                                \
00052         {                                                                     \
00053             break;                                                            \
00054         }                                                                     \
00055                                                                               \
00056         p_pic->i_status = DESTROYED_PICTURE;                                  \
00057         p_pic->i_type   = DIRECT_PICTURE;                                     \
00058                                                                               \
00059         PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic;                         \
00060                                                                               \
00061         I_OUTPUTPICTURES++;                                                   \
00062     }                                                                         \
00063 
00064 /*****************************************************************************
00065  * SetParentVal: forward variable value to parent whithout triggering the
00066  *               callback
00067  *****************************************************************************/
00068 static int SetParentVal( vlc_object_t *p_this, char const *psz_var,
00069                        vlc_value_t oldval, vlc_value_t newval, void *p_data )
00070 {
00071     var_Change( (vlc_object_t *)p_data, psz_var, VLC_VAR_SETVALUE,
00072                  &newval, NULL );
00073     return VLC_SUCCESS;
00074 }
00075 
00076 #define ADD_CALLBACKS( newvout, handler ) \
00077     var_AddCallback( newvout, "fullscreen", SetParentVal, p_vout );           \
00078     var_AddCallback( newvout, "mouse-x", SendEvents, p_vout );                \
00079     var_AddCallback( newvout, "mouse-y", SendEvents, p_vout );                \
00080     var_AddCallback( newvout, "mouse-moved", SendEvents, p_vout );            \
00081     var_AddCallback( newvout, "mouse-clicked", SendEvents, p_vout );
00082 
00083 #define DEL_CALLBACKS( newvout, handler ) \
00084     var_DelCallback( newvout, "fullscreen", SetParentVal, p_vout );           \
00085     var_DelCallback( newvout, "mouse-x", SendEvents, p_vout );                \
00086     var_DelCallback( newvout, "mouse-y", SendEvents, p_vout );                \
00087     var_DelCallback( newvout, "mouse-moved", SendEvents, p_vout );            \
00088     var_DelCallback( newvout, "mouse-clicked", SendEvents, p_vout );
00089 
00090 #define ADD_PARENT_CALLBACKS( handler ) \
00091     var_AddCallback( p_vout, "fullscreen", handler, NULL );                   \
00092     var_AddCallback( p_vout, "aspect-ratio", handler, NULL );                 \
00093     var_AddCallback( p_vout, "crop", handler, NULL );
00094 
00095 #define DEL_PARENT_CALLBACKS( handler ) \
00096     var_DelCallback( p_vout, "fullscreen", handler, NULL );                   \
00097     var_DelCallback( p_vout, "aspect-ratio", handler, NULL );                 \
00098     var_DelCallback( p_vout, "crop", handler, NULL );
00099 
00100 static int  SendEventsToChild( vlc_object_t *, char const *,
00101                                vlc_value_t, vlc_value_t, void * );

Generated on Tue Dec 20 10:14:52 2005 for vlc-0.8.4a by  doxygen 1.4.2