From: Laurent Aimar Date: Wed, 25 Feb 2004 17:48:52 +0000 (+0000) Subject: * all: removed block_t->b_discontinuity,b_frame_* and added i_flags X-Git-Tag: 0.7.1~63 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=de81c25db345fcad4ac8106f52845dc2fd11cf50;p=vlc * all: removed block_t->b_discontinuity,b_frame_* and added i_flags field and a few BLOCK_FLAG_*. --- diff --git a/include/vlc_block.h b/include/vlc_block.h index 95b2783dfb..bfe481b93a 100644 --- a/include/vlc_block.h +++ b/include/vlc_block.h @@ -2,7 +2,7 @@ * vlc_block.h: Data blocks management functions ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: vlc_block.h,v 1.5 2003/12/24 09:46:08 gbazin Exp $ + * $Id: vlc_block.h,v 1.6 2004/02/25 17:48:52 fenrir Exp $ * * Authors: Laurent Aimar * @@ -29,17 +29,27 @@ */ typedef struct block_sys_t block_sys_t; +/* BLOCK_FLAG_DISCONTINUITY: the content doesn't follow the last block, or is probably broken */ +#define BLOCK_FLAG_DISCONTINUITY 0x0001 +/* BLOCK_FLAG_TYPE_I: Intra frame */ +#define BLOCK_FLAG_TYPE_I 0x0002 +/* BLOCK_FLAG_TYPE_P: inter frame with backward reference only */ +#define BLOCK_FLAG_TYPE_P 0x0004 +/* BLOCK_FLAG_TYPE_B: inter frame with backward and forward reference */ +#define BLOCK_FLAG_TYPE_B 0x0008 +/* BLOCK_FLAG_TYPE_PB: for inter frame when you don't know the real type */ +#define BLOCK_FLAG_TYPE_PB 0x0010 + struct block_t { block_t *p_next; - vlc_bool_t b_frame_display; - vlc_bool_t b_frame_start; + uint32_t i_flags; + mtime_t i_pts; mtime_t i_dts; mtime_t i_length; - vlc_bool_t b_discontinuity; /* only temporary */ int i_rate; int i_buffer; @@ -108,7 +118,6 @@ VLC_EXPORT( void, block_FifoRelease, ( block_fifo_t * ) ); VLC_EXPORT( void, block_FifoEmpty, ( block_fifo_t * ) ); VLC_EXPORT( int, block_FifoPut, ( block_fifo_t *, block_t * ) ); VLC_EXPORT( block_t *, block_FifoGet, ( block_fifo_t * ) ); -VLC_EXPORT( block_t *, block_FifoGetFrame, ( block_fifo_t * ) ); VLC_EXPORT( block_t *, block_FifoShow, ( block_fifo_t * ) ); #endif /* VLC_BLOCK_H */ diff --git a/modules/codec/a52.c b/modules/codec/a52.c index a07030f649..62efa2d17b 100644 --- a/modules/codec/a52.c +++ b/modules/codec/a52.c @@ -2,7 +2,7 @@ * a52.c: parse A/52 audio sync info and packetize the stream ***************************************************************************** * Copyright (C) 2001-2002 VideoLAN - * $Id: a52.c,v 1.33 2004/02/13 21:48:32 gbazin Exp $ + * $Id: a52.c,v 1.34 2004/02/25 17:48:52 fenrir Exp $ * * Authors: Stéphane Borel * Christophe Massiot @@ -171,7 +171,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) return NULL; } - if( (*pp_block)->b_discontinuity ) + if( (*pp_block)->i_flags&BLOCK_FLAG_DISCONTINUITY ) { p_sys->i_state = STATE_NOSYNC; } diff --git a/modules/codec/dts.c b/modules/codec/dts.c index e52ecf67e8..d6c3e53a0f 100644 --- a/modules/codec/dts.c +++ b/modules/codec/dts.c @@ -2,7 +2,7 @@ * dts.c: parse DTS audio sync info and packetize the stream ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: dts.c,v 1.17 2004/02/07 00:56:44 gbazin Exp $ + * $Id: dts.c,v 1.18 2004/02/25 17:48:52 fenrir Exp $ * * Authors: Jon Lech Johansen * Gildas Bazin @@ -172,7 +172,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) return NULL; } - if( (*pp_block)->b_discontinuity ) + if( (*pp_block)->i_flags&BLOCK_FLAG_DISCONTINUITY ) { p_sys->i_state = STATE_NOSYNC; } diff --git a/modules/codec/faad.c b/modules/codec/faad.c index 1ff7ca187e..35c8c6791a 100644 --- a/modules/codec/faad.c +++ b/modules/codec/faad.c @@ -2,7 +2,7 @@ * decoder.c: AAC decoder using libfaad2 ***************************************************************************** * Copyright (C) 2001, 2003 VideoLAN - * $Id: faad.c,v 1.13 2004/02/19 17:42:43 jpsaman Exp $ + * $Id: faad.c,v 1.14 2004/02/25 17:48:52 fenrir Exp $ * * Authors: Laurent Aimar * Gildas Bazin @@ -176,7 +176,7 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) p_block = *pp_block; - if( p_block->b_discontinuity ) + if( p_block->i_flags&BLOCK_FLAG_DISCONTINUITY ) { block_Release( p_block ); return NULL; diff --git a/modules/codec/ffmpeg/audio.c b/modules/codec/ffmpeg/audio.c index c3c93813b8..a19934cf6a 100644 --- a/modules/codec/ffmpeg/audio.c +++ b/modules/codec/ffmpeg/audio.c @@ -2,7 +2,7 @@ * audio.c: audio decoder using ffmpeg library ***************************************************************************** * Copyright (C) 1999-2003 VideoLAN - * $Id: audio.c,v 1.27 2003/11/27 12:32:03 fenrir Exp $ + * $Id: audio.c,v 1.28 2004/02/25 17:48:52 fenrir Exp $ * * Authors: Laurent Aimar * Gildas Bazin @@ -157,7 +157,8 @@ aout_buffer_t *E_( DecodeAudio )( decoder_t *p_dec, block_t **pp_block ) return NULL; } - if( p_block->i_buffer <= 0 || p_block->b_discontinuity ) + if( p_block->i_buffer <= 0 || + ( p_block->i_flags&BLOCK_FLAG_DISCONTINUITY ) ) { block_Release( p_block ); return NULL; diff --git a/modules/codec/ffmpeg/video.c b/modules/codec/ffmpeg/video.c index aeab7b99e0..05ac33c497 100644 --- a/modules/codec/ffmpeg/video.c +++ b/modules/codec/ffmpeg/video.c @@ -2,7 +2,7 @@ * video.c: video decoder using the ffmpeg library ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: video.c,v 1.66 2004/02/08 22:37:37 gbazin Exp $ + * $Id: video.c,v 1.67 2004/02/25 17:48:52 fenrir Exp $ * * Authors: Laurent Aimar * Gildas Bazin @@ -373,7 +373,7 @@ picture_t *E_(DecodeVideo)( decoder_t *p_dec, block_t **pp_block ) p_block = *pp_block; - if( p_block->b_discontinuity ) + if( p_block->i_flags&BLOCK_FLAG_DISCONTINUITY ) { p_sys->i_buffer = 0; p_sys->i_pts = 0; /* To make sure we recover properly */ diff --git a/modules/codec/flac.c b/modules/codec/flac.c index 52e34be038..1b31aabb7d 100644 --- a/modules/codec/flac.c +++ b/modules/codec/flac.c @@ -2,7 +2,7 @@ * flac.c: flac decoder/packetizer/encoder module making use of libflac ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: flac.c,v 1.8 2004/02/07 00:16:34 gbazin Exp $ + * $Id: flac.c,v 1.9 2004/02/25 17:48:52 fenrir Exp $ * * Authors: Gildas Bazin * Sigmund Augdal @@ -258,7 +258,7 @@ static block_t *PacketizeBlock( decoder_t *p_dec, block_t **pp_block ) return NULL; } - if( (*pp_block)->b_discontinuity ) + if( (*pp_block)->i_flags&BLOCK_FLAG_DISCONTINUITY ) { p_sys->i_state = STATE_NOSYNC; } diff --git a/modules/codec/libmpeg2.c b/modules/codec/libmpeg2.c index d040cc0be6..fd234fe200 100755 --- a/modules/codec/libmpeg2.c +++ b/modules/codec/libmpeg2.c @@ -2,7 +2,7 @@ * libmpeg2.c: mpeg2 video decoder module making use of libmpeg2. ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: libmpeg2.c,v 1.42 2004/01/16 09:39:57 sam Exp $ + * $Id: libmpeg2.c,v 1.43 2004/02/25 17:48:52 fenrir Exp $ * * Authors: Gildas Bazin * Christophe Massiot @@ -29,6 +29,7 @@ #include #include +#define PIC_FLAG_PTS #include #include "vout_synchro.h" @@ -210,7 +211,8 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) return NULL; } - if( p_block->b_discontinuity && p_sys->p_synchro && + if( (p_block->i_flags&BLOCK_FLAG_DISCONTINUITY) && + p_sys->p_synchro && p_sys->p_info->sequence && p_sys->p_info->sequence->width != (unsigned)-1 ) { diff --git a/modules/codec/mpeg_audio.c b/modules/codec/mpeg_audio.c index 4296b5b536..6958ef17ad 100644 --- a/modules/codec/mpeg_audio.c +++ b/modules/codec/mpeg_audio.c @@ -2,7 +2,7 @@ * mpeg_audio.c: parse MPEG audio sync info and packetize the stream ***************************************************************************** * Copyright (C) 2001-2003 VideoLAN - * $Id: mpeg_audio.c,v 1.25 2004/01/25 18:20:12 bigben Exp $ + * $Id: mpeg_audio.c,v 1.26 2004/02/25 17:48:52 fenrir Exp $ * * Authors: Laurent Aimar * Eric Petit @@ -189,7 +189,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) return NULL; } - if( (*pp_block)->b_discontinuity ) + if( (*pp_block)->i_flags&BLOCK_FLAG_DISCONTINUITY ) { p_sys->i_state = STATE_NOSYNC; } diff --git a/modules/demux/a52.c b/modules/demux/a52.c index b0bae276b6..668644cd0c 100644 --- a/modules/demux/a52.c +++ b/modules/demux/a52.c @@ -2,7 +2,7 @@ * a52.c : raw A/52 stream input module for vlc ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: a52.c,v 1.5 2004/02/17 13:13:32 gbazin Exp $ + * $Id: a52.c,v 1.6 2004/02/25 17:48:52 fenrir Exp $ * * Authors: Gildas Bazin * @@ -293,7 +293,6 @@ static int Demux( input_thread_t * p_input ) p_input->stream.p_selected_program, p_block_out->i_pts * 9 / 100 ); - p_block_in->b_discontinuity = 0; p_block_out->i_dts = p_block_out->i_pts = input_ClockGetTS( p_input, p_input->stream.p_selected_program, p_block_out->i_pts * 9 / 100 ); diff --git a/modules/demux/dts.c b/modules/demux/dts.c index e7a088de85..ae8931bef2 100644 --- a/modules/demux/dts.c +++ b/modules/demux/dts.c @@ -2,7 +2,7 @@ * dts.c : raw DTS stream input module for vlc ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: dts.c,v 1.9 2004/02/24 19:23:11 gbazin Exp $ + * $Id: dts.c,v 1.10 2004/02/25 17:48:52 fenrir Exp $ * * Authors: Gildas Bazin * @@ -291,7 +291,6 @@ static int Demux( input_thread_t * p_input ) p_input->stream.p_selected_program, p_block_out->i_pts * 9 / 100 ); - p_block_in->b_discontinuity = 0; p_block_out->i_dts = p_block_out->i_pts = input_ClockGetTS( p_input, p_input->stream.p_selected_program, p_block_out->i_pts * 9 / 100 ); diff --git a/modules/demux/flac.c b/modules/demux/flac.c index b53875245c..9e042614db 100644 --- a/modules/demux/flac.c +++ b/modules/demux/flac.c @@ -2,7 +2,7 @@ * flac.c : FLAC demux module for vlc ***************************************************************************** * Copyright (C) 2001-2003 VideoLAN - * $Id: flac.c,v 1.10 2004/01/25 20:05:28 hartman Exp $ + * $Id: flac.c,v 1.11 2004/02/25 17:48:52 fenrir Exp $ * * Authors: Gildas Bazin * @@ -222,7 +222,6 @@ static int Demux( input_thread_t * p_input ) p_input->stream.p_selected_program, p_block_out->i_pts * 9 / 100 ); - p_block_in->b_discontinuity = 0; p_block_out->i_dts = p_block_out->i_pts = input_ClockGetTS( p_input, p_input->stream.p_selected_program, p_block_out->i_pts * 9 / 100 ); diff --git a/src/misc/block.c b/src/misc/block.c index 99c968d8e1..32f00926e2 100644 --- a/src/misc/block.c +++ b/src/misc/block.c @@ -2,7 +2,7 @@ * block.c: Data blocks management functions ***************************************************************************** * Copyright (C) 2003-2004 VideoLAN - * $Id: block.c,v 1.6 2004/01/06 12:02:06 zorglub Exp $ + * $Id: block.c,v 1.7 2004/02/25 17:48:52 fenrir Exp $ * * Authors: Laurent Aimar * @@ -70,11 +70,9 @@ static block_t *__BlockDupContent( block_t *p_block ) p_dup = block_New( p_block->p_manager, p_block->i_buffer ); memcpy( p_dup->p_buffer, p_block->p_buffer, p_block->i_buffer ); - p_dup->b_frame_display = p_block->b_frame_display; - p_dup->b_frame_start = p_block->b_frame_start; + p_dup->i_flags = p_block->i_flags; p_dup->i_pts = p_block->i_pts; p_dup->i_dts = p_block->i_dts; - p_dup->b_discontinuity = p_block->b_discontinuity; return p_dup; } @@ -192,14 +190,11 @@ block_t *block_NewEmpty( void ) memset( p_block, 0, sizeof( block_t ) ); p_block->p_next = NULL; - p_block->b_frame_display= VLC_TRUE; - p_block->b_frame_start = VLC_FALSE; + p_block->i_flags = 0; p_block->i_pts = 0; p_block->i_dts = 0; p_block->i_length = 0; - p_block->b_discontinuity= VLC_FALSE; - p_block->i_buffer = 0; p_block->p_buffer = NULL; @@ -320,10 +315,9 @@ block_t *block_ChainGather( block_t *p_list ) g = block_New( p_list->p_manager, i_total ); block_ChainExtract( p_list, g->p_buffer, g->i_buffer ); - g->b_frame_display = p_list->b_frame_display; - g->b_frame_start = p_list->b_frame_start; - g->i_pts = p_list->i_pts; - g->i_dts = p_list->i_dts; + g->i_flags = p_list->i_flags; + g->i_pts = p_list->i_pts; + g->i_dts = p_list->i_dts; /* free p_list */ block_ChainRelease( p_list ); @@ -445,20 +439,3 @@ block_t *block_FifoShow( block_fifo_t *p_fifo ) } -block_t *block_FifoGetFrame( block_fifo_t *p_fifo ) -{ - block_t *b = NULL; - - for( ;; ) - { - block_t *p_next; - block_ChainAppend( &b, block_FifoGet( p_fifo ) ); - p_next = block_FifoShow( p_fifo ); - if( p_next == NULL || p_next->b_frame_start ) - { - break; - } - } - - return b; -}