Commit a48fa032 authored by Rémi Duraffort's avatar Rémi Duraffort

Use the right declaration for threaded functions.

parent a7d8f15b
......@@ -181,13 +181,16 @@ static void client_callback( AvahiClient *c,
/*****************************************************************************
* poll_iterate_thread
*****************************************************************************/
static void poll_iterate_thread( poll_thread_t *p_pt )
static void* poll_iterate_thread( vlc_object_t *p_this )
{
poll_thread_t *p_pt = (poll_thread_t*)p_this;
vlc_thread_ready( p_pt );
while( vlc_object_alive (p_pt) )
if( avahi_simple_poll_iterate( p_pt->simple_poll, 100 ) != 0 )
break;
return NULL;
}
/*****************************************************************************
......
......@@ -68,7 +68,7 @@ vlc_module_end();
*****************************************************************************/
static ssize_t Write( sout_access_out_t *, block_t * );
static int Seek ( sout_access_out_t *, off_t );
static void ThreadControl( vlc_object_t * );
static void* ThreadControl( vlc_object_t * );
struct sout_access_out_sys_t
{
......@@ -379,7 +379,7 @@ static int Seek( sout_access_out_t *p_access, off_t i_pos )
/*****************************************************************************
* ThreadControl: manage control messages and pipe media to Read
*****************************************************************************/
static void ThreadControl( vlc_object_t *p_this )
static void* ThreadControl( vlc_object_t *p_this )
{
rtmp_control_thread_t *p_thread = (rtmp_control_thread_t *) p_this;
rtmp_packet_t *rtmp_packet;
......@@ -416,4 +416,5 @@ static void ThreadControl( vlc_object_t *p_this )
p_thread->b_die = 1;
}
}
return NULL;
}
......@@ -114,7 +114,7 @@ static const char *const ppsz_core_options[] = {
static ssize_t Write ( sout_access_out_t *, block_t * );
static int Seek ( sout_access_out_t *, off_t );
static void ThreadWrite( vlc_object_t * );
static void* ThreadWrite( vlc_object_t * );
static block_t *NewUDPPacket( sout_access_out_t *, mtime_t );
typedef struct sout_access_thread_t
......@@ -437,7 +437,7 @@ static block_t *NewUDPPacket( sout_access_out_t *p_access, mtime_t i_dts)
/*****************************************************************************
* ThreadWrite: Write a packet on the network at the good time.
*****************************************************************************/
static void ThreadWrite( vlc_object_t *p_this )
static void* ThreadWrite( vlc_object_t *p_this )
{
sout_access_thread_t *p_thread = (sout_access_thread_t*)p_this;
mtime_t i_date_last = -1;
......@@ -519,4 +519,5 @@ static void ThreadWrite( vlc_object_t *p_this )
i_date_last = i_date;
}
return NULL;
}
......@@ -90,11 +90,11 @@ struct aout_sys_t
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
static void Play ( aout_instance_t * );
static int ALSAThread ( aout_instance_t * );
static void ALSAFill ( aout_instance_t * );
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
static void Play ( aout_instance_t * );
static void* ALSAThread ( vlc_object_t * );
static void ALSAFill ( aout_instance_t * );
static int FindDevicesCallback( vlc_object_t *p_this, char const *psz_name,
vlc_value_t newval, vlc_value_t oldval, void *p_unused );
......@@ -760,8 +760,9 @@ static void Close( vlc_object_t *p_this )
/*****************************************************************************
* ALSAThread: asynchronous thread used to DMA the data to the device
*****************************************************************************/
static int ALSAThread( aout_instance_t * p_aout )
static void* ALSAThread( vlc_object_t* p_this )
{
aout_instance_t * p_aout = (aout_instance_t*)p_this;
struct aout_sys_t * p_sys = p_aout->output.p_sys;
p_sys->p_status = (snd_pcm_status_t *)malloc(snd_pcm_status_sizeof());
......@@ -784,7 +785,7 @@ static int ALSAThread( aout_instance_t * p_aout )
cleanup:
snd_pcm_drop( p_sys->p_snd_pcm );
free( p_aout->output.p_sys->p_status );
return 0;
return NULL;
}
/*****************************************************************************
......
......@@ -210,7 +210,7 @@ static int InitDirectSound ( aout_instance_t * );
static int CreateDSBuffer ( aout_instance_t *, int, int, int, int, int, bool );
static int CreateDSBufferPCM ( aout_instance_t *, int*, int, int, int, bool );
static void DestroyDSBuffer ( aout_instance_t * );
static void DirectSoundThread ( notification_thread_t * );
static void* DirectSoundThread( vlc_object_t * );
static int FillBuffer ( aout_instance_t *, int, aout_buffer_t * );
/*****************************************************************************
......@@ -1045,8 +1045,9 @@ static int FillBuffer( aout_instance_t *p_aout, int i_frame,
* We use this thread to emulate a callback mechanism. The thread probes for
* event notification and fills up the DS secondary buffer when needed.
*****************************************************************************/
static void DirectSoundThread( notification_thread_t *p_notif )
static void* DirectSoundThread( vlc_object_t *p_this )
{
notification_thread_t *p_notif = (notification_thread_t*)p_this;
aout_instance_t *p_aout = p_notif->p_aout;
bool b_sleek;
mtime_t last_time;
......@@ -1147,4 +1148,5 @@ static void DirectSoundThread( notification_thread_t *p_notif )
CloseHandle( p_notif->event );
msg_Dbg( p_notif, "DirectSoundThread exiting" );
return NULL;
}
......@@ -67,7 +67,7 @@ static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
static void Play ( aout_instance_t * );
static int Thread ( aout_instance_t * );
static void* Thread ( vlc_object_t * );
static void InterleaveS16( int16_t *, int16_t * );
......@@ -216,8 +216,9 @@ static void Play( aout_instance_t * p_aout )
/*****************************************************************************
* Thread: thread used to DMA the data to the device
*****************************************************************************/
static int Thread( aout_instance_t * p_aout )
static void* Thread( vlc_object_t *p_this )
{
aout_instance_t * p_aout = (aout_instance_t*)p_this;
aout_buffer_t * p_buffer;
struct aout_sys_t * p_sys = p_aout->output.p_sys;
PCMAudioPlayer * pPlayer = p_sys->pPlayer;
......@@ -253,7 +254,7 @@ static int Thread( aout_instance_t * p_aout )
#undef i
}
return VLC_SUCCESS;
return NULL;
}
/*****************************************************************************
......
......@@ -93,7 +93,7 @@ static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
static void Play ( aout_instance_t * );
static int OSSThread ( aout_instance_t * );
static void* OSSThread ( vlc_object_t * );
static mtime_t BufferDuration( aout_instance_t * p_aout );
......@@ -585,8 +585,9 @@ static mtime_t BufferDuration( aout_instance_t * p_aout )
/*****************************************************************************
* OSSThread: asynchronous thread used to DMA the data to the device
*****************************************************************************/
static int OSSThread( aout_instance_t * p_aout )
static void* OSSThread( vlc_object_t *p_this )
{
aout_instance_t * p_aout = (aout_instance_t*)p_this;
struct aout_sys_t * p_sys = p_aout->output.p_sys;
mtime_t next_date = 0;
......@@ -689,5 +690,5 @@ static int OSSThread( aout_instance_t * p_aout )
}
}
return VLC_SUCCESS;
return NULL;
}
......@@ -91,7 +91,7 @@ static const uint32_t pi_channels_out[] =
#ifdef PORTAUDIO_IS_SERIOUSLY_BROKEN
static bool b_init = 0;
static pa_thread_t *pa_thread;
static void PORTAUDIOThread( pa_thread_t * );
static void* PORTAUDIOThread( vlc_object_t * );
#endif
/*****************************************************************************
......@@ -572,8 +572,9 @@ static void Play( aout_instance_t * p_aout )
* PORTAUDIOThread: all interactions with libportaudio.a are handled
* in this single thread. Otherwise libportaudio.a is _not_ happy :-(
*****************************************************************************/
static void PORTAUDIOThread( pa_thread_t *pa_thread )
static void* PORTAUDIOThread( vlc_object_t *p_this )
{
pa_thread_t *pa_thread = (pa_thread_t*)p_this;
aout_instance_t *p_aout;
aout_sys_t *p_sys;
int i_err;
......@@ -649,5 +650,6 @@ static void PORTAUDIOThread( pa_thread_t *pa_thread )
vlc_cond_signal( &pa_thread->wait );
vlc_mutex_unlock( &pa_thread->lock_wait );
}
return NULL;
}
#endif
......@@ -130,7 +130,7 @@ static int PlayWaveOut ( aout_instance_t *, HWAVEOUT, WAVEHDR *,
aout_buffer_t *, bool );
static void CALLBACK WaveOutCallback ( HWAVEOUT, UINT, DWORD, DWORD, DWORD );
static void WaveOutThread( notification_thread_t * );
static void* WaveOutThread( vlc_object_t * );
static int VolumeInfos( aout_instance_t *, audio_volume_t * );
static int VolumeGet( aout_instance_t *, audio_volume_t * );
......@@ -969,8 +969,9 @@ static int WaveOutClearDoneBuffers(aout_sys_t *p_sys)
* we are not authorized to use waveOutWrite() directly in the waveout
* callback.
*****************************************************************************/
static void WaveOutThread( notification_thread_t *p_notif )
static void* WaveOutThread( vlc_object_t *p_this )
{
notification_thread_t *p_notif = (notification_thread_t*)p_this;
aout_instance_t *p_aout = p_notif->p_aout;
aout_sys_t *p_sys = p_aout->output.p_sys;
aout_buffer_t *p_buffer = NULL;
......@@ -987,7 +988,7 @@ static void WaveOutThread( notification_thread_t *p_notif )
while( !p_sys->start_date && vlc_object_alive (p_aout) )
WaitForSingleObject( p_sys->event, INFINITE );
if( !vlc_object_alive (p_aout) )
return;
return NULL;
msg_Dbg( p_aout, "will start to play in %"PRId64" us",
(p_sys->start_date - AOUT_PTS_TOLERANCE/4)-mdate());
......@@ -1008,7 +1009,7 @@ static void WaveOutThread( notification_thread_t *p_notif )
/* Cleanup and find out the current latency */
i_queued_frames = WaveOutClearDoneBuffers( p_sys );
if( !vlc_object_alive (p_aout) ) return;
if( !vlc_object_alive (p_aout) ) return NULL;
/* Try to fill in as many frame buffers as possible */
for( i = 0; i < FRAMES_NUM; i++ )
......@@ -1084,7 +1085,7 @@ static void WaveOutThread( notification_thread_t *p_notif )
}
}
if( !vlc_object_alive (p_aout) ) return;
if( !vlc_object_alive (p_aout) ) return NULL;
/*
deal with the case that the loop didn't fillup the buffer to the
......@@ -1105,6 +1106,7 @@ static void WaveOutThread( notification_thread_t *p_notif )
}
#undef waveout_warn
return NULL;
}
static int VolumeInfos( aout_instance_t * p_aout, audio_volume_t * pi_soft )
......
......@@ -69,7 +69,7 @@ static block_t *EncodeVideo( encoder_t *, picture_t * );
static block_t *EncodeAudio( encoder_t *, aout_buffer_t * );
struct thread_context_t;
static int FfmpegThread( struct thread_context_t *p_context );
static void* FfmpegThread( vlc_object_t *p_this );
static int FfmpegExecute( AVCodecContext *s,
int (*pf_func)(AVCodecContext *c2, void *arg2),
void **arg, int *ret, int count );
......@@ -700,8 +700,9 @@ int OpenEncoder( vlc_object_t *p_this )
/****************************************************************************
* Ffmpeg threading system
****************************************************************************/
static int FfmpegThread( struct thread_context_t *p_context )
static void* FfmpegThread( vlc_object_t *p_this )
{
struct thread_context_t *p_context = (struct thread_context_t *)p_this;
while ( vlc_object_alive (p_context) && !p_context->b_error )
{
vlc_mutex_lock( &p_context->lock );
......@@ -726,7 +727,7 @@ static int FfmpegThread( struct thread_context_t *p_context )
vlc_mutex_unlock( &p_context->lock );
}
return 0;
return NULL;
}
static int FfmpegExecute( AVCodecContext *s,
......
......@@ -59,7 +59,7 @@ int OpenAudio ( vlc_object_t *p_this );
void CloseAudio ( vlc_object_t *p_this );
static int GetBufInfo ( aout_instance_t * );
static void Play ( aout_instance_t * );
static int QNXaoutThread ( aout_instance_t * );
static void* QNXaoutThread ( vlc_object_t * );
/*****************************************************************************
* Open : creates a handle and opens an alsa device
......@@ -261,8 +261,9 @@ void CloseAudio ( vlc_object_t *p_this )
/*****************************************************************************
* QNXaoutThread: asynchronous thread used to DMA the data to the device
*****************************************************************************/
static int QNXaoutThread( aout_instance_t * p_aout )
static void* QNXaoutThread( vlc_object_t *p_this )
{
aout_instance_t * p_aout = (aout_instance_t*)p_this;
struct aout_sys_t * p_sys = p_aout->output.p_sys;
while ( vlc_object_alive (p_aout) )
......@@ -320,6 +321,6 @@ static int QNXaoutThread( aout_instance_t * p_aout )
}
}
return 0;
return NULL;
}
......@@ -51,7 +51,7 @@ static void Run ( intf_thread_t * );
static int OpenDialogs( vlc_object_t * );
static void MainLoop ( intf_thread_t * );
static void* MainLoop ( intf_thread_t * );
static void ShowDialog( intf_thread_t *, int, int, intf_dialog_args_t * );
/*****************************************************************************
......@@ -208,8 +208,9 @@ static void Run( intf_thread_t *p_intf )
}
}
static void MainLoop( intf_thread_t *p_intf )
static void* MainLoop( vlc_object_t * p_this )
{
intf_thread_t *p_intf = (intf_thread_t*)p_this;
MSG msg;
Interface *intf = 0;
......@@ -267,6 +268,7 @@ static void MainLoop( intf_thread_t *p_intf )
/* Uninitialize OLE/COM */
CoUninitialize();
#endif
return NULL;
}
/*****************************************************************************
......
......@@ -57,7 +57,7 @@ static void Close ( vlc_object_t * );
static int OpenDialogs ( vlc_object_t * );
static void Run ( intf_thread_t * );
static void Init ( intf_thread_t * );
static void* Init ( vlc_object_t * );
static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * );
......@@ -292,8 +292,9 @@ static void Run( intf_thread_t *p_intf )
}
}
static void Init( intf_thread_t *p_intf )
static void* Init( vlc_object_t * p_this )
{
intf_thread_t *p_intf = (intf_thread_t*)p_this;
#if !defined( WIN32 )
static char *p_args[] = { "" };
int i_args = 1;
......@@ -320,6 +321,7 @@ static void Init( intf_thread_t *p_intf )
#else
wxEntry( i_args, p_args );
#endif
return NULL;
}
/* following functions are local */
......
......@@ -162,9 +162,9 @@ static int KeyEvent( vlc_object_t *p_this, char const *psz_var,
static void stop_osdvnc ( filter_t *p_filter );
static void vnc_worker_thread ( vlc_object_t *p_thread_obj );
static void* vnc_worker_thread ( vlc_object_t *p_thread_obj );
static void update_request_thread( vlc_object_t *p_thread_obj );
static void* update_request_thread( vlc_object_t *p_thread_obj );
static bool open_vnc_connection ( filter_t *p_filter );
......@@ -672,7 +672,7 @@ static bool handshaking ( filter_t *p_filter )
}
static void vnc_worker_thread( vlc_object_t *p_thread_obj )
static void* vnc_worker_thread( vlc_object_t *p_thread_obj )
{
filter_t* p_filter = (filter_t*)(p_thread_obj->p_parent);
filter_sys_t *p_sys = p_filter->p_sys;
......@@ -799,9 +799,10 @@ exit:
vlc_mutex_unlock( &p_sys->lock );
msg_Dbg( p_filter, "VNC message reader thread ended" );
return NULL;
}
static void update_request_thread( vlc_object_t *p_thread_obj )
static void* update_request_thread( vlc_object_t *p_thread_obj )
{
filter_t* p_filter = (filter_t*)(p_thread_obj->p_parent);
filter_sys_t *p_sys = p_filter->p_sys;
......@@ -821,7 +822,7 @@ static void update_request_thread( vlc_object_t *p_thread_obj )
{
msg_Err( p_filter, "Could not write rfbFramebufferUpdateRequestMsg." );
p_sys->b_continue = false;
return;
return NULL;
}
udr.incremental = 1;
......@@ -847,6 +848,7 @@ static void update_request_thread( vlc_object_t *p_thread_obj )
}
msg_Dbg( p_filter, "VNC update request thread ended" );
return NULL;
}
static bool process_server_message ( filter_t *p_filter,
......
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