Changeset 1309f14889aed40073e79942e4919a21649ac474

Show
Ignore:
Timestamp:
31/03/07 21:53:23 (2 years ago)
Author:
Antoine Cellerier <dionoea@videolan.org>
git-committer:
Antoine Cellerier <dionoea@videolan.org> 1175370803 +0000
git-parent:

[71a183b9a7c6d0ed146a3f804a0dd1cf2d377134]

git-author:
Antoine Cellerier <dionoea@videolan.org> 1175370803 +0000
Message:

Make it possible to change the extracted color once the module is launched.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/video_filter/extract.c

    r55c10e2 r1309f14  
    4040 
    4141static picture_t *Filter( filter_t *, picture_t * ); 
     42static int ExtractCallback( vlc_object_t *, char const *, 
     43                            vlc_value_t, vlc_value_t, void * ); 
    4244 
    4345static void get_red_from_yuv420( picture_t *, picture_t *, int, int, int ); 
     
    113115                       p_filter->p_cfg ); 
    114116 
    115     var_Create( p_filter, FILTER_PREFIX "component", 
    116                 VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); 
    117     p_filter->p_sys->i_color = var_GetInteger( p_filter, 
     117    p_filter->p_sys->i_color = var_CreateGetIntegerCommand( p_filter, 
    118118                                               FILTER_PREFIX "component" ); 
     119    var_AddCallback( p_filter, FILTER_PREFIX "component", 
     120                     ExtractCallback, p_filter->p_sys ); 
    119121    switch( p_filter->p_sys->i_color ) 
    120122    { 
     
    686688    } 
    687689} 
     690 
     691static int ExtractCallback( vlc_object_t *p_this, char const *psz_var, 
     692                            vlc_value_t oldval, vlc_value_t newval, 
     693                            void *p_data ) 
     694{ 
     695    filter_sys_t *p_sys = (filter_sys_t *)p_data; 
     696 
     697    if( !strcmp( psz_var, FILTER_PREFIX "component" ) ) 
     698    { 
     699        p_sys->i_color = newval.i_int; 
     700        switch( p_sys->i_color ) 
     701        { 
     702            case RED: 
     703            case GREEN: 
     704            case BLUE: 
     705                break; 
     706            default: 
     707                make_projection_matrix( p_sys->i_color, 
     708                                        p_sys->projection_matrix ); 
     709                break; 
     710        } 
     711    } 
     712    else 
     713    { 
     714        msg_Warn( p_this, "Unknown callback command." ); 
     715    } 
     716    return VLC_SUCCESS; 
     717}