static void End ( vout_thread_t * );
static void Render ( vout_thread_t *, picture_t * );
+static int MouseEvent( vlc_object_t *p_this, char const *psz_var,
+ vlc_value_t oldval, vlc_value_t newval, void *p_data );
+
static void RenderDiscard( vout_thread_t *, picture_t *, picture_t *, int );
static void RenderBob ( vout_thread_t *, picture_t *, picture_t *, int );
static void RenderMean ( vout_thread_t *, picture_t *, picture_t * );
static void End3DNow ( void );
#endif
-static int SendEvents ( vlc_object_t *, char const *,
- vlc_value_t, vlc_value_t, void * );
-
static void SetFilterMethod( vout_thread_t *p_vout, char *psz_method );
static vout_thread_t *SpawnRealVout( vout_thread_t *p_vout );
add_string( "deinterlace-mode", "discard", NULL, MODE_TEXT,
MODE_LONGTEXT, false )
change_string_list( mode_list, mode_list_text, 0 )
+ change_safe ()
add_shortcut( "deinterlace" )
set_callbacks( Create, Destroy )
add_string( FILTER_CFG_PREFIX "mode", "blend", NULL, SOUT_MODE_TEXT,
SOUT_MODE_LONGTEXT, false )
change_string_list( mode_list, mode_list_text, 0 )
+ add_shortcut( "deinterlace" )
set_callbacks( OpenFilter, CloseFilter )
vlc_module_end ()
*****************************************************************************/
static int Init( vout_thread_t *p_vout )
{
- int i_index;
- picture_t *p_pic;
-
I_OUTPUTPICTURES = 0;
if( !IsChromaSupported( p_vout->render.i_chroma ) )
var_AddCallback( p_vout, "deinterlace-mode", FilterCallback, NULL );
- ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES );
-
- ADD_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
+ vout_filter_AllocateDirectBuffers( p_vout, VOUT_MAX_PICTURES );
- ADD_PARENT_CALLBACKS( SendEventsToChild );
+ vout_filter_AddChild( p_vout, p_vout->p_sys->p_vout, MouseEvent );
return VLC_SUCCESS;
}
*****************************************************************************/
static void End( vout_thread_t *p_vout )
{
- int i_index;
-
- DEL_PARENT_CALLBACKS( SendEventsToChild );
-
- if( p_vout->p_sys->p_vout )
- DEL_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
+ vout_sys_t *p_sys = p_vout->p_sys;
- /* Free the fake output buffers we allocated */
- for( i_index = I_OUTPUTPICTURES ; i_index ; )
+ if( p_sys->p_vout )
{
- i_index--;
- free( PP_OUTPUTPICTURE[ i_index ]->p_data_orig );
+ vout_filter_DelChild( p_vout, p_sys->p_vout, MouseEvent );
+ vout_CloseAndRelease( p_sys->p_vout );
}
- if( p_vout->p_sys->p_vout )
- vout_CloseAndRelease( p_vout->p_sys->p_vout );
+ vout_filter_ReleaseDirectBuffers( p_vout );
}
/*****************************************************************************
free( p_vout->p_sys );
}
+/**
+ * Forward mouse event with proper conversion.
+ */
+static int MouseEvent( 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 = p_data;
+ VLC_UNUSED(p_this); VLC_UNUSED(oldval);
+
+ if( !strcmp( psz_var, "mouse-y" ) && p_vout->p_sys->b_half_height )
+ newval.i_int *= 2;
+
+ return var_Set( p_vout, psz_var, newval );
+}
+
/*****************************************************************************
* Render: displays previously rendered output
*****************************************************************************
#endif
}
-/*****************************************************************************
- * SendEvents: forward mouse and keyboard events to the parent p_vout
- *****************************************************************************/
-static int SendEvents( vlc_object_t *p_this, char const *psz_var,
- vlc_value_t oldval, vlc_value_t newval, void *_p_vout )
-{
- VLC_UNUSED(p_this); VLC_UNUSED(oldval);
- vout_thread_t *p_vout = (vout_thread_t *)_p_vout;
- vlc_value_t sentval = newval;
-
- if( !strcmp( psz_var, "mouse-y" ) && p_vout->p_sys->b_half_height )
- sentval.i_int *= 2;
-
- var_Set( p_vout, psz_var, sentval );
-
- return VLC_SUCCESS;
-}
-
/*****************************************************************************
* FilterCallback: called when changing the deinterlace method on the fly.
*****************************************************************************/
/* We need to kill the old vout */
if( p_vout->p_sys->p_vout )
{
- DEL_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
+ vout_filter_DelChild( p_vout, p_vout->p_sys->p_vout, MouseEvent );
vout_CloseAndRelease( p_vout->p_sys->p_vout );
}
return VLC_EGENERIC;
}
- ADD_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
+ vout_filter_AddChild( p_vout, p_vout->p_sys->p_vout, MouseEvent );
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 )
-{
- VLC_UNUSED(p_data); VLC_UNUSED(oldval);
- vout_thread_t *p_vout = (vout_thread_t *)p_this;
- var_Set( p_vout->p_sys->p_vout, psz_var, newval );
- return VLC_SUCCESS;
-}
-
-
/*****************************************************************************
* video filter2 functions
*****************************************************************************/