Changeset 1b431f4bcfc2199984d68b8b100dcaa73524098c
- 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
| rcef7a5d |
r1b431f4 |
|
| 70 | 70 | static int Activate( vlc_object_t *p_this ) |
|---|
| 71 | 71 | { |
|---|
| 72 | | static int hack = 0; |
|---|
| | 72 | static int hack = 1; |
|---|
| 73 | 73 | vout_thread_t *p_vout = (vout_thread_t *)p_this; |
|---|
| 74 | 74 | |
|---|
| 75 | | if( hack ) |
|---|
| | 75 | hack++; |
|---|
| | 76 | if( hack > MAX_CHROMAS ) |
|---|
| 76 | 77 | { |
|---|
| 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 ); |
|---|
| 78 | 81 | return VLC_EGENERIC; |
|---|
| 79 | 82 | } |
|---|
| 80 | | |
|---|
| 81 | | hack = 1; |
|---|
| 82 | 83 | |
|---|
| 83 | 84 | chroma_sys_t *p_sys = (chroma_sys_t *)malloc( sizeof( chroma_sys_t ) ); |
|---|
| 84 | 85 | if( !p_sys ) |
|---|
| 85 | 86 | { |
|---|
| 86 | | hack = 0; |
|---|
| | 87 | hack--; |
|---|
| 87 | 88 | return VLC_ENOMEM; |
|---|
| 88 | 89 | } |
|---|
| … | … | |
| 124 | 125 | p_vout->chroma.pf_convert = Chain; |
|---|
| 125 | 126 | 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 ); |
|---|
| 127 | 129 | return VLC_SUCCESS; |
|---|
| 128 | 130 | } |
|---|
| 129 | 131 | |
|---|
| 130 | 132 | free( p_sys ); |
|---|
| 131 | | hack = 0; |
|---|
| | 133 | hack--; |
|---|
| 132 | 134 | return VLC_EGENERIC; |
|---|
| 133 | 135 | } |
|---|
| … | … | |
| 151 | 153 | } |
|---|
| 152 | 154 | free( chroma.p_sys ); |
|---|
| | 155 | chroma.p_sys = NULL; |
|---|
| 153 | 156 | } |
|---|
| 154 | 157 | |
|---|
| … | … | |
| 177 | 180 | } |
|---|
| 178 | 181 | |
|---|
| | 182 | vout_chroma_t chroma = p_vout->chroma; |
|---|
| | 183 | p_vout->chroma = p_sys->chroma1; |
|---|
| 179 | 184 | p_sys->chroma1.pf_convert( p_vout, p_source, p_sys->p_tmp ); |
|---|
| | 185 | p_vout->chroma = p_sys->chroma2; |
|---|
| 180 | 186 | p_sys->chroma2.pf_convert( p_vout, p_sys->p_tmp, p_dest ); |
|---|
| | 187 | p_vout->chroma = chroma; |
|---|
| 181 | 188 | } |
|---|