]> git.sesse.net Git - vlc/commitdiff
Use the right declaration for threaded functions.
authorRémi Duraffort <ivoire@videolan.org>
Mon, 11 Aug 2008 17:52:45 +0000 (19:52 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Mon, 11 Aug 2008 19:40:14 +0000 (21:40 +0200)
modules/access/dv.c
modules/access/dvdnav.c
modules/access/mms/mmstu.c
modules/access/rtmp/access.c
modules/access_filter/timeshift.c
modules/misc/freetype.c
modules/misc/gtk_main.c
modules/misc/qte_main.cpp
modules/misc/rtsp.c
modules/stream_out/rtp.c
modules/stream_out/transcode.c

index 8af02c6f5c220fe95905f1e946b95e291cec7193..570ec5ed76a223eb818d7d5b96aee3d1ad8a50ab 100644 (file)
@@ -97,7 +97,7 @@ typedef struct
 
 } event_thread_t;
 
-static int Raw1394EventThread( vlc_object_t * );
+static void* Raw1394EventThread( vlc_object_t * );
 static int Raw1394Handler( raw1394handle_t, int, size_t, quadlet_t * );
 
 static int Raw1394GetNumPorts( access_t *p_access );
@@ -357,7 +357,7 @@ static block_t *Block( access_t *p_access )
     return p_block;
 }
 
-static int Raw1394EventThread( vlc_object_t *p_this )
+static void* Raw1394EventThread( vlc_object_t *p_this )
 {
     event_thread_t *p_ev = (event_thread_t *) p_this;
     access_t *p_access = (access_t *) p_ev->p_access;
@@ -386,7 +386,7 @@ static int Raw1394EventThread( vlc_object_t *p_this )
     }
 
     AVCStop( p_access, p_sys->i_node );
-    return VLC_SUCCESS;
+    return NULL;
 }
 
 static int Raw1394Handler( raw1394handle_t handle, int channel, size_t length, quadlet_t *data )
index 99644665da29c6d53c01fabd7ad39439675e5c00..5520d5ad467bfbd95ddce4ebbf5560574ca1cf3d 100644 (file)
@@ -122,7 +122,7 @@ typedef struct
 
 } event_thread_t;
 
