Changeset 6d937c8f88c36262433d5060a82f9cd3d5c69786
- Timestamp:
- 24/07/08 19:58:05
(4 months ago)
- Author:
- Laurent Aimar <fenrir@videolan.org>
- git-committer:
- Laurent Aimar <fenrir@videolan.org> 1216922285 +0200
- git-parent:
[8e34f1cd2658337329befe2ed73ceaec2f6612e5]
- git-author:
- Laurent Aimar <fenrir@videolan.org> 1216922285 +0200
- Message:
Fixed completely broken video filter 2 chain in vout. Now they have a
chance to get a frame when they ask (close #1738).
Decoders and filters share the same pool of video frames. But the
decoders try to decode as fast as possible, using all buffers. Then it
s pure luck if the filter can grab a frame...
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| ra4270c7 |
r6d937c8 |
|
| 661 | 661 | VLC_EXPORT( void, vout_UnlinkPicture, ( vout_thread_t *, picture_t * ) ); |
|---|
| 662 | 662 | VLC_EXPORT( void, vout_PlacePicture, ( vout_thread_t *, unsigned int, unsigned int, unsigned int *, unsigned int *, unsigned int *, unsigned int * ) ); |
|---|
| | 663 | |
|---|
| | 664 | /* DO NOT use vout_RenderPicture unless you are in src/video_ouput */ |
|---|
| 663 | 665 | picture_t * vout_RenderPicture ( vout_thread_t *, picture_t *, |
|---|
| 664 | 666 | subpicture_t * ); |
|---|
| | 667 | |
|---|
| | 668 | /* DO NOT use vout_CountPictureAvailable unless your are in src/input/dec.c (no exception) */ |
|---|
| | 669 | int vout_CountPictureAvailable( vout_thread_t * ); |
|---|
| 665 | 670 | |
|---|
| 666 | 671 | VLC_EXPORT( int, vout_vaControlDefault, ( vout_thread_t *, int, va_list ) ); |
|---|
| r8834505 |
r6d937c8 |
|
| 1236 | 1236 | } |
|---|
| 1237 | 1237 | |
|---|
| | 1238 | |
|---|
| | 1239 | int vout_CountPictureAvailable( vout_thread_t *p_vout ); |
|---|
| | 1240 | |
|---|
| 1238 | 1241 | static picture_t *vout_new_buffer( decoder_t *p_dec ) |
|---|
| 1239 | 1242 | { |
|---|
| … | … | |
| 1318 | 1321 | } |
|---|
| 1319 | 1322 | |
|---|
| 1320 | | /* Get a new picture */ |
|---|
| 1321 | | while( !(p_pic = vout_CreatePicture( p_sys->p_vout, 0, 0, 0 ) ) ) |
|---|
| | 1323 | /* Get a new picture |
|---|
| | 1324 | */ |
|---|
| | 1325 | for( p_pic = NULL; ; ) |
|---|
| 1322 | 1326 | { |
|---|
| 1323 | 1327 | int i_pic, i_ready_pic = 0; |
|---|
| 1324 | 1328 | |
|---|
| 1325 | 1329 | if( p_dec->b_die || p_dec->b_error ) |
|---|
| 1326 | | { |
|---|
| 1327 | 1330 | return NULL; |
|---|
| | 1331 | |
|---|
| | 1332 | /* The video filter chain required that there is always 1 free buffer |
|---|
| | 1333 | * that it will use as temporary one. It will release the temporary |
|---|
| | 1334 | * buffer once its work is done, so this check is safe even if we don't |
|---|
| | 1335 | * lock around both count() and create(). |
|---|
| | 1336 | */ |
|---|
| | 1337 | if( vout_CountPictureAvailable( p_sys->p_vout ) >= 2 ) |
|---|
| | 1338 | { |
|---|
| | 1339 | p_pic = vout_CreatePicture( p_sys->p_vout, 0, 0, 0 ); |
|---|
| | 1340 | if( p_pic ) |
|---|
| | 1341 | break; |
|---|
| 1328 | 1342 | } |
|---|
| 1329 | 1343 | |
|---|
| rb364425 |
r6d937c8 |
|
| 354 | 354 | { |
|---|
| 355 | 355 | vout_thread_t *p_vout = (vout_thread_t*)p_chain->p_this; |
|---|
| 356 | | |
|---|
| 357 | 356 | vlc_mutex_lock( &p_vout->picture_lock ); |
|---|
| 358 | 357 | if( p_pic->i_refcount ) |
|---|
| ra4270c7 |
r6d937c8 |
|
| 107 | 107 | * threads. |
|---|
| 108 | 108 | */ |
|---|
| | 109 | int vout_CountPictureAvailable( vout_thread_t *p_vout ) |
|---|
| | 110 | { |
|---|
| | 111 | int i_free = 0; |
|---|
| | 112 | int i_pic; |
|---|
| | 113 | |
|---|
| | 114 | vlc_mutex_lock( &p_vout->picture_lock ); |
|---|
| | 115 | for( i_pic = 0; i_pic < I_RENDERPICTURES; i_pic++ ) |
|---|
| | 116 | { |
|---|
| | 117 | picture_t *p_pic = PP_RENDERPICTURE[(p_vout->render.i_last_used_pic + i_pic + 1) % I_RENDERPICTURES]; |
|---|
| | 118 | |
|---|
| | 119 | switch( p_pic->i_status ) |
|---|
| | 120 | { |
|---|
| | 121 | case DESTROYED_PICTURE: |
|---|
| | 122 | i_free++; |
|---|
| | 123 | break; |
|---|
| | 124 | |
|---|
| | 125 | case FREE_PICTURE: |
|---|
| | 126 | i_free++; |
|---|
| | 127 | break; |
|---|
| | 128 | |
|---|
| | 129 | default: |
|---|
| | 130 | break; |
|---|
| | 131 | } |
|---|
| | 132 | } |
|---|
| | 133 | vlc_mutex_unlock( &p_vout->picture_lock ); |
|---|
| | 134 | |
|---|
| | 135 | return i_free; |
|---|
| | 136 | } |
|---|
| | 137 | |
|---|
| 109 | 138 | picture_t *vout_CreatePicture( vout_thread_t *p_vout, |
|---|
| 110 | 139 | bool b_progressive, |
|---|