Commit e2b439cf authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

Replace remaining instances of aout_buffer_t with block_t

parent 8fbafffc
......@@ -53,7 +53,7 @@ function VlcSyntax()
syn keyword cType es_format_t video_palette_t
" Aout
syn keyword cType audio_output_t aout_sys_t
syn keyword cType aout_fifo_t aout_input_t aout_buffer_t audio_sample_format_t
syn keyword cType aout_fifo_t aout_input_t audio_sample_format_t
syn keyword cType aout_mixer_sys_t aout_filter_sys_t audio_volume_t
syn keyword cType aout_mixer_t aout_output_t audio_date_t
syn keyword cType aout_filter_t
......
......@@ -231,9 +231,9 @@ VLC_API vout_thread_t * aout_filter_RequestVout( filter_t *, vout_thread_t *p_vo
/** Audio output buffer FIFO */
struct aout_fifo_t
{
aout_buffer_t * p_first;
aout_buffer_t ** pp_last;
date_t end_date;
block_t *p_first;
block_t **pp_last;
date_t end_date;
};
/* Legacy packet-oriented audio output helpers */
......
......@@ -71,7 +71,7 @@ struct decoder_t
/* */
picture_t * ( * pf_decode_video )( decoder_t *, block_t ** );
aout_buffer_t * ( * pf_decode_audio )( decoder_t *, block_t ** );
block_t * ( * pf_decode_audio )( decoder_t *, block_t ** );
subpicture_t * ( * pf_decode_sub) ( decoder_t *, block_t ** );
block_t * ( * pf_packetize ) ( decoder_t *, block_t ** );
......@@ -110,7 +110,7 @@ struct decoder_t
/* Audio output callbacks
* XXX use decoder_NewAudioBuffer/decoder_DeleteAudioBuffer */
aout_buffer_t *(*pf_aout_buffer_new)( decoder_t *, int );
block_t *(*pf_aout_buffer_new)( decoder_t *, int );
/* SPU output callbacks
* XXX use decoder_NewSubpicture and decoder_DeleteSubpicture */
......@@ -162,7 +162,7 @@ struct encoder_t
es_format_t fmt_out;
block_t * ( * pf_encode_video )( encoder_t *, picture_t * );
block_t * ( * pf_encode_audio )( encoder_t *, aout_buffer_t * );
block_t * ( * pf_encode_audio )( encoder_t *, block_t * );
block_t * ( * pf_encode_sub )( encoder_t *, subpicture_t * );
/* Common encoder options */
......@@ -209,7 +209,7 @@ VLC_API void decoder_UnlinkPicture( decoder_t *, picture_t * );
* output buffer. You have to release it using decoder_DeleteAudioBuffer
* or by returning it to the caller as a pf_decode_audio return value.
*/
VLC_API aout_buffer_t * decoder_NewAudioBuffer( decoder_t *, int i_size ) VLC_USED;
VLC_API block_t * decoder_NewAudioBuffer( decoder_t *, int i_size ) VLC_USED;
/**
* This function will return a new subpicture usable by a decoder as an output
......
......@@ -273,7 +273,6 @@ typedef struct audio_output audio_output_t;
typedef struct aout_sys_t aout_sys_t;
typedef struct aout_fifo_t aout_fifo_t;
typedef struct aout_input_t aout_input_t;
typedef struct block_t aout_buffer_t;
typedef audio_format_t audio_sample_format_t;
/* Video */
......
......@@ -330,7 +330,7 @@ static int Init( vlc_object_t *p_this, struct filter_sys_t * p_data
* DoWork: convert a buffer
*****************************************************************************/
static void DoWork( filter_t * p_filter,
aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf )
block_t * p_in_buf, block_t * p_out_buf )
{
filter_sys_t *p_sys = p_filter->p_sys;
int i_input_nb = aout_FormatNbChannels( &p_filter->fmt_in.audio );
......
......@@ -49,11 +49,9 @@ static void CloseFilter ( vlc_object_t * );
static block_t *Convert( filter_t *p_filter, block_t *p_block );
static unsigned int stereo_to_mono( filter_t *, aout_buffer_t *,
aout_buffer_t * );
static unsigned int mono( filter_t *, aout_buffer_t *, aout_buffer_t * );
static void stereo2mono_downmix( filter_t *, aout_buffer_t *,
aout_buffer_t * );
static unsigned int stereo_to_mono( filter_t *, block_t *, block_t * );
static unsigned int mono( filter_t *, block_t *, block_t * );
static void stereo2mono_downmix( filter_t *, block_t *, block_t * );
/*****************************************************************************
* Local structures
......@@ -504,7 +502,7 @@ static block_t *Convert( filter_t *p_filter, block_t *p_block )
* Written by Boris Dorès <babal@via.ecp.fr>
*/
static void stereo2mono_downmix( filter_t * p_filter,
aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf )
block_t * p_in_buf, block_t * p_out_buf )
{
filter_sys_t *p_sys = (filter_sys_t *)p_filter->p_sys;
......@@ -607,7 +605,7 @@ static void stereo2mono_downmix( filter_t * p_filter,
/* Simple stereo to mono mixing. */
static unsigned int mono( filter_t *p_filter,
aout_buffer_t *p_output, aout_buffer_t *p_input )
block_t *p_output, block_t *p_input )
{
filter_sys_t *p_sys = (filter_sys_t *)p_filter->p_sys;
int16_t *p_in, *p_out;
......@@ -627,7 +625,7 @@ static unsigned int mono( filter_t *p_filter,
/* Simple stereo to mono mixing. */
static unsigned int stereo_to_mono( filter_t *p_filter,
aout_buffer_t *p_output, aout_buffer_t *p_input )
block_t *p_output, block_t *p_input )
{
filter_sys_t *p_sys = (filter_sys_t *)p_filter->p_sys;
int16_t *p_in, *p_out;
......
......@@ -59,7 +59,7 @@ static block_t *Filter( filter_t *, block_t * );
* DoWork: convert a buffer
*****************************************************************************/
static void DoWork( filter_t * p_filter,
aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf )
block_t * p_in_buf, block_t * p_out_buf )
{
const unsigned i_input_physical = p_filter->fmt_in.audio.i_physical_channels;
......
......@@ -74,7 +74,7 @@ vlc_module_end ()
* DoWork: decode an MPEG audio frame.
*****************************************************************************/
static void DoWork( filter_t * p_filter,
aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf )
block_t * p_in_buf, block_t * p_out_buf )
{
filter_sys_t *p_sys = p_filter->p_sys;
......
......@@ -39,7 +39,7 @@
* Local prototypes
*****************************************************************************/
static int Create( vlc_object_t * );
static void DoWork( audio_mixer_t *, aout_buffer_t *, float );
static void DoWork( audio_mixer_t *, block_t *, float );
/*****************************************************************************
* Module descriptor
......@@ -69,7 +69,7 @@ static int Create( vlc_object_t *p_this )
/**
* Mixes a new output buffer
*/
static void DoWork( audio_mixer_t * p_mixer, aout_buffer_t *p_buffer,
static void DoWork( audio_mixer_t * p_mixer, block_t *p_buffer,
float f_multiplier )
{
if( f_multiplier == 1.0 )
......
......@@ -136,9 +136,9 @@ static int Open ( vlc_object_t *p_this )
/*****************************************************************************
* aout_FifoPop : get the next buffer out of the FIFO
*****************************************************************************/
static aout_buffer_t *aout_FifoPop2( aout_fifo_t * p_fifo )
static block_t *aout_FifoPop2( aout_fifo_t * p_fifo )
{
aout_buffer_t *p_buffer = p_fifo->p_first;
block_t *p_buffer = p_fifo->p_first;
if( p_buffer != NULL )
{
p_fifo->p_first = p_buffer->p_next;
......@@ -167,7 +167,7 @@ static void Close ( vlc_object_t *p_this )
void AudioQueueCallback(void * inUserData, AudioQueueRef inAQ, AudioQueueBufferRef inBuffer) {
audio_output_t * p_aout = (audio_output_t *)inUserData;
aout_buffer_t * p_buffer = NULL;
block_t * p_buffer = NULL;
if (p_aout) {
struct aout_sys_t * p_sys = p_aout->sys;
......
......@@ -1304,7 +1304,7 @@ static OSStatus RenderCallbackAnalog( vlc_object_t *_p_aout,
while( i_mData_bytes < ioData->mBuffers[0].mDataByteSize )
{
/* We don't have enough data yet */
aout_buffer_t * p_buffer;
block_t * p_buffer;
p_buffer = aout_PacketNext( p_aout, current_date );
if( p_buffer != NULL )
......@@ -1353,7 +1353,7 @@ static OSStatus RenderCallbackSPDIF( AudioDeviceID inDevice,
const AudioTimeStamp * inOutputTime,
void * threadGlobals )
{
aout_buffer_t * p_buffer;
block_t * p_buffer;
mtime_t current_date;
audio_output_t * p_aout = (audio_output_t *)threadGlobals;
......
......@@ -105,7 +105,7 @@ static int CreateDSBuffer ( audio_output_t *, int, int, int, int, int, bool
static int CreateDSBufferPCM ( audio_output_t *, vlc_fourcc_t*, int, int, int, bool );
static void DestroyDSBuffer ( audio_output_t * );
static void* DirectSoundThread( void * );
static int FillBuffer ( audio_output_t *, int, aout_buffer_t * );
static int FillBuffer ( audio_output_t *, int, block_t * );
static int ReloadDirectXDevices( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
......@@ -949,8 +949,7 @@ static void DestroyDSBuffer( audio_output_t *p_aout )
*****************************************************************************
* Returns VLC_SUCCESS on success.
*****************************************************************************/
static int FillBuffer( audio_output_t *p_aout, int i_frame,
aout_buffer_t *p_buffer )
static int FillBuffer( audio_output_t *p_aout, int i_frame, block_t *p_buffer )
{
aout_sys_t *p_sys = p_aout->sys;
notification_thread_t *p_notif = &p_sys->notif;
......@@ -1099,7 +1098,7 @@ static void* DirectSoundThread( void *data )
for( i = 0; i < l_free_slots; i++ )
{
aout_buffer_t *p_buffer = aout_PacketNext( p_aout,
block_t *p_buffer = aout_PacketNext( p_aout,
mtime + INT64_C(1000000) * (i * i_frame_siz + l_queued) /
p_aout->format.i_rate );
......
......@@ -263,7 +263,7 @@ int Process( jack_nframes_t i_frames, void *p_arg )
mtime_t play_date = mdate() + (mtime_t) ( dtime );
/* Get the next audio data buffer */
aout_buffer_t *p_buffer = aout_PacketNext( p_aout, play_date );
block_t *p_buffer = aout_PacketNext( p_aout, play_date );
if( p_buffer != NULL )
{
......
......@@ -284,7 +284,7 @@ static ULONG APIENTRY KaiCallback( PVOID p_cb_data,
ULONG i_buf_size )
{
audio_output_t *p_aout = (audio_output_t *)p_cb_data;
aout_buffer_t *p_aout_buffer;
block_t *p_aout_buffer;
mtime_t current_date, next_date;
ULONG i_len;
......
......@@ -550,7 +550,7 @@ static mtime_t BufferDuration( audio_output_t * p_aout )
typedef struct
{
aout_buffer_t *p_buffer;
block_t *p_buffer;
void *p_bytes;
} oss_thread_ctx_t;
......@@ -574,7 +574,7 @@ static void* OSSThread( void *obj )
for( ;; )
{
aout_buffer_t * p_buffer = NULL;
block_t * p_buffer = NULL;
int canc = vlc_savecancel ();
if ( p_aout->format.i_format != VLC_CODEC_SPDIFL )
......
......@@ -41,7 +41,7 @@ static void aout_FifoInit( aout_fifo_t *p_fifo, uint32_t i_rate )
/**
* Pushes a packet into the FIFO.
*/
static void aout_FifoPush( aout_fifo_t * p_fifo, aout_buffer_t * p_buffer )
static void aout_FifoPush( aout_fifo_t * p_fifo, block_t * p_buffer )
{
*p_fifo->pp_last = p_buffer;
p_fifo->pp_last = &p_buffer->p_next;
......@@ -65,13 +65,13 @@ static void aout_FifoPush( aout_fifo_t * p_fifo, aout_buffer_t * p_buffer )
*/
static void aout_FifoReset( aout_fifo_t * p_fifo )
{
aout_buffer_t * p_buffer;
block_t * p_buffer;
date_Set( &p_fifo->end_date, VLC_TS_INVALID );
p_buffer = p_fifo->p_first;
while ( p_buffer != NULL )
{
aout_buffer_t * p_next = p_buffer->p_next;
block_t * p_next = p_buffer->p_next;
block_Release( p_buffer );
p_buffer = p_next;
}
......@@ -98,9 +98,9 @@ static void aout_FifoMoveDates( aout_fifo_t *fifo, mtime_t difference )
/**
* Gets the next buffer out of the FIFO
*/
static aout_buffer_t *aout_FifoPop( aout_fifo_t * p_fifo )
static block_t *aout_FifoPop( aout_fifo_t * p_fifo )
{
aout_buffer_t *p_buffer = p_fifo->p_first;
block_t *p_buffer = p_fifo->p_first;
if( p_buffer != NULL )
{
p_fifo->p_first = p_buffer->p_next;
......@@ -115,12 +115,12 @@ static aout_buffer_t *aout_FifoPop( aout_fifo_t * p_fifo )
*/
static void aout_FifoDestroy( aout_fifo_t * p_fifo )
{
aout_buffer_t * p_buffer;
block_t * p_buffer;
p_buffer = p_fifo->p_first;
while ( p_buffer != NULL )
{
aout_buffer_t * p_next = p_buffer->p_next;
block_t * p_next = p_buffer->p_next;
block_Release( p_buffer );
p_buffer = p_next;
}
......@@ -229,7 +229,7 @@ static block_t *aout_OutputSlice (audio_output_t *p_aout)
mtime_t start_date = date_Get( &exact_start_date );
/* Check if there is enough data to slice a new buffer. */
aout_buffer_t *p_buffer = p_fifo->p_first;
block_t *p_buffer = p_fifo->p_first;
if( p_buffer == NULL )
return NULL;
......@@ -266,7 +266,7 @@ static block_t *aout_OutputSlice (audio_output_t *p_aout)
for( uint8_t *p_out = p_buffer->p_buffer; needed > 0; )
{
aout_buffer_t *p_inbuf = p_fifo->p_first;
block_t *p_inbuf = p_fifo->p_first;
if( unlikely(p_inbuf == NULL) )
{
msg_Err( p_aout, "packetization error" );
......
......@@ -63,7 +63,7 @@ static int OpenWaveOut ( audio_output_t *, uint32_t,
static int OpenWaveOutPCM( audio_output_t *, uint32_t,
vlc_fourcc_t*, int, int, int, bool );
static int PlayWaveOut ( audio_output_t *, HWAVEOUT, WAVEHDR *,
aout_buffer_t *, bool );
block_t *, bool );
static void CALLBACK WaveOutCallback ( HWAVEOUT, UINT, DWORD_PTR, DWORD_PTR, DWORD_PTR );
static void* WaveOutThread( void * );
......@@ -738,8 +738,7 @@ static int OpenWaveOutPCM( audio_output_t *p_aout, uint32_t i_device_id,
* PlayWaveOut: play a buffer through the WaveOut device
*****************************************************************************/
static int PlayWaveOut( audio_output_t *p_aout, HWAVEOUT h_waveout,
WAVEHDR *p_waveheader, aout_buffer_t *p_buffer,
bool b_spdif)
WAVEHDR *p_waveheader, block_t *p_buffer, bool b_spdif)
{
MMRESULT result;
......@@ -842,8 +841,8 @@ static int WaveOutClearDoneBuffers(aout_sys_t *p_sys)
if( (p_waveheader[i].dwFlags & WHDR_DONE) &&
p_waveheader[i].dwUser )
{
aout_buffer_t *p_buffer =
(aout_buffer_t *)(p_waveheader[i].dwUser);
block_t *p_buffer =
(block_t *)(p_waveheader[i].dwUser);
/* Unprepare and free the buffers which has just been played */
waveOutUnprepareHeader( p_sys->h_waveout, &p_waveheader[i],
sizeof(WAVEHDR) );
......@@ -874,7 +873,7 @@ static void* WaveOutThread( void *data )
{
audio_output_t *p_aout = data;
aout_sys_t *p_sys = p_aout->sys;
aout_buffer_t *p_buffer = NULL;
block_t *p_buffer = NULL;
WAVEHDR *p_waveheader = p_sys->waveheader;
int i, i_queued_frames;
bool b_sleek;
......
......@@ -91,9 +91,9 @@ struct decoder_sys_t
****************************************************************************/
static block_t *DecodeBlock ( decoder_t *, block_t ** );
static uint8_t *GetOutBuffer ( decoder_t *, block_t ** );
static aout_buffer_t *GetAoutBuffer( decoder_t * );
static block_t *GetSoutBuffer( decoder_t * );
static uint8_t *GetOutBuffer ( decoder_t *, block_t ** );
static block_t *GetAoutBuffer( decoder_t * );
static block_t *GetSoutBuffer( decoder_t * );
/*****************************************************************************
* OpenCommon: probe the decoder/packetizer and return score
......@@ -367,7 +367,7 @@ static uint8_t *GetOutBuffer( decoder_t *p_dec, block_t **pp_out_buffer )
}
else
{
aout_buffer_t *p_aout_buffer = GetAoutBuffer( p_dec );
block_t *p_aout_buffer = GetAoutBuffer( p_dec );
p_buf = p_aout_buffer ? p_aout_buffer->p_buffer : NULL;
*pp_out_buffer = p_aout_buffer;
}
......@@ -378,11 +378,11 @@ static uint8_t *GetOutBuffer( decoder_t *p_dec, block_t **pp_out_buffer )
/*****************************************************************************
* GetAoutBuffer:
*****************************************************************************/
static aout_buffer_t *GetAoutBuffer( decoder_t *p_dec )
static block_t *GetAoutBuffer( decoder_t *p_dec )
{
decoder_sys_t *p_sys = p_dec->p_sys;
aout_buffer_t *p_buf = decoder_NewAudioBuffer( p_dec, p_sys->frame.i_samples );
block_t *p_buf = decoder_NewAudioBuffer( p_dec, p_sys->frame.i_samples );
if( p_buf )
{
p_buf->i_pts = date_Get( &p_sys->end_date );
......
......@@ -41,7 +41,7 @@
static int OpenDecoder( vlc_object_t * );
static void CloseDecoder( vlc_object_t * );
static aout_buffer_t *DecodeBlock( decoder_t *, block_t ** );
static block_t *DecodeBlock( decoder_t *, block_t ** );
vlc_module_begin ()
set_description( N_("ADPCM audio decoder") )
......@@ -264,7 +264,7 @@ static int OpenDecoder( vlc_object_t *p_this )
/*****************************************************************************
* DecodeBlock:
*****************************************************************************/
static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
{
decoder_sys_t *p_sys = p_dec->p_sys;
block_t *p_block;
......@@ -290,7 +290,7 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if( p_block->i_buffer >= p_sys->i_block )
{
aout_buffer_t *p_out;
block_t *p_out;
p_out = decoder_NewAudioBuffer( p_dec, p_sys->i_samplesperblock );
if( p_out == NULL )
......
......@@ -118,11 +118,11 @@ static void Close( vlc_object_t *p_this )
****************************************************************************
* Beware, this function must be fed with complete frames (PES packet).
*****************************************************************************/
static aout_buffer_t *Decode( decoder_t *p_dec, block_t **pp_block )
static block_t *Decode( decoder_t *p_dec, block_t **pp_block )
{
decoder_sys_t *p_sys = p_dec->p_sys;
block_t *p_block;
aout_buffer_t *p_aout_buffer;
block_t *p_aout_buffer;
int i_frame_length, i_bits;
p_block = Parse( p_dec, &i_frame_length, &i_bits, pp_block, false );
......
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