field and a few BLOCK_FLAG_*.
* 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 <fenrir@via.ecp.fr>
*
*/
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;
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 */
* 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 <stef@via.ecp.fr>
* Christophe Massiot <massiot@via.ecp.fr>
return NULL;
}
- if( (*pp_block)->b_discontinuity )
+ if( (*pp_block)->i_flags&BLOCK_FLAG_DISCONTINUITY )
{
p_sys->i_state = STATE_NOSYNC;
}
* 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 <jon-vl@nanocrew.net>
* Gildas Bazin <gbazin@netcourrier.com>
return NULL;
}
- if( (*pp_block)->b_discontinuity )
+ if( (*pp_block)->i_flags&BLOCK_FLAG_DISCONTINUITY )
{
p_sys->i_state = STATE_NOSYNC;
}
* 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 <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
p_block = *pp_block;
- if( p_block->b_discontinuity )
+ if( p_block->i_flags&BLOCK_FLAG_DISCONTINUITY )
{
block_Release( p_block );
return NULL;
* 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 <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
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;
* 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 <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
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 */
* 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 <gbazin@netcourrier.com>
* Sigmund Augdal <sigmunau@idi.ntnu.no>
return NULL;
}
- if( (*pp_block)->b_discontinuity )
+ if( (*pp_block)->i_flags&BLOCK_FLAG_DISCONTINUITY )
{
p_sys->i_state = STATE_NOSYNC;
}
* 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 <gbazin@netcourrier.com>
* Christophe Massiot <massiot@via.ecp.fr>
#include <vlc/vout.h>
#include <vlc/decoder.h>
+#define PIC_FLAG_PTS
#include <mpeg2dec/mpeg2.h>
#include "vout_synchro.h"
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 )
{
* 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 <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
return NULL;
}
- if( (*pp_block)->b_discontinuity )
+ if( (*pp_block)->i_flags&BLOCK_FLAG_DISCONTINUITY )
{
p_sys->i_state = STATE_NOSYNC;
}
* 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 <gbazin@netcourrier.com>
*
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 );
* 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 <gbazin@netcourrier.com>
*
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 );
* 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 <gbazin@netcourrier.com>
*
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 );
* 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 <fenrir@videolan.org>
*
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;
}
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;
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 );
}
-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;
-}