[vlc-devel] [PATCH] Add deinterlacing to libvlc, moz-plugin and activeX

Laurent Aimar fenrir at via.ecp.fr
Thu May 28 11:27:24 CEST 2009


Hi,

On Wed, May 27, 2009, Cyril MATHE wrote:
> Three patches which add deinterlacing in libvlc
> +void libvlc_video_enable_deinterlace(libvlc_media_player_t *p_mi,
> +                            libvlc_exception_t *p_e, int b_enable, char *psz_option)
> +{
> +    const char *psz_filter_type = "video-filter";
> +    const char *psz_string = "deinterlace";
> +    vlc_value_t val;
> +
> +    vout_thread_t *p_vout = GetVout( p_mi, p_e );
> +
> +    if( p_vout )
> +    {
> +        if( b_enable == 1 )
> +        {
> +            /* be sure that the filter name given is supported */
> +            if( ( !strcmp(psz_option, "blend") ) || ( !strcmp(psz_option, "x") ) )
> +            {
> +                val.psz_string = psz_option;
> +                /* set deinterlace filter chosen */
> +                var_Set( p_vout, "sout-deinterlace-mode", val);
> +                /* enable deinterlace */
> +                var_SetString(p_vout, psz_filter_type, psz_string);
> +            }
> +            else
> +            {
> +                libvlc_exception_raise( p_e, "Unsuported or bad deinterlace filter name" );
> +            }
> +        }
> +        else
> +        {
> +            /* disable deinterlace filter */
> +            var_SetString(p_vout, psz_filter_type, "");
> +        }
> +    }
> +    else
> +    {
> +        libvlc_exception_raise( p_e, "Unable to get video output" );
> +    }
> +
> +    vlc_object_release( p_vout );
> +}

 You should not modify "video-filter"/"vout-filter" directly for deinterlacing.
Doing so is
 - complicated because some deinterlacing mode does not work with
 "video-filter" as you noticed.
 - you simply broke the selection of current filter to replace it with none or
 deinterlacing (not what the function name says...).

 In 1.1 (and for 1.0 I think), you can simply set "deinterlace" with the
mode you want on the vout object and everything should be taken care of.
(like var_SetString( p_vout, "deinterlace", psz_mode ))

-- 
fenrir



More information about the vlc-devel mailing list