CFLAGS += -O6
CFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
CFLAGS += -funroll-all-loops -fstrict-aliasing
-#CFLAGS += -fomit-frame-pointer
+CFLAGS += -fomit-frame-pointer
# Optimizations for x86 familiy
ifneq (,$(findstring 86,$(ARCH)))
* input_dec.c: Functions for the management of decoders
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_dec.c,v 1.1 2000/12/21 19:24:27 massiot Exp $
+ * $Id: input_dec.c,v 1.2 2000/12/22 10:58:27 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
#include "common.h"
#include "threads.h"
#include "mtime.h"
+#include "intf_msg.h"
#include "stream_control.h"
#include "input_ext-dec.h"
}
}
+/*****************************************************************************
+ * input_DecodePES
+ *****************************************************************************
+ * Put a PES in the decoder's fifo.
+ *****************************************************************************/
+void input_DecodePES( decoder_fifo_t * p_decoder_fifo, pes_packet_t * p_pes )
+{
+ vlc_mutex_lock( &p_decoder_fifo->data_lock );
+
+ if( !DECODER_FIFO_ISFULL( *p_decoder_fifo ) )
+ {
+ p_decoder_fifo->buffer[p_decoder_fifo->i_end] = p_pes;
+ DECODER_FIFO_INCEND( *p_decoder_fifo );
+
+ /* Warn the decoder that it's got work to do. */
+ vlc_cond_signal( &p_decoder_fifo->data_wait );
+ }
+ else
+ {
+ /* The FIFO is full !!! This should not happen. */
+ p_decoder_fifo->pf_delete_pes( p_decoder_fifo->p_packets_mgt,
+ p_pes );
+ intf_ErrMsg( "PES trashed - fifo full !" );
+ }
+ vlc_mutex_unlock( &p_decoder_fifo->data_lock );
+}
* decoder
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_dec.h,v 1.1 2000/12/21 19:24:27 massiot Exp $
+ * $Id: input_dec.h,v 1.2 2000/12/22 10:58:27 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
//decoder_capabilities_s * input_ProbeDecoder( void );
vlc_thread_t input_RunDecoder( struct decoder_capabilities_s *, void * );
void input_EndDecoder( struct decoder_fifo_s *, vlc_thread_t );
+void input_DecodePES( struct decoder_fifo_s *, struct pes_packet_s * );
* FIXME : check the return value of realloc() and malloc() !
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_programs.c,v 1.13 2000/12/21 19:24:27 massiot Exp $
+ * $Id: input_programs.c,v 1.14 2000/12/22 10:58:27 massiot Exp $
*
* Authors:
*
p_es->p_demux_data = malloc( i_data_len );
memset( p_es->p_demux_data, 0, i_data_len );
}
+ else
+ {
+ p_es->p_demux_data = NULL;
+ }
/* Add this ES to the program definition if one is given */
if( p_pgrm )
* mpeg_system.c: TS, PS and PES management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: mpeg_system.c,v 1.14 2000/12/21 19:24:27 massiot Exp $
+ * $Id: mpeg_system.c,v 1.15 2000/12/22 10:58:27 massiot Exp $
*
* Authors:
*
#include "input.h"
#include "mpeg_system.h"
+#include "input_dec.h"
#include "main.h" /* AC3/MPEG channel, SPU channel */
* PES Packet management
*/
-/*****************************************************************************
- * input_DecodePES
- *****************************************************************************
- * Put a PES in the decoder's fifo.
- *****************************************************************************/
-void input_DecodePES( input_thread_t * p_input, es_descriptor_t * p_es )
-{
-#define p_pes (p_es->p_pes)
-
- if( p_es->p_decoder_fifo != NULL )
- {
- vlc_mutex_lock( &p_es->p_decoder_fifo->data_lock );
-
-#if 0
- if( p_input->stream.b_pace_control )
- {
- /* FIXME : normally we shouldn't need this... */
- while( DECODER_FIFO_ISFULL( *p_es->p_decoder_fifo ) )
- {
- vlc_mutex_unlock( &p_es->p_decoder_fifo->data_lock );
- msleep( 20000 );
- vlc_mutex_lock( &p_es->p_decoder_fifo->data_lock );
- }
- }
-#endif
-
- if( !DECODER_FIFO_ISFULL( *p_es->p_decoder_fifo ) )
- {
- //intf_DbgMsg("Putting %p into fifo %p/%d\n",
- // p_pes, p_fifo, p_fifo->i_end);
- p_es->p_decoder_fifo->buffer[p_es->p_decoder_fifo->i_end] = p_pes;
- DECODER_FIFO_INCEND( *p_es->p_decoder_fifo );
-
- /* Warn the decoder that it's got work to do. */
- vlc_cond_signal( &p_es->p_decoder_fifo->data_wait );
- }
- else
- {
- /* The FIFO is full !!! This should not happen. */
- p_input->p_plugin->pf_delete_pes( p_input->p_method_data, p_pes );
- intf_ErrMsg( "PES trashed - fifo full ! (%d, %d)",
- p_es->i_id, p_es->i_type);
- }
- vlc_mutex_unlock( &p_es->p_decoder_fifo->data_lock );
- }
- else
- {
- intf_ErrMsg("No fifo to receive PES %p (who wrote this damn code ?)",
- p_pes);
- p_input->p_plugin->pf_delete_pes( p_input->p_method_data, p_pes );
- }
- p_pes = NULL;
-
-#undef p_pes
-}
-
/*****************************************************************************
* input_ParsePES
*****************************************************************************
/* Now we can eventually put the PES packet in the decoder's
* PES fifo */
- input_DecodePES( p_input, p_es );
+ if( p_es->p_decoder_fifo != NULL )
+ {
+ input_DecodePES( p_es->p_decoder_fifo, p_pes );
+ }
+ else
+ {
+ intf_ErrMsg("No fifo to receive PES %p (who wrote this damn code ?)",
+ p_pes);
+ p_input->p_plugin->pf_delete_pes( p_input->p_method_data, p_pes );
+ }
+ p_pes = NULL;
}
#undef p_pes
}
p_pes->p_first = p_pad_data;
p_pes->b_messed_up = p_pes->b_discontinuity = 1;
- input_DecodePES( p_input, p_es );
+ input_DecodePES( p_es->p_decoder_fifo, p_pes );
}
p_es->b_discontinuity = 0;
* and TS system layers
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: mpeg_system.h,v 1.2 2000/12/20 16:04:31 massiot Exp $
+ * $Id: mpeg_system.h,v 1.3 2000/12/22 10:58:27 massiot Exp $
*
* Authors:
*
/*****************************************************************************
* Prototypes
*****************************************************************************/
-void input_DecodePES( struct input_thread_s *, struct es_descriptor_s * );
void input_ParsePES( struct input_thread_s *, struct es_descriptor_s * );
void input_GatherPES( struct input_thread_s *, struct data_packet_s *,
struct es_descriptor_s *, boolean_t, boolean_t );