Commit 6783b216 authored by Christophe Massiot's avatar Christophe Massiot

* Fixed an alignment issue with the bit stream and the bit stream

callback on startup - InitBitstream prototype has changed ;
* Removed a buffer zeroing in video output - doesn't change anything
for me, does it for you ?
parent 3bc1ec7a
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input.h: structures of the input not exported to other modules * input.h: structures of the input not exported to other modules
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: input.h,v 1.35 2001/03/19 13:26:59 sam Exp $ * $Id: input.h,v 1.36 2001/04/25 10:22:32 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -39,7 +39,10 @@ ...@@ -39,7 +39,10 @@
/***************************************************************************** /*****************************************************************************
* Prototypes from input_ext-dec.c * Prototypes from input_ext-dec.c
*****************************************************************************/ *****************************************************************************/
void InitBitstream ( struct bit_stream_s *, struct decoder_fifo_s * ); void InitBitstream ( struct bit_stream_s *, struct decoder_fifo_s *,
void (* pf_bitstream_callback)( struct bit_stream_s *,
boolean_t ),
void * p_callback_arg );
void NextDataPacket ( struct bit_stream_s * ); void NextDataPacket ( struct bit_stream_s * );
/***************************************************************************** /*****************************************************************************
...@@ -56,7 +59,6 @@ void input_NetworkOpen ( struct input_thread_s * ); ...@@ -56,7 +59,6 @@ void input_NetworkOpen ( struct input_thread_s * );
void input_NetworkClose( struct input_thread_s * ); void input_NetworkClose( struct input_thread_s * );
#endif #endif
/***************************************************************************** /*****************************************************************************
* Prototypes from input_programs.c * Prototypes from input_programs.c
*****************************************************************************/ *****************************************************************************/
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_ext-dec.h: structures exported to the VideoLAN decoders * input_ext-dec.h: structures exported to the VideoLAN decoders
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-dec.h,v 1.28 2001/04/16 12:34:28 asmax Exp $ * $Id: input_ext-dec.h,v 1.29 2001/04/25 10:22:32 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Kaempf <maxx@via.ecp.fr> * Michel Kaempf <maxx@via.ecp.fr>
...@@ -500,7 +500,10 @@ typedef struct decoder_config_s ...@@ -500,7 +500,10 @@ typedef struct decoder_config_s
struct stream_ctrl_s * p_stream_ctrl; struct stream_ctrl_s * p_stream_ctrl;
struct decoder_fifo_s * p_decoder_fifo; struct decoder_fifo_s * p_decoder_fifo;
void (* pf_init_bit_stream)( struct bit_stream_s *, void (* pf_init_bit_stream)( struct bit_stream_s *,
struct decoder_fifo_s * ); struct decoder_fifo_s *,
void (* pf_bitstream_callback)( struct bit_stream_s *,
boolean_t ),
void * );
} decoder_config_t; } decoder_config_t;
/***************************************************************************** /*****************************************************************************
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ac3_decoder_thread.c: ac3 decoder thread * ac3_decoder_thread.c: ac3 decoder thread
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: ac3_decoder_thread.c,v 1.28 2001/04/20 12:14:34 reno Exp $ * $Id: ac3_decoder_thread.c,v 1.29 2001/04/25 10:22:32 massiot Exp $
* *
* Authors: Michel Lespinasse <walken@zoy.org> * Authors: Michel Lespinasse <walken@zoy.org>
* *
...@@ -126,9 +126,8 @@ static int InitThread (ac3dec_thread_t * p_ac3dec_t) ...@@ -126,9 +126,8 @@ static int InitThread (ac3dec_thread_t * p_ac3dec_t)
p_ac3dec_t->p_config->decoder_config.pf_init_bit_stream( p_ac3dec_t->p_config->decoder_config.pf_init_bit_stream(
&p_ac3dec_t->ac3_decoder.bit_stream, &p_ac3dec_t->ac3_decoder.bit_stream,
p_ac3dec_t->p_config->decoder_config.p_decoder_fifo ); p_ac3dec_t->p_config->decoder_config.p_decoder_fifo,
p_ac3dec_t->ac3_decoder.bit_stream.pf_bitstream_callback=BitstreamCallback; BitstreamCallback, (void *) p_ac3dec_t );
p_ac3dec_t->ac3_decoder.bit_stream.p_callback_arg = (void *) p_ac3dec_t;
aout_fifo.i_type = AOUT_ADEC_STEREO_FIFO; aout_fifo.i_type = AOUT_ADEC_STEREO_FIFO;
...@@ -143,13 +142,6 @@ static int InitThread (ac3dec_thread_t * p_ac3dec_t) ...@@ -143,13 +142,6 @@ static int InitThread (ac3dec_thread_t * p_ac3dec_t)
return -1; return -1;
} }
/* InitBitstream has normally begun to read a PES packet, get its
* PTS/DTS */
if( !p_ac3dec_t->p_fifo->b_die )
{
BitstreamCallback( &p_ac3dec_t->ac3_decoder.bit_stream, 1 );
}
intf_DbgMsg("ac3dec debug: ac3 decoder thread %p initialized", p_ac3dec_t); intf_DbgMsg("ac3dec debug: ac3 decoder thread %p initialized", p_ac3dec_t);
return 0; return 0;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* audio_decoder.c: MPEG audio decoder thread * audio_decoder.c: MPEG audio decoder thread
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: audio_decoder.c,v 1.48 2001/04/06 09:15:47 sam Exp $ * $Id: audio_decoder.c,v 1.49 2001/04/25 10:22:32 massiot Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr> * Michel Lespinasse <walken@via.ecp.fr>
...@@ -133,7 +133,7 @@ static int InitThread (adec_thread_t * p_adec) ...@@ -133,7 +133,7 @@ static int InitThread (adec_thread_t * p_adec)
intf_DbgMsg ("adec debug: initializing audio decoder thread %p", p_adec); intf_DbgMsg ("adec debug: initializing audio decoder thread %p", p_adec);
p_adec->p_config->decoder_config.pf_init_bit_stream( &p_adec->bit_stream, p_adec->p_config->decoder_config.pf_init_bit_stream( &p_adec->bit_stream,
p_adec->p_config->decoder_config.p_decoder_fifo ); p_adec->p_config->decoder_config.p_decoder_fifo, NULL, NULL );
aout_fifo.i_type = AOUT_ADEC_STEREO_FIFO; aout_fifo.i_type = AOUT_ADEC_STEREO_FIFO;
aout_fifo.i_channels = 2; aout_fifo.i_channels = 2;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_ext-dec.c: services to the decoders * input_ext-dec.c: services to the decoders
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input_ext-dec.c,v 1.12 2001/04/06 09:15:47 sam Exp $ * $Id: input_ext-dec.c,v 1.13 2001/04/25 10:22:33 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -44,12 +44,15 @@ ...@@ -44,12 +44,15 @@
/***************************************************************************** /*****************************************************************************
* InitBitstream: initialize a bit_stream_t structure * InitBitstream: initialize a bit_stream_t structure
*****************************************************************************/ *****************************************************************************/
void InitBitstream( bit_stream_t * p_bit_stream, decoder_fifo_t * p_fifo ) void InitBitstream( bit_stream_t * p_bit_stream, decoder_fifo_t * p_fifo,
void (* pf_bitstream_callback)( struct bit_stream_s *,
boolean_t ),
void * p_callback_arg )
{ {
p_bit_stream->p_decoder_fifo = p_fifo; p_bit_stream->p_decoder_fifo = p_fifo;
p_bit_stream->pf_next_data_packet = NextDataPacket; p_bit_stream->pf_next_data_packet = NextDataPacket;
p_bit_stream->pf_bitstream_callback = NULL; p_bit_stream->pf_bitstream_callback = pf_bitstream_callback;
p_bit_stream->p_callback_arg = NULL; p_bit_stream->p_callback_arg = p_callback_arg;
/* Get the first data packet. */ /* Get the first data packet. */
vlc_mutex_lock( &p_fifo->data_lock ); vlc_mutex_lock( &p_fifo->data_lock );
...@@ -69,6 +72,12 @@ void InitBitstream( bit_stream_t * p_bit_stream, decoder_fifo_t * p_fifo ) ...@@ -69,6 +72,12 @@ void InitBitstream( bit_stream_t * p_bit_stream, decoder_fifo_t * p_fifo )
p_bit_stream->fifo.i_available = 0; p_bit_stream->fifo.i_available = 0;
vlc_mutex_unlock( &p_fifo->data_lock ); vlc_mutex_unlock( &p_fifo->data_lock );
/* Call back the decoder. */
if( p_bit_stream->pf_bitstream_callback != NULL )
{
p_bit_stream->pf_bitstream_callback( p_bit_stream, 1 );
}
if( p_bit_stream->p_byte <= p_bit_stream->p_end - sizeof(WORD_TYPE) ) if( p_bit_stream->p_byte <= p_bit_stream->p_end - sizeof(WORD_TYPE) )
{ {
/* Get aligned on a word boundary. /* Get aligned on a word boundary.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* spu_decoder.c : spu decoder thread * spu_decoder.c : spu decoder thread
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000 VideoLAN
* $Id: spu_decoder.c,v 1.36 2001/04/25 09:31:14 sam Exp $ * $Id: spu_decoder.c,v 1.37 2001/04/25 10:22:33 massiot Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -110,7 +110,7 @@ static int InitThread( spudec_thread_t *p_spudec ) ...@@ -110,7 +110,7 @@ static int InitThread( spudec_thread_t *p_spudec )
{ {
p_spudec->p_config->decoder_config.pf_init_bit_stream( p_spudec->p_config->decoder_config.pf_init_bit_stream(
&p_spudec->bit_stream, &p_spudec->bit_stream,
p_spudec->p_config->decoder_config.p_decoder_fifo ); p_spudec->p_config->decoder_config.p_decoder_fifo, NULL, NULL );
/* Mark thread as running and return */ /* Mark thread as running and return */
return( 0 ); return( 0 );
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* thread, and destroy a previously oppened video output thread. * thread, and destroy a previously oppened video output thread.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000 VideoLAN
* $Id: video_output.c,v 1.118 2001/04/25 09:31:14 sam Exp $ * $Id: video_output.c,v 1.119 2001/04/25 10:22:33 massiot Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -1616,6 +1616,9 @@ static void SetBufferPicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -1616,6 +1616,9 @@ static void SetBufferPicture( vout_thread_t *p_vout, picture_t *p_pic )
#endif #endif
i_data_size = (p_buffer->pi_area_end[i_area] - p_buffer->pi_area_begin[i_area] + 1) * p_vout->i_bytes_per_line; i_data_size = (p_buffer->pi_area_end[i_area] - p_buffer->pi_area_begin[i_area] + 1) * p_vout->i_bytes_per_line;
p_data = (u64*) (p_buffer->p_data + p_vout->i_bytes_per_line * p_buffer->pi_area_begin[i_area]); p_data = (u64*) (p_buffer->p_data + p_vout->i_bytes_per_line * p_buffer->pi_area_begin[i_area]);
#if 0
/* Removed for performance --Meuuh */
for( i_data_index = i_data_size / 256; i_data_index-- ; ) for( i_data_index = i_data_size / 256; i_data_index-- ; )
{ {
/* Clear 256 bytes block */ /* Clear 256 bytes block */
...@@ -1639,6 +1642,7 @@ static void SetBufferPicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -1639,6 +1642,7 @@ static void SetBufferPicture( vout_thread_t *p_vout, picture_t *p_pic )
/* Clear remaining bytes */ /* Clear remaining bytes */
*p_data8++ = 0; *p_data8++ = 0;
} }
#endif
} }
/* /*
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* video_parser.c : video parser thread * video_parser.c : video parser thread
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: video_parser.c,v 1.78 2001/03/22 01:23:03 stef Exp $ * $Id: video_parser.c,v 1.79 2001/04/25 10:22:33 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr> * Samuel Hocevar <sam@via.ecp.fr>
...@@ -220,16 +220,8 @@ static int InitThread( vpar_thread_t *p_vpar ) ...@@ -220,16 +220,8 @@ static int InitThread( vpar_thread_t *p_vpar )
intf_DbgMsg("vpar debug: initializing video parser thread %p", p_vpar); intf_DbgMsg("vpar debug: initializing video parser thread %p", p_vpar);
p_vpar->p_config->decoder_config.pf_init_bit_stream( &p_vpar->bit_stream, p_vpar->p_config->decoder_config.pf_init_bit_stream( &p_vpar->bit_stream,
p_vpar->p_config->decoder_config.p_decoder_fifo ); p_vpar->p_config->decoder_config.p_decoder_fifo, BitstreamCallback,
p_vpar->bit_stream.pf_bitstream_callback = BitstreamCallback; (void *)p_vpar );
p_vpar->bit_stream.p_callback_arg = (void *)p_vpar;
/* InitBitstream has normally begun to read a PES packet, get its
* PTS/DTS */
if( !p_vpar->p_fifo->b_die )
{
BitstreamCallback( &p_vpar->bit_stream, 1 );
}
/* Initialize parsing data */ /* Initialize parsing data */
p_vpar->sequence.p_forward = NULL; p_vpar->sequence.p_forward = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment