/*****************************************************************************
* speex.c: speex decoder/packetizer/encoder module making use of libspeex.
*****************************************************************************
- * Copyright (C) 2003 VideoLAN
+ * Copyright (C) 2003 the VideoLAN team
* $Id$
*
* Authors: Gildas Bazin <gbazin@videolan.org>
#include <vlc/input.h>
#include <ogg/ogg.h>
-#include <speex.h>
-#include "speex_header.h"
-#include "speex_stereo.h"
-#include "speex_callbacks.h"
+#include <speex/speex.h>
+#include <speex/speex_header.h>
+#include <speex/speex_stereo.h>
+#include <speex/speex_callbacks.h>
/*****************************************************************************
* decoder_sys_t : speex decoder descriptor
* Module descriptor
*****************************************************************************/
vlc_module_begin();
+ set_category( CAT_INPUT );
+ set_subcategory( SUBCAT_INPUT_ACODEC );
+
set_description( _("Speex audio decoder") );
set_capability( "decoder", 100 );
set_callbacks( OpenDecoder, CloseDecoder );
SpeexCallback callback;
p_sys->p_header = p_header =
- speex_packet_to_header( p_oggpacket->packet, p_oggpacket->bytes );
+ speex_packet_to_header( (char *)p_oggpacket->packet,
+ p_oggpacket->bytes );
if( !p_header )
{
msg_Err( p_dec, "cannot read Speex header" );
if( p_oggpacket->bytes )
{
/* Copy Ogg packet to Speex bitstream */
- speex_bits_read_from( &p_sys->bits, p_oggpacket->packet,
+ speex_bits_read_from( &p_sys->bits, (char *)p_oggpacket->packet,
p_oggpacket->bytes );
p_sys->i_frame_in_packet = 0;
}
return NULL;
}
- i_ret = speex_decode( p_sys->p_state, &p_sys->bits,
- (int16_t *)p_aout_buffer->p_buffer );
+ i_ret = speex_decode_int( p_sys->p_state, &p_sys->bits,
+ (int16_t *)p_aout_buffer->p_buffer );
if( i_ret == -1 )
{
/* End of stream */
}
if( p_sys->p_header->nb_channels == 2 )
- speex_decode_stereo( (int16_t *)p_aout_buffer->p_buffer,
- p_sys->p_header->frame_size, &p_sys->stereo );
+ speex_decode_stereo_int( (int16_t *)p_aout_buffer->p_buffer,
+ p_sys->p_header->frame_size,
+ &p_sys->stereo );
/* Date management */
p_aout_buffer->start_date = aout_DateGet( &p_sys->end_date );
encoder_sys_t *p_sys = p_enc->p_sys;
block_t *p_block, *p_chain = NULL;
- char *p_buffer = p_aout_buf->p_buffer;
+ unsigned char *p_buffer = p_aout_buf->p_buffer;
int i_samples = p_aout_buf->i_nb_samples;
int i_samples_delay = p_sys->i_samples_delay;
/* Encode current frame */
if( p_enc->fmt_in.audio.i_channels == 2 )
- speex_encode_stereo( p_samples, p_sys->i_frame_length,
- &p_sys->bits );
+ speex_encode_stereo_int( p_samples, p_sys->i_frame_length,
+ &p_sys->bits );
#if 0
if( p_sys->preprocess )
speex_preprocess( p_sys->preprocess, p_samples, NULL );
#endif
- speex_encode( p_sys->p_state, p_samples, &p_sys->bits );
+ speex_encode_int( p_sys->p_state, p_samples, &p_sys->bits );
p_buffer += p_sys->i_frame_size;
p_sys->i_samples_delay -= p_sys->i_frame_length;