-static int EventThread( vlc_object_t * );
+static void* EventThread( vlc_object_t * );
 
 struct demux_sys_t
 {
@@ -1221,7 +1221,7 @@ static int  EventMouse( vlc_object_t *, char const *,
 static int  EventKey  ( vlc_object_t *, char const *,
                         vlc_value_t, vlc_value_t, void * );
 
-static int EventThread( vlc_object_t *p_this )
+static void* EventThread( vlc_object_t *p_this )
 {
     event_thread_t *p_ev = (event_thread_t*)p_this;
     demux_sys_t    *p_sys = p_ev->p_demux->p_sys;
@@ -1346,7 +1346,7 @@ static int EventThread( vlc_object_t *p_this )
 
     vlc_mutex_destroy( &p_ev->lock );
 
-    return VLC_SUCCESS;
+    return NULL;
 }
 
 static int EventMouse( vlc_object_t *p_this, char const *psz_var,
index 69beb8f45b6eb25e21413cac537c5d6138c47944..8211250246ff80a8eb7c3094d78c7d46febf1db4 100644 (file)
@@ -92,7 +92,7 @@ static int  mms_HeaderMediaRead( access_t *, int );
 
 static int  mms_ReceivePacket( access_t * );
 
-static void KeepAliveThread( vlc_object_t *p_this );
+static void* KeepAliveThread( vlc_object_t *p_this );
 
 int  MMSTUOpen( access_t *p_access )
 {
@@ -1599,7 +1599,7 @@ static int mms_HeaderMediaRead( access_t *p_access, int i_type )
     return -1;
 }
 
-static void KeepAliveThread( vlc_object_t *p_this )
+static void* KeepAliveThread( vlc_object_t *p_this )
 {
     mmstu_keepalive_thread_t *p_thread = (mmstu_keepalive_thread_t *) p_this;
     access_t *p_access = p_thread->p_access;
@@ -1618,4 +1618,5 @@ static void KeepAliveThread( vlc_object_t *p_this )
         vlc_object_timedwait( p_thread, mdate() + 10000000 );
     }
     vlc_object_unlock( p_thread );
+    return NULL;
 }
index 0d3ad022f08ef1cd50b8eb0e47f1c2845c2a04e0..2c0b3238ea648a287d6abc01e995c78347abeff5 100644 (file)
@@ -70,7 +70,7 @@ static ssize_t  Read( access_t *, uint8_t *, size_t );
 static int Seek( access_t *, int64_t );
 static int Control( access_t *, int, va_list );
 
-static void ThreadControl( vlc_object_t * );
+static void* ThreadControl( vlc_object_t * );
 
 /*****************************************************************************
  * Open: open the rtmp connection
@@ -503,7 +503,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
 /*****************************************************************************
  * 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;
@@ -543,4 +543,5 @@ static void ThreadControl( vlc_object_t *p_this )
             block_FifoWake( p_thread->p_fifo_input );
         }
     }
+    return NULL;
 }
index b01cc1c649e54e8e7e1b661edec8e9a2e57a1ec9..ef977bc0d69ac5b70006565a255fd717b477d7f9 100644 (file)
@@ -85,7 +85,7 @@ vlc_module_end();
 static int      Seek( access_t *, int64_t );
 static block_t *Block  ( access_t *p_access );
 static int      Control( access_t *, int i_query, va_list args );
-static void     Thread ( access_t *p_access );
+static void*    Thread ( vlc_object_t *p_this );
 static int      WriteBlockToFile( access_t *p_access, block_t *p_block );
 static block_t *ReadBlockFromFile( access_t *p_access );
 static char    *GetTmpFilePath( access_t *p_access );
@@ -269,8 +269,9 @@ static block_t *Block( access_t *p_access )
 /*****************************************************************************
  *
  *****************************************************************************/
-static void Thread( access_t *p_access )
+static void* Thread( vlc_object_t* p_this )
 {
+    access_t *p_access = (access_t*)p_this;
     access_sys_t *p_sys = p_access->p_sys;
     access_t     *p_src = p_access->p_source;
     block_t      *p_block;
@@ -352,6 +353,7 @@ static void Thread( access_t *p_access )
 
     /* Send dummy packet to avoid deadlock in Block() */
     block_FifoPut( p_sys->p_fifo, block_New( p_access, 0 ) );
+    return NULL;
 }
 
 /*****************************************************************************
index 7b7de54bdca90c33a236ac71dc9bdd585161ed2d..ec6dadf6457ce82b17df1a3acd7f685944f09307 100644 (file)
@@ -244,10 +244,10 @@ static void FreeLine( line_desc_t * );
 
 #ifdef HAVE_FONTCONFIG
 static vlc_object_t *FontBuilderAttach( filter_t *p_filter, vlc_mutex_t **pp_lock  );
-static void FontBuilderDetach( filter_t *p_filter, vlc_object_t *p_fontbuilder );
-static void FontBuilderThread( vlc_object_t *p_this);
-static void FontBuilderDestructor( vlc_object_t *p_this );
-static int FontBuilderDone( vlc_object_t*, const char *, vlc_value_t, vlc_value_t,
+static void  FontBuilderDetach( filter_t *p_filter, vlc_object_t *p_fontbuilder );
+static void* FontBuilderThread( vlc_object_t *p_this);
+static void  FontBuilderDestructor( vlc_object_t *p_this );
+static int   FontBuilderDone( vlc_object_t*, const char *, vlc_value_t, vlc_value_t,
                         void* );
 #endif
 
@@ -515,7 +515,7 @@ static void FontBuilderDetach( filter_t *p_filter, vlc_object_t *p_fontbuilder )
     }
     vlc_mutex_unlock( lock );
 }
-static void FontBuilderThread( vlc_object_t *p_this )
+static void* FontBuilderThread( vlc_object_t *p_this )
 {
     FcConfig      *p_fontconfig = FcInitLoadConfig();
 
@@ -548,6 +548,7 @@ static void FontBuilderThread( vlc_object_t *p_this )
 
         var_SetBool( p_this, "build-done", true );
     }
+    return NULL;
 }
 static void FontBuilderDestructor( vlc_object_t *p_this )
 {
index c5b0d98069411954353fa0500ad4620ed59ffc70..7834352beb8c5bfe894722e9c7db39421e1a1df7 100644 (file)
@@ -48,7 +48,7 @@
 static int  Open    ( vlc_object_t * );
 static void Close   ( vlc_object_t * );
 
-static void GtkMain ( vlc_object_t * );
+static void* GtkMain ( vlc_object_t * );
 
 /*****************************************************************************
  * Local variables (mutex-protected).
@@ -158,7 +158,7 @@ static gint foo( gpointer bar ) { return TRUE; }
  * this part of the interface is in a separate thread so that we can call
  * gtk_main() from within it without annoying the rest of the program.
  *****************************************************************************/
-static void GtkMain( vlc_object_t *p_this )
+static void* GtkMain( vlc_object_t *p_this )
 {
     /* gtk_init needs to know the command line. We don't care, so we
      * give it an empty one */
@@ -197,4 +197,5 @@ static void GtkMain( vlc_object_t *p_this )
     gtk_main();
 
     gdk_threads_leave();
+    return NULL;
 }
index ea9510523145445c0e3351b88397faab982ffa4d..696290ae47a93553410d1c8c2564a949aa62ebcf 100644 (file)
@@ -56,7 +56,7 @@ typedef struct qte_thread_t
 static int  Open    ( vlc_object_t * );
 static void Close   ( vlc_object_t * );
 
-static void QteMain ( qte_thread_t * );
+static void* QteMain( vlc_object_t * );
 
 /*****************************************************************************
  * Local variables (mutex-protected).
@@ -158,8 +158,9 @@ static void Close( vlc_object_t *p_this )
  * this part of the interface is in a separate thread so that we can call
  * qte_main() from within it without annoying the rest of the program.
  *****************************************************************************/
-static void QteMain( qte_thread_t *p_this )
+static void* QteMain( vlc_object_t* p_vlc_obj )
 {
+    qte_thread_t *p_this = (qte_thread_t*)p_vlc_obj;
     int i_argc = 1;
 
     p_this->b_gui_server = false;
@@ -189,4 +190,6 @@ static void QteMain( qte_thread_t *p_this )
 
     vlc_thread_ready( p_this );
     p_this->p_qte_application->exec();
+
+    return NULL;
 }
index 10708f7ea1752e658f14f518f727dd80d5f4f63f..ca1b299e1717e0c853d187a8dd44a87ecc42428a 100644 (file)
@@ -226,9 +226,9 @@ static void         MediaDel( vod_t *, vod_media_t * );
 static int          MediaAddES( vod_t *, vod_media_t *, es_format_t * );
 static void         MediaDelES( vod_t *, vod_media_t *, es_format_t * );
 
-static void CommandThread( vlc_object_t *p_this );
-static void CommandPush( vod_t *, rtsp_cmd_type_t, vod_media_t *, const char *psz_session,
-                         double f_arg, const char *psz_arg );
+static void* CommandThread( vlc_object_t *p_this );
+static void  CommandPush( vod_t *, rtsp_cmd_type_t, vod_media_t *, const char *psz_session,
+                          double f_arg, const char *psz_arg );
 
 static rtsp_client_t *RtspClientNew( vod_media_t *, char * );
 static rtsp_client_t *RtspClientGet( vod_media_t *, const char * );
@@ -801,7 +801,7 @@ static void CommandPush( vod_t *p_vod, rtsp_cmd_type_t i_type, vod_media_t *p_me
     block_FifoPut( p_vod->p_sys->p_fifo_cmd, p_cmd );
 }
 
-static void CommandThread( vlc_object_t *p_this )
+static void* CommandThread( vlc_object_t *p_this )
 {
     vod_t *p_vod = (vod_t*)p_this;
     vod_sys_t *p_sys = p_vod->p_sys;
@@ -872,6 +872,7 @@ static void CommandThread( vlc_object_t *p_this )
         free( cmd.psz_session );
         free( cmd.psz_arg );
     }
+    return NULL;
 }
 
 /****************************************************************************
index fb79a6881801efd34feb9e7338aa63b2e4cc85f1..c3e8dde7e353bd7b8345dc103514a2d32db62d0e 100644 (file)
@@ -232,7 +232,7 @@ static int               MuxSend( sout_stream_t *, sout_stream_id_t *,
                                   block_t* );
 
 static sout_access_out_t *GrabberCreate( sout_stream_t *p_sout );
-static void ThreadSend( vlc_object_t *p_this );
+static void* ThreadSend( vlc_object_t *p_this );
 
 static void SDPHandleUrl( sout_stream_t *, const char * );
 
@@ -1429,7 +1429,7 @@ static int  HttpCallback( httpd_file_sys_t *p_args,
 /****************************************************************************
  * RTP send
  ****************************************************************************/
-static void ThreadSend( vlc_object_t *p_this )
+static void* ThreadSend( vlc_object_t *p_this )
 {
     sout_stream_id_t *id = (sout_stream_id_t *)p_this;
     unsigned i_caching = id->i_caching;
@@ -1498,6 +1498,7 @@ static void ThreadSend( vlc_object_t *p_this )
             rtp_add_sink( id, fd, true );
         }
     }
