- p_sys->i_selected = -1;
- }
-}
-
-/*****************************************************************************
- * Create: allocates Magnify video thread output method
- *****************************************************************************/
-static int Create( vlc_object_t *p_this )
-{
- vout_thread_t *p_vout = (vout_thread_t *)p_this;
-
- /* Allocate structure */
- p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
- if( p_vout->p_sys == NULL )
- return VLC_ENOMEM;
-
- p_vout->p_sys->p_image = image_HandlerCreate( p_vout );
-
- config_ChainParse( p_vout, CFG_PREFIX, ppsz_filter_options,
- p_vout->p_cfg );
-
- p_vout->p_sys->i_rows =
- var_CreateGetIntegerCommand( p_vout, CFG_PREFIX "rows" );
- p_vout->p_sys->i_cols =
- var_CreateGetIntegerCommand( p_vout, CFG_PREFIX "cols" );
- p_vout->p_sys->b_blackslot =
- var_CreateGetBoolCommand( p_vout, CFG_PREFIX "black-slot" );
- var_AddCallback( p_vout, CFG_PREFIX "rows",
- PuzzleCallback, p_vout->p_sys );
- var_AddCallback( p_vout, CFG_PREFIX "cols",
- PuzzleCallback, p_vout->p_sys );
- var_AddCallback( p_vout, CFG_PREFIX "black-slot",
- PuzzleCallback, p_vout->p_sys );
-
- p_vout->p_sys->pi_order = NULL;
- shuffle( p_vout->p_sys );
-
- 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;
- p_vout->pf_control = Control;
-
- return VLC_SUCCESS;
-}
-
-/*****************************************************************************
- * Init: initialize Magnify video thread output method
- *****************************************************************************/
-static int Init( vout_thread_t *p_vout )
-{
- video_format_t fmt;
- memset( &fmt, 0, sizeof( video_format_t ) );
-
- I_OUTPUTPICTURES = 0;
-
- /* Initialize the output structure */
- p_vout->output.i_chroma = p_vout->render.i_chroma;
- p_vout->output.i_width = p_vout->render.i_width;
- p_vout->output.i_height = p_vout->render.i_height;
- p_vout->output.i_aspect = p_vout->render.i_aspect;
-
- p_vout->fmt_out = p_vout->fmt_in;
- fmt = p_vout->fmt_out;
-
- /* Try to open the real video output */
- msg_Dbg( p_vout, "spawning the real video output" );
-
- p_vout->p_sys->p_vout = vout_Create( p_vout, &fmt );
-
- /* Everything failed */
- if( p_vout->p_sys->p_vout == NULL )
- {
- msg_Err( p_vout, "cannot open vout, aborting" );
- return VLC_EGENERIC;
- }
-
- vout_filter_AllocateDirectBuffers( p_vout, VOUT_MAX_PICTURES );
-
- vout_filter_AddChild( p_vout, p_vout->p_sys->p_vout, MouseEvent );
-
- return VLC_SUCCESS;
-}
-
-/*****************************************************************************
- * End: terminate Magnify video thread output method
- *****************************************************************************/
-static void End( vout_thread_t *p_vout )
-{
- vout_sys_t *p_sys = p_vout->p_sys;
-
- vout_filter_DelChild( p_vout, p_sys->p_vout, MouseEvent );
- vout_CloseAndRelease( p_sys->p_vout );
-
- vout_filter_ReleaseDirectBuffers( p_vout );
-}