]> git.sesse.net Git - vlc/commitdiff
* all: removed block_t->b_discontinuity,b_frame_* and added i_flags
authorLaurent Aimar <fenrir@videolan.org>
Wed, 25 Feb 2004 17:48:52 +0000 (17:48 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Wed, 25 Feb 2004 17:48:52 +0000 (17:48 +0000)
 field and a few BLOCK_FLAG_*.

13 files changed:
include/vlc_block.h
modules/codec/a52.c
modules/codec/dts.c
modules/codec/faad.c
modules/codec/ffmpeg/audio.c
modules/codec/ffmpeg/video.c
modules/codec/flac.c
modules/codec/libmpeg2.c
modules/codec/mpeg_audio.c
modules/demux/a52.c
modules/demux/dts.c
modules/demux/flac.c
src/misc/block.c

index 95b2783dfbab52da140e65c4c5764fc3fdce9410..bfe481b93a2f2bdf013bef1a53b00abbbf96bb14 100644 (file)
@@ -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 <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;
@@ -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 */
index a07030f649b9b9c416a1d2898fa80db56bdae058..62efa2d17bfe4c63150752593146882236f89288 100644 (file)
@@ -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 <stef@via.ecp.fr>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -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;
     }
index e52ecf67e8fb3e7bb1b4844e5fa5ef9a9570dcf6..d6c3e53a0fbcb93a3e0a12b0cee7b98bc9cc6e04 100644 (file)
@@ -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 <jon-vl@nanocrew.net>
  *          Gildas Bazin <gbazin@netcourrier.com>
@@ -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;
     }
index 1ff7ca187e3062be386e909a0d1f56a0891a2684..35c8c6791a65010fd8e92b0424763047becc320b 100644 (file)
@@ -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 <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@netcourrier.com>
@@ -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;
index c3c93813b89db4038410b58439a8f8044e7dde70..a19934cf6a33a4dcdc96772bf2363b3022a169dd 100644 (file)
@@ -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 <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@netcourrier.com>
@@ -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;
index aeab7b99e0add525be95e237301836ae936f1c9f..05ac33c497feb07dc2304446b3abf379d8f2fa4a 100644 (file)
@@ -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 <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@netcourrier.com>
@@ -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 */
index 52e34be03861c84f36bb915019c54fb5fc0bd68c..1b31aabb7daf30a00fe86a60090d4e865a87c4b6 100644 (file)
@@ -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 <gbazin@netcourrier.com>
  *          Sigmund Augdal <sigmunau@idi.ntnu.no>
@@ -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;
     }
index d040cc0be67a7bac3e57b5f40ebdaead6a5157c8..fd234fe2008208be0b004f2adc7a110d50ba6e90 100755 (executable)
@@ -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 <gbazin@netcourrier.com>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -29,6 +29,7 @@
 #include <vlc/vout.h>
 #include <vlc/decoder.h>
 
+#define PIC_FLAG_PTS
 #include <mpeg2dec/mpeg2.h>
 
 #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 )
             {
index 4296b5b53673b416cac2c676a84205932cdbe841..6958ef17ad5b78ea1f6ec25cf21ae567a8116f7b 100644 (file)
@@ -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 <fenrir@via.ecp.fr>
  *          Eric Petit <titer@videolan.org>
@@ -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;
     }
index b0bae276b6fb4c9d67b5d00307c22994be4f1151..668644cd0ca79e79b72ef5a75d46d92d6394b3a6 100644 (file)
@@ -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 <gbazin@netcourrier.com>
  *
@@ -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 );
index e7a088de85aad5c4a0e068740ce8a94a66e969cf..ae8931bef2fe5868f9d4710da574ee5e7b9d7bc7 100644 (file)
@@ -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 <gbazin@netcourrier.com>
  *
@@ -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 );
index b53875245c63a7c2f359bf0d617b0bb281f868fe..9e042614db89d33ce5450b340b208b9cc8bb1009 100644 (file)
@@ -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 <gbazin@netcourrier.com>
  *
@@ -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 );
index 99c968d8e11363b19d2bf660189b832571d51480..32f00926e2fafa0fa6ef1ce3aedec044f658b132 100644 (file)
@@ -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 <fenrir@videolan.org>
  *
@@ -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;
-}