+    return NULL;
 }
 
 int rtp_add_sink( sout_stream_id_t *id, int fd, bool rtcp_mux )
index 79f6a4ca7a92567b5fdf4635a43a11f465d7ba48..7f298e2acf869dcd23909ba8576a62af59e14910 100644 (file)
@@ -285,7 +285,7 @@ static void transcode_osd_close  ( sout_stream_t *, sout_stream_id_t * );
 static int  transcode_osd_process( sout_stream_t *, sout_stream_id_t *,
                                    block_t *, block_t ** );
 
-static int  EncoderThread( struct sout_stream_sys_t * p_sys );
+static void* EncoderThread( vlc_object_t * p_this );
 
 static const int pi_channels_maps[6] =
 {
@@ -2078,8 +2078,9 @@ static int transcode_video_process( sout_stream_t *p_stream,
     return VLC_SUCCESS;
 }
 
-static int EncoderThread( sout_stream_sys_t *p_sys )
+static void* EncoderThread( vlc_object_t* p_this )
 {
+    sout_stream_sys_t *p_sys = (sout_stream_sys_t*)p_this;
     sout_stream_id_t *id = p_sys->id_video;
     picture_t *p_pic;
 
@@ -2122,7 +2123,7 @@ static int EncoderThread( sout_stream_sys_t *p_sys )
     }
     block_ChainRelease( p_sys->p_buffers );
 
-    return 0;
+    return NULL;
 }
 
 struct picture_sys_t