thread-pool: add more docs
authorWim Taymans <wim.taymans@collabora.co.uk>
Mon, 15 Jul 2013 13:25:00 +0000 (15:25 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Mon, 15 Jul 2013 13:25:00 +0000 (15:25 +0200)
gst/rtsp-server/rtsp-thread-pool.c
gst/rtsp-server/rtsp-thread-pool.h

index fb0a7a8..b29f20e 100644 (file)
  * @short_description: A pool of threads
  * @see_also: #GstRTSPMedia, #GstRTSPClient
  *
+ * A #GstRTSPThreadPool manages reusable threads for various server tasks.
+ * Currently the defined thread types can be found in #GstRTSPThreadType.
+ *
+ * Threads of type #GST_RTSP_THREAD_TYPE_CLIENT are used to handle requests from
+ * a connected client. With gst_rtsp_thread_pool_get_max_threads() a maximum
+ * number of threads can be set after which the pool will start to reuse the
+ * same thread for multiple clients.
+ *
+ * Threads of type #GST_RTSP_THREAD_TYPE_MEDIA will be used to perform the state
+ * changes of the media pipelines and handle its bus messages.
+ *
+ * gst_rtsp_thread_pool_get_thread() can be used to create a #GstRTSPThread
+ * object of the right type. The thread object contains a mainloop and context
+ * that run in a seperate thread and can be used to attached sources to.
+ *
+ * gst_rtsp_thread_reuse() can be used to reuse a thread for multiple purposes.
+ * If all gst_rtsp_thread_reuse() calls are matched with a
+ * gst_rtsp_thread_stop() call, the mainloop will be quit and the thread will
+ * stop.
+ *
+ * To configure the threads, a subclass of this object should be made and the
+ * virtual methods should be overriden to implement the desired functionality.
+ *
  * Last reviewed on 2013-07-11 (1.0.0)
  */
 
index 1c6fb5d..74f9e07 100644 (file)
@@ -132,8 +132,10 @@ struct _GstRTSPThreadPool {
 /**
  * GstRTSPThreadPoolClass:
  * @pool: a #GThreadPool used internally
- * @get_thread: get or reuse a thread object
- * @configure_thread: configure a thread object
+ * @get_thread: this function should make or reuse an existing thread that runs
+ *        a mainloop.
+ * @configure_thread: configure a thread object. this vmethod is called when
+ *       a new thread has been created and should be configured.
  * @thread_enter: called from the thread when it is entered
  * @thread_leave: called from the thread when it is left
  *