* wall.c : Wall video plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: wall.c,v 1.24 2002/07/20 18:01:42 sam Exp $
+ * $Id: wall.c,v 1.25 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#include "filter_common.h"
/*****************************************************************************
- * Capabilities defined in the other files.
+ * Local prototypes
*****************************************************************************/
-static void vout_getfunctions( function_list_t * p_function_list );
+static int Create ( vlc_object_t * );
+static void Destroy ( vlc_object_t * );
+
+static int Init ( vout_thread_t * );
+static void End ( vout_thread_t * );
+static void Render ( vout_thread_t *, picture_t * );
+
+static void RemoveAllVout ( vout_thread_t *p_vout );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
#define COLS_TEXT N_("Number of columns")
#define COLS_LONGTEXT N_("Select the number of horizontal videowindows in " \
#define ACTIVE_LONGTEXT N_("comma separated list of active windows, " \
"defaults to all")
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
-ADD_INTEGER ( "wall-cols", 3, NULL, COLS_TEXT, COLS_LONGTEXT )
-ADD_INTEGER ( "wall-rows", 3, NULL, ROWS_TEXT, ROWS_LONGTEXT )
-ADD_STRING ( "wall-active", NULL, NULL, ACTIVE_TEXT, ACTIVE_LONGTEXT )
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("image wall video module") )
- /* Capability score set to 0 because we don't want to be spawned
- * as a video output unless explicitly requested to */
- ADD_CAPABILITY( VOUT_FILTER, 0 )
- ADD_SHORTCUT( "wall" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- vout_getfunctions( &p_module->p_functions->vout );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ add_category_hint( N_("Miscellaneous"), NULL );
+ add_integer( "wall-cols", 3, NULL, COLS_TEXT, COLS_LONGTEXT );
+ add_integer( "wall-rows", 3, NULL, ROWS_TEXT, ROWS_LONGTEXT );
+ add_string( "wall-active", NULL, NULL, ACTIVE_TEXT, ACTIVE_LONGTEXT );
+ set_description( _("image wall video module") );
+ set_capability( "video filter", 0 );
+ add_shortcut( "wall" );
+ set_callbacks( Create, Destroy );
+vlc_module_end();
/*****************************************************************************
* vout_sys_t: Wall video output method descriptor
};
/*****************************************************************************
- * Local prototypes
- *****************************************************************************/
-static int vout_Create ( vout_thread_t * );
-static int vout_Init ( vout_thread_t * );
-static void vout_End ( vout_thread_t * );
-static void vout_Destroy ( vout_thread_t * );
-static int vout_Manage ( vout_thread_t * );
-static void vout_Render ( vout_thread_t *, picture_t * );
-static void vout_Display ( vout_thread_t *, picture_t * );
-
-static void RemoveAllVout ( vout_thread_t *p_vout );
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void vout_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.vout.pf_create = vout_Create;
- p_function_list->functions.vout.pf_init = vout_Init;
- p_function_list->functions.vout.pf_end = vout_End;
- p_function_list->functions.vout.pf_destroy = vout_Destroy;
- p_function_list->functions.vout.pf_manage = vout_Manage;
- p_function_list->functions.vout.pf_render = vout_Render;
- p_function_list->functions.vout.pf_display = vout_Display;
-}
-
-/*****************************************************************************
- * vout_Create: allocates Wall video thread output method
+ * Create: allocates Wall video thread output method
*****************************************************************************
* This function allocates and initializes a Wall vout method.
*****************************************************************************/
-static int vout_Create( vout_thread_t *p_vout )
+static int Create( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
char *psz_method, *psz_tmp, *psz_method_tmp;
int i_vout;
return( 1 );
}
+ p_vout->pf_init = Init;
+ p_vout->pf_end = End;
+ p_vout->pf_manage = NULL;
+ p_vout->pf_render = Render;
+ p_vout->pf_display = NULL;
+
/* Look what method was requested */
p_vout->p_sys->i_col = config_GetInt( p_vout, "wall-cols" );
p_vout->p_sys->i_row = config_GetInt( p_vout, "wall-rows" );
}
/*****************************************************************************
- * vout_Init: initialize Wall video thread output method
+ * Init: initialize Wall video thread output method
*****************************************************************************/
-static int vout_Init( vout_thread_t *p_vout )
+static int Init( vout_thread_t *p_vout )
{
int i_index, i_row, i_col, i_width, i_height;
picture_t *p_pic;
}
/*****************************************************************************
- * vout_End: terminate Wall video thread output method
+ * End: terminate Wall video thread output method
*****************************************************************************/
-static void vout_End( vout_thread_t *p_vout )
+static void End( vout_thread_t *p_vout )
{
int i_index;
}
/*****************************************************************************
- * vout_Destroy: destroy Wall video thread output method
+ * Destroy: destroy Wall video thread output method
*****************************************************************************
* Terminate an output method created by WallCreateOutputMethod
*****************************************************************************/
-static void vout_Destroy( vout_thread_t *p_vout )
+static void Destroy( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+
RemoveAllVout( p_vout );
free( p_vout->p_sys->pp_vout );
}
/*****************************************************************************
- * vout_Manage: handle Wall events
- *****************************************************************************
- * This function should be called regularly by video output thread. It manages
- * console events. It returns a non null value on error.
- *****************************************************************************/
-static int vout_Manage( vout_thread_t *p_vout )
-{
- return( 0 );
-}
-
-/*****************************************************************************
- * vout_Render: displays previously rendered output
+ * Render: displays previously rendered output
*****************************************************************************
* This function send the currently rendered image to Wall image, waits
* until it is displayed and switch the two rendering buffers, preparing next
* frame.
*****************************************************************************/
-static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
+static void Render( vout_thread_t *p_vout, picture_t *p_pic )
{
picture_t *p_outpic = NULL;
int i_col, i_row, i_vout, i_plane;
}
}
-/*****************************************************************************
- * vout_Display: displays previously rendered output
- *****************************************************************************
- * This function send the currently rendered image to Invert image, waits
- * until it is displayed and switch the two rendering buffers, preparing next
- * frame.
- *****************************************************************************/
-static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
-{
- ;
-}
-
/*****************************************************************************
* RemoveAllVout: destroy all the child video output threads
*****************************************************************************/