Changeset 1b431f4bcfc2199984d68b8b100dcaa73524098c

Show
Ignore:
Timestamp:
10/01/08 22:20:16 (9 months ago)
Author:
Antoine Cellerier <dionoea@videolan.org>
git-committer:
Antoine Cellerier <dionoea@videolan.org> 1200000016 +0000
git-parent:

[793a81a922a7cb8443b803f98b30ca494ff2a304]

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

Change the chain module so it allows chaining more than 2 chroma modules (you'll have to change the define at the start of the source code, and there's no guarantee that it'll use the shortest path between the source and dest chromas).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/video_chroma/chain.c

    rcef7a5d r1b431f4  
    7070static int Activate( vlc_object_t *p_this ) 
    7171{ 
    72     static int hack = 0
     72    static int hack = 1
    7373    vout_thread_t *p_vout = (vout_thread_t *)p_this; 
    7474 
    75     if( hack ) 
     75    hack++; 
     76    if( hack > MAX_CHROMAS ) 
    7677    { 
    77         msg_Err( p_this, "Preventing chain chroma reccursion" ); 
     78        hack--; 
     79        msg_Err( p_this, "Preventing chain chroma reccursion (already %d long)", 
     80                 hack ); 
    7881        return VLC_EGENERIC; 
    7982    } 
    80  
    81     hack = 1; 
    8283 
    8384    chroma_sys_t *p_sys = (chroma_sys_t *)malloc( sizeof( chroma_sys_t ) ); 
    8485    if( !p_sys ) 
    8586    { 
    86         hack = 0
     87        hack--
    8788        return VLC_ENOMEM; 
    8889    } 
     
    124125        p_vout->chroma.pf_convert = Chain; 
    125126        p_vout->chroma.p_sys = p_sys; 
    126         hack = 0; 
     127        hack--; 
     128        printf("Init: p_sys->p_tmp= %p\n", p_sys->p_tmp ); 
    127129        return VLC_SUCCESS; 
    128130    } 
    129131 
    130132    free( p_sys ); 
    131     hack = 0
     133    hack--
    132134    return VLC_EGENERIC; 
    133135} 
     
    151153    } 
    152154    free( chroma.p_sys ); 
     155    chroma.p_sys = NULL; 
    153156} 
    154157 
     
    177180    } 
    178181 
     182    vout_chroma_t chroma = p_vout->chroma; 
     183    p_vout->chroma = p_sys->chroma1; 
    179184    p_sys->chroma1.pf_convert( p_vout, p_source, p_sys->p_tmp ); 
     185    p_vout->chroma = p_sys->chroma2; 
    180186    p_sys->chroma2.pf_convert( p_vout, p_sys->p_tmp, p_dest ); 
     187    p_vout->chroma = chroma; 
    181188}