- /* Video Filter2 stuff */
- if( p_vout->b_vfilter_change == VLC_TRUE )
- {
- int i;
- RemoveVideoFilters2( p_vout );
- for( i = 0; i < p_vout->i_vfilters_cfg; i++ )
- {
- filter_t *p_vfilter =
- p_vout->pp_vfilters[p_vout->i_vfilters] =
- vlc_object_create( p_vout, VLC_OBJECT_FILTER );
-
- vlc_object_attach( p_vfilter, p_vout );
-
- p_vfilter->pf_vout_buffer_new = video_new_buffer_filter;
- p_vfilter->pf_vout_buffer_del = video_del_buffer_filter;
-
- if( !p_vout->i_vfilters )
- {
- p_vfilter->fmt_in.video = p_vout->fmt_render;
- }
- else
- {
- p_vfilter->fmt_in.video = (p_vfilter-1)->fmt_out.video;
- }
- /* TODO: one day filters in the middle of the chain might
- * have a different fmt_out.video than fmt_render ... */
- p_vfilter->fmt_out.video = p_vout->fmt_render;
-
- p_vfilter->p_cfg = p_vout->p_vfilters_cfg[i];
- p_vfilter->p_module = module_Need( p_vfilter, "video filter2",
- p_vout->psz_vfilters[i], 0 );
-
- if( p_vfilter->p_module )
- {
- p_vfilter->p_owner =
- malloc( sizeof( filter_owner_sys_t ) );
- p_vfilter->p_owner->p_vout = p_vout;
- p_vout->i_vfilters++;
- msg_Dbg( p_vout, "video filter found (%s)",
- p_vout->psz_vfilters[i] );
- }
- else
- {
- msg_Err( p_vout, "no video filter found (%s)",
- p_vout->psz_vfilters[i] );
- vlc_object_detach( p_vfilter );
- vlc_object_destroy( p_vfilter );
- }
- }
- p_vout->b_vfilter_change = VLC_FALSE;
- }
-