Changeset de81c25db345fcad4ac8106f52845dc2fd11cf50
- Timestamp:
- 25/02/04 18:48:52
(5 years ago)
- Author:
- Laurent Aimar <fenrir@videolan.org>
- git-committer:
- Laurent Aimar <fenrir@videolan.org> 1077731332 +0000
- git-parent:
[e7523028f53b0af5d9654e21fa3bdff7adb411bb]
- git-author:
- Laurent Aimar <fenrir@videolan.org> 1077731332 +0000
- Message:
- all: removed block_t->b_discontinuity,b_frame_* and added i_flags
field and a few BLOCK_FLAG_*.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r26e930b |
rde81c25 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2003 VideoLAN |
|---|
| 5 | | * $Id: vlc_block.h,v 1.5 2003/12/24 09:46:08 gbazin Exp $ |
|---|
| | 5 | * $Id: vlc_block.h,v 1.6 2004/02/25 17:48:52 fenrir Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Laurent Aimar <fenrir@via.ecp.fr> |
|---|
| … | … | |
| 30 | 30 | typedef struct block_sys_t block_sys_t; |
|---|
| 31 | 31 | |
|---|
| | 32 | /* BLOCK_FLAG_DISCONTINUITY: the content doesn't follow the last block, or is probably broken */ |
|---|
| | 33 | #define BLOCK_FLAG_DISCONTINUITY 0x0001 |
|---|
| | 34 | /* BLOCK_FLAG_TYPE_I: Intra frame */ |
|---|
| | 35 | #define BLOCK_FLAG_TYPE_I 0x0002 |
|---|
| | 36 | /* BLOCK_FLAG_TYPE_P: inter frame with backward reference only */ |
|---|
| | 37 | #define BLOCK_FLAG_TYPE_P 0x0004 |
|---|
| | 38 | /* BLOCK_FLAG_TYPE_B: inter frame with backward and forward reference */ |
|---|
| | 39 | #define BLOCK_FLAG_TYPE_B 0x0008 |
|---|
| | 40 | /* BLOCK_FLAG_TYPE_PB: for inter frame when you don't know the real type */ |
|---|
| | 41 | #define BLOCK_FLAG_TYPE_PB 0x0010 |
|---|
| | 42 | |
|---|
| 32 | 43 | struct block_t |
|---|
| 33 | 44 | { |
|---|
| 34 | 45 | block_t *p_next; |
|---|
| 35 | 46 | |
|---|
| 36 | | vlc_bool_t b_frame_display; |
|---|
| 37 | | vlc_bool_t b_frame_start; |
|---|
| | 47 | uint32_t i_flags; |
|---|
| | 48 | |
|---|
| 38 | 49 | mtime_t i_pts; |
|---|
| 39 | 50 | mtime_t i_dts; |
|---|
| 40 | 51 | mtime_t i_length; |
|---|
| 41 | 52 | |
|---|
| 42 | | vlc_bool_t b_discontinuity; /* only temporary */ |
|---|
| 43 | 53 | int i_rate; |
|---|
| 44 | 54 | |
|---|
| … | … | |
| 109 | 119 | VLC_EXPORT( int, block_FifoPut, ( block_fifo_t *, block_t * ) ); |
|---|
| 110 | 120 | VLC_EXPORT( block_t *, block_FifoGet, ( block_fifo_t * ) ); |
|---|
| 111 | | VLC_EXPORT( block_t *, block_FifoGetFrame, ( block_fifo_t * ) ); |
|---|
| 112 | 121 | VLC_EXPORT( block_t *, block_FifoShow, ( block_fifo_t * ) ); |
|---|
| 113 | 122 | |
|---|
| r7bf9ebc |
rde81c25 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2001-2002 VideoLAN |
|---|
| 5 | | * $Id: a52.c,v 1.33 2004/02/13 21:48:32 gbazin Exp $ |
|---|
| | 5 | * $Id: a52.c,v 1.34 2004/02/25 17:48:52 fenrir Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: St�ane Borel <stef@via.ecp.fr> |
|---|
| … | … | |
| 172 | 172 | } |
|---|
| 173 | 173 | |
|---|
| 174 | | if( (*pp_block)->b_discontinuity ) |
|---|
| | 174 | if( (*pp_block)->i_flags&BLOCK_FLAG_DISCONTINUITY ) |
|---|
| 175 | 175 | { |
|---|
| 176 | 176 | p_sys->i_state = STATE_NOSYNC; |
|---|
| r1916bc5 |
rde81c25 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2003 VideoLAN |
|---|
| 5 | | * $Id: dts.c,v 1.17 2004/02/07 00:56:44 gbazin Exp $ |
|---|
| | 5 | * $Id: dts.c,v 1.18 2004/02/25 17:48:52 fenrir Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Jon Lech Johansen <jon-vl@nanocrew.net> |
|---|
| … | … | |
| 173 | 173 | } |
|---|
| 174 | 174 | |
|---|
| 175 | | if( (*pp_block)->b_discontinuity ) |
|---|
| | 175 | if( (*pp_block)->i_flags&BLOCK_FLAG_DISCONTINUITY ) |
|---|
| 176 | 176 | { |
|---|
| 177 | 177 | p_sys->i_state = STATE_NOSYNC; |
|---|
| rd46292c |
rde81c25 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2001, 2003 VideoLAN |
|---|
| 5 | | * $Id: faad.c,v 1.13 2004/02/19 17:42:43 jpsaman Exp $ |
|---|
| | 5 | * $Id: faad.c,v 1.14 2004/02/25 17:48:52 fenrir Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Laurent Aimar <fenrir@via.ecp.fr> |
|---|
| … | … | |
| 177 | 177 | p_block = *pp_block; |
|---|
| 178 | 178 | |
|---|
| 179 | | if( p_block->b_discontinuity ) |
|---|
| | 179 | if( p_block->i_flags&BLOCK_FLAG_DISCONTINUITY ) |
|---|
| 180 | 180 | { |
|---|
| 181 | 181 | block_Release( p_block ); |
|---|
| rc299138 |
rde81c25 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 1999-2003 VideoLAN |
|---|
| 5 | | * $Id: audio.c,v 1.27 2003/11/27 12:32:03 fenrir Exp $ |
|---|
| | 5 | * $Id: audio.c,v 1.28 2004/02/25 17:48:52 fenrir Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Laurent Aimar <fenrir@via.ecp.fr> |
|---|
| … | … | |
| 158 | 158 | } |
|---|
| 159 | 159 | |
|---|
| 160 | | if( p_block->i_buffer <= 0 || p_block->b_discontinuity ) |
|---|
| | 160 | if( p_block->i_buffer <= 0 || |
|---|
| | 161 | ( p_block->i_flags&BLOCK_FLAG_DISCONTINUITY ) ) |
|---|
| 161 | 162 | { |
|---|
| 162 | 163 | block_Release( p_block ); |
|---|
| r310a320 |
rde81c25 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 1999-2001 VideoLAN |
|---|
| 5 | | * $Id: video.c,v 1.66 2004/02/08 22:37:37 gbazin Exp $ |
|---|
| | 5 | * $Id: video.c,v 1.67 2004/02/25 17:48:52 fenrir Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Laurent Aimar <fenrir@via.ecp.fr> |
|---|
| … | … | |
| 374 | 374 | p_block = *pp_block; |
|---|
| 375 | 375 | |
|---|
| 376 | | if( p_block->b_discontinuity ) |
|---|
| | 376 | if( p_block->i_flags&BLOCK_FLAG_DISCONTINUITY ) |
|---|
| 377 | 377 | { |
|---|
| 378 | 378 | p_sys->i_buffer = 0; |
|---|
| rf6fd063 |
rde81c25 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 1999-2001 VideoLAN |
|---|
| 5 | | * $Id: flac.c,v 1.8 2004/02/07 00:16:34 gbazin Exp $ |
|---|
| | 5 | * $Id: flac.c,v 1.9 2004/02/25 17:48:52 fenrir Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Gildas Bazin <gbazin@netcourrier.com> |
|---|
| … | … | |
| 259 | 259 | } |
|---|
| 260 | 260 | |
|---|
| 261 | | if( (*pp_block)->b_discontinuity ) |
|---|
| | 261 | if( (*pp_block)->i_flags&BLOCK_FLAG_DISCONTINUITY ) |
|---|
| 262 | 262 | { |
|---|
| 263 | 263 | p_sys->i_state = STATE_NOSYNC; |
|---|
| rc87130e |
rde81c25 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 1999-2001 VideoLAN |
|---|
| 5 | | * $Id: libmpeg2.c,v 1.42 2004/01/16 09:39:57 sam Exp $ |
|---|
| | 5 | * $Id: libmpeg2.c,v 1.43 2004/02/25 17:48:52 fenrir Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Gildas Bazin <gbazin@netcourrier.com> |
|---|
| … | … | |
| 30 | 30 | #include <vlc/decoder.h> |
|---|
| 31 | 31 | |
|---|
| | 32 | #define PIC_FLAG_PTS |
|---|
| 32 | 33 | #include <mpeg2dec/mpeg2.h> |
|---|
| 33 | 34 | |
|---|
| … | … | |
| 211 | 212 | } |
|---|
| 212 | 213 | |
|---|
| 213 | | if( p_block->b_discontinuity && p_sys->p_synchro && |
|---|
| | 214 | if( (p_block->i_flags&BLOCK_FLAG_DISCONTINUITY) && |
|---|
| | 215 | p_sys->p_synchro && |
|---|
| 214 | 216 | p_sys->p_info->sequence && |
|---|
| 215 | 217 | p_sys->p_info->sequence->width != (unsigned)-1 ) |
|---|
| rfea7f38 |
rde81c25 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2001-2003 VideoLAN |
|---|
| 5 | | * $Id: mpeg_audio.c,v 1.25 2004/01/25 18:20:12 bigben Exp $ |
|---|
| | 5 | * $Id: mpeg_audio.c,v 1.26 2004/02/25 17:48:52 fenrir Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Laurent Aimar <fenrir@via.ecp.fr> |
|---|
| … | … | |
| 190 | 190 | } |
|---|
| 191 | 191 | |
|---|
| 192 | | if( (*pp_block)->b_discontinuity ) |
|---|
| | 192 | if( (*pp_block)->i_flags&BLOCK_FLAG_DISCONTINUITY ) |
|---|
| 193 | 193 | { |
|---|
| 194 | 194 | p_sys->i_state = STATE_NOSYNC; |
|---|
| rff7206f |
rde81c25 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2001 VideoLAN |
|---|
| 5 | | * $Id: a52.c,v 1.5 2004/02/17 13:13:32 gbazin Exp $ |
|---|
| | 5 | * $Id: a52.c,v 1.6 2004/02/25 17:48:52 fenrir Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Gildas Bazin <gbazin@netcourrier.com> |
|---|
| … | … | |
| 294 | 294 | p_block_out->i_pts * 9 / 100 ); |
|---|
| 295 | 295 | |
|---|
| 296 | | p_block_in->b_discontinuity = 0; |
|---|
| 297 | 296 | p_block_out->i_dts = p_block_out->i_pts = |
|---|
| 298 | 297 | input_ClockGetTS( p_input, p_input->stream.p_selected_program, |
|---|
| r4b029f2 |
rde81c25 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2001 VideoLAN |
|---|
| 5 | | * $Id: dts.c,v 1.9 2004/02/24 19:23:11 gbazin Exp $ |
|---|
| | 5 | * $Id: dts.c,v 1.10 2004/02/25 17:48:52 fenrir Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Gildas Bazin <gbazin@netcourrier.com> |
|---|
| … | … | |
| 292 | 292 | p_block_out->i_pts * 9 / 100 ); |
|---|
| 293 | 293 | |
|---|
| 294 | | p_block_in->b_discontinuity = 0; |
|---|
| 295 | 294 | p_block_out->i_dts = p_block_out->i_pts = |
|---|
| 296 | 295 | input_ClockGetTS( p_input, p_input->stream.p_selected_program, |
|---|
| rffdca9a |
rde81c25 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2001-2003 VideoLAN |
|---|
| 5 | | * $Id: flac.c,v 1.10 2004/01/25 20:05:28 hartman Exp $ |
|---|
| | 5 | * $Id: flac.c,v 1.11 2004/02/25 17:48:52 fenrir Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Gildas Bazin <gbazin@netcourrier.com> |
|---|
| … | … | |
| 223 | 223 | p_block_out->i_pts * 9 / 100 ); |
|---|
| 224 | 224 | |
|---|
| 225 | | p_block_in->b_discontinuity = 0; |
|---|
| 226 | 225 | p_block_out->i_dts = p_block_out->i_pts = |
|---|
| 227 | 226 | input_ClockGetTS( p_input, p_input->stream.p_selected_program, |
|---|
| r25cd132 |
rde81c25 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2003-2004 VideoLAN |
|---|
| 5 | | * $Id: block.c,v 1.6 2004/01/06 12:02:06 zorglub Exp $ |
|---|
| | 5 | * $Id: block.c,v 1.7 2004/02/25 17:48:52 fenrir Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Laurent Aimar <fenrir@videolan.org> |
|---|
| … | … | |
| 71 | 71 | p_dup = block_New( p_block->p_manager, p_block->i_buffer ); |
|---|
| 72 | 72 | memcpy( p_dup->p_buffer, p_block->p_buffer, p_block->i_buffer ); |
|---|
| 73 | | p_dup->b_frame_display = p_block->b_frame_display; |
|---|
| 74 | | p_dup->b_frame_start = p_block->b_frame_start; |
|---|
| | 73 | p_dup->i_flags = p_block->i_flags; |
|---|
| 75 | 74 | p_dup->i_pts = p_block->i_pts; |
|---|
| 76 | 75 | p_dup->i_dts = p_block->i_dts; |
|---|
| 77 | | p_dup->b_discontinuity = p_block->b_discontinuity; |
|---|
| 78 | 76 | |
|---|
| 79 | 77 | return p_dup; |
|---|
| … | … | |
| 193 | 191 | |
|---|
| 194 | 192 | p_block->p_next = NULL; |
|---|
| 195 | | p_block->b_frame_display= VLC_TRUE; |
|---|
| 196 | | p_block->b_frame_start = VLC_FALSE; |
|---|
| | 193 | p_block->i_flags = 0; |
|---|
| 197 | 194 | p_block->i_pts = 0; |
|---|
| 198 | 195 | p_block->i_dts = 0; |
|---|
| 199 | 196 | p_block->i_length = 0; |
|---|
| 200 | | |
|---|
| 201 | | p_block->b_discontinuity= VLC_FALSE; |
|---|
| 202 | 197 | |
|---|
| 203 | 198 | p_block->i_buffer = 0; |
|---|
| … | … | |
| 321 | 316 | block_ChainExtract( p_list, g->p_buffer, g->i_buffer ); |
|---|
| 322 | 317 | |
|---|
| 323 | | g->b_frame_display = p_list->b_frame_display; |
|---|
| 324 | | g->b_frame_start = p_list->b_frame_start; |
|---|
| 325 | | g->i_pts = p_list->i_pts; |
|---|
| 326 | | g->i_dts = p_list->i_dts; |
|---|
| | 318 | g->i_flags = p_list->i_flags; |
|---|
| | 319 | g->i_pts = p_list->i_pts; |
|---|
| | 320 | g->i_dts = p_list->i_dts; |
|---|
| 327 | 321 | |
|---|
| 328 | 322 | /* free p_list */ |
|---|
| … | … | |
| 446 | 440 | } |
|---|
| 447 | 441 | |
|---|
| 448 | | block_t *block_FifoGetFrame( block_fifo_t *p_fifo ) |
|---|
| 449 | | { |
|---|
| 450 | | block_t *b = NULL; |
|---|
| 451 | | |
|---|
| 452 | | for( ;; ) |
|---|
| 453 | | { |
|---|
| 454 | | block_t *p_next; |
|---|
| 455 | | block_ChainAppend( &b, block_FifoGet( p_fifo ) ); |
|---|
| 456 | | p_next = block_FifoShow( p_fifo ); |
|---|
| 457 | | if( p_next == NULL || p_next->b_frame_start ) |
|---|
| 458 | | { |
|---|
| 459 | | break; |
|---|
| 460 | | } |
|---|
| 461 | | } |
|---|
| 462 | | |
|---|
| 463 | | return b; |
|---|
| 464 | | } |
|---|