- vlc_value_t val, text;
-
- if( !p_vout->p->b_first_vout )
- return;
-
- msg_Dbg( p_vout, "Deinterlacing available" );
-
- /* Create the configuration variables */
- /* */
- var_Create( p_vout, "deinterlace", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT | VLC_VAR_HASCHOICE );
- int i_deinterlace = var_GetInteger( p_vout, "deinterlace" );
-
- text.psz_string = _("Deinterlace");
- var_Change( p_vout, "deinterlace", VLC_VAR_SETTEXT, &text, NULL );
-
- const module_config_t *p_optd = config_FindConfig( VLC_OBJECT(p_vout), "deinterlace" );
- var_Change( p_vout, "deinterlace", VLC_VAR_CLEARCHOICES, NULL, NULL );
- for( int i = 0; p_optd && i < p_optd->i_list; i++ )
- {
- val.i_int = p_optd->pi_list[i];
- text.psz_string = (char*)vlc_gettext(p_optd->ppsz_list_text[i]);
- var_Change( p_vout, "deinterlace", VLC_VAR_ADDCHOICE, &val, &text );
- }
- var_AddCallback( p_vout, "deinterlace", DeinterlaceCallback, NULL );
- /* */
- var_Create( p_vout, "deinterlace-mode", VLC_VAR_STRING | VLC_VAR_DOINHERIT | VLC_VAR_HASCHOICE );
- char *psz_deinterlace = var_GetNonEmptyString( p_vout, "deinterlace-mode" );
-
- text.psz_string = _("Deinterlace mode");
- var_Change( p_vout, "deinterlace-mode", VLC_VAR_SETTEXT, &text, NULL );
-
- const module_config_t *p_optm = config_FindConfig( VLC_OBJECT(p_vout), "deinterlace-mode" );
- var_Change( p_vout, "deinterlace-mode", VLC_VAR_CLEARCHOICES, NULL, NULL );
- for( int i = 0; p_optm && i < p_optm->i_list; i++ )
- {
- if( !DeinterlaceGetMode( p_optm->ppsz_list[i] ) )
- continue;
-
- val.psz_string = p_optm->ppsz_list[i];
- text.psz_string = (char*)vlc_gettext(p_optm->ppsz_list_text[i]);
- var_Change( p_vout, "deinterlace-mode", VLC_VAR_ADDCHOICE, &val, &text );
- }
- var_AddCallback( p_vout, "deinterlace-mode", DeinterlaceCallback, NULL );
- /* */
- var_Create( p_vout, "deinterlace-needed", VLC_VAR_BOOL );
- var_AddCallback( p_vout, "deinterlace-needed", DeinterlaceCallback, NULL );
-
- /* Override the initial value from filters if present */
- char *psz_filter_mode = NULL;
- if( DeinterlaceIsPresent( p_vout, true ) )
- psz_filter_mode = var_CreateGetNonEmptyString( p_vout, "filter-deinterlace-mode" );
- else if( DeinterlaceIsPresent( p_vout, false ) )
- psz_filter_mode = var_CreateGetNonEmptyString( p_vout, "sout-deinterlace-mode" );
- if( psz_filter_mode )
- {
- free( psz_deinterlace );
- if( i_deinterlace >= -1 )
- i_deinterlace = 1;
- psz_deinterlace = psz_filter_mode;
- }
-
- /* */
- if( i_deinterlace == -2 )
- p_vout->p->displayed.is_interlaced = true;
- else if( i_deinterlace == -3 )
- p_vout->p->displayed.is_interlaced = false;
- if( i_deinterlace < 0 )
- i_deinterlace = -1;