rtsp thread pool
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)
GstRTSPThread
Structure holding info about a mainloop running in a thread
Members
mini_object
(GstMiniObject)
–
parent GstMiniObject
type
(GstRTSPThreadType)
–
the thread type
context
(GMainContext *)
–
GstRtspServer.RTSPThread
Structure holding info about a mainloop running in a thread
Members
mini_object
(Gst.MiniObject)
–
parent Gst.MiniObject
type
(GstRtspServer.RTSPThreadType)
–
the thread type
GstRtspServer.RTSPThread
Structure holding info about a mainloop running in a thread
Members
mini_object
(Gst.MiniObject)
–
parent Gst.MiniObject
type
(GstRtspServer.RTSPThreadType)
–
the thread type
Constructors
gst_rtsp_thread_new
GstRTSPThread * gst_rtsp_thread_new (GstRTSPThreadType type)
Create a new thread object that can run a mainloop.
Parameters:
type
–
the thread type
GstRtspServer.RTSPThread.prototype.new
function GstRtspServer.RTSPThread.prototype.new(type: GstRtspServer.RTSPThreadType): {
// javascript wrapper for 'gst_rtsp_thread_new'
}
Create a new thread object that can run a mainloop.
Parameters:
the thread type
GstRtspServer.RTSPThread.new
def GstRtspServer.RTSPThread.new (type):
#python wrapper for 'gst_rtsp_thread_new'
Create a new thread object that can run a mainloop.
Parameters:
the thread type
Methods
gst_rtsp_thread_reuse
gboolean gst_rtsp_thread_reuse (GstRTSPThread * thread)
Reuse the mainloop of thread
Parameters:
thread
(
[transfer: none])
–
TRUE if the mainloop could be reused
GstRtspServer.RTSPThread.prototype.reuse
function GstRtspServer.RTSPThread.prototype.reuse(): {
// javascript wrapper for 'gst_rtsp_thread_reuse'
}
Reuse the mainloop of thread
Parameters:
GstRtspServer.RTSPThread.reuse
def GstRtspServer.RTSPThread.reuse (self):
#python wrapper for 'gst_rtsp_thread_reuse'
Reuse the mainloop of thread
Parameters:
gst_rtsp_thread_stop
gst_rtsp_thread_stop (GstRTSPThread * thread)
Stop and unref thread. When no threads are using the mainloop, the thread will be stopped and the final ref to thread will be released.
Parameters:
thread
(
[transfer: full])
–
GstRtspServer.RTSPThread.prototype.stop
function GstRtspServer.RTSPThread.prototype.stop(): {
// javascript wrapper for 'gst_rtsp_thread_stop'
}
Stop and unref thread. When no threads are using the mainloop, the thread will be stopped and the final ref to thread will be released.
Parameters:
GstRtspServer.RTSPThread.stop
def GstRtspServer.RTSPThread.stop (self):
#python wrapper for 'gst_rtsp_thread_stop'
Stop and unref thread. When no threads are using the mainloop, the thread will be stopped and the final ref to thread will be released.
Parameters:
GstRTSPThreadPool
GObject ╰──GstRTSPThreadPool
The thread pool structure.
Members
parent
(GObject)
–
Class structure
GstRTSPThreadPoolClass
Class for managing threads.
Fields
parent_class
(GObjectClass)
–
pool
(GThreadPool *)
–
a GThreadPool used internally
GstRtspServer.RTSPThreadPoolClass
Class for managing threads.
Attributes
parent_class
(GObject.ObjectClass)
–
pool
(GLib.ThreadPool)
–
a GLib.ThreadPool used internally
GstRtspServer.RTSPThreadPoolClass
Class for managing threads.
Attributes
parent_class
(GObject.ObjectClass)
–
pool
(GLib.ThreadPool)
–
a GLib.ThreadPool used internally
GstRtspServer.RTSPThreadPool
GObject.Object ╰──GstRtspServer.RTSPThreadPool
The thread pool structure.
Members
parent
(GObject.Object)
–
GstRtspServer.RTSPThreadPool
GObject.Object ╰──GstRtspServer.RTSPThreadPool
The thread pool structure.
Members
parent
(GObject.Object)
–
Constructors
gst_rtsp_thread_pool_new
GstRTSPThreadPool * gst_rtsp_thread_pool_new ()
Create a new GstRTSPThreadPool instance.
a new GstRTSPThreadPool
GstRtspServer.RTSPThreadPool.prototype.new
function GstRtspServer.RTSPThreadPool.prototype.new(): {
// javascript wrapper for 'gst_rtsp_thread_pool_new'
}
Create a new GstRtspServer.RTSPThreadPool instance.
GstRtspServer.RTSPThreadPool.new
def GstRtspServer.RTSPThreadPool.new ():
#python wrapper for 'gst_rtsp_thread_pool_new'
Create a new GstRtspServer.RTSPThreadPool instance.
Methods
gst_rtsp_thread_pool_get_max_threads
gint gst_rtsp_thread_pool_get_max_threads (GstRTSPThreadPool * pool)
Get the maximum number of threads used for client connections. See gst_rtsp_thread_pool_set_max_threads.
Parameters:
pool
–
the maximum number of threads.
GstRtspServer.RTSPThreadPool.prototype.get_max_threads
function GstRtspServer.RTSPThreadPool.prototype.get_max_threads(): {
// javascript wrapper for 'gst_rtsp_thread_pool_get_max_threads'
}
Get the maximum number of threads used for client connections. See GstRtspServer.RTSPThreadPool.prototype.set_max_threads.
Parameters:
the maximum number of threads.
GstRtspServer.RTSPThreadPool.get_max_threads
def GstRtspServer.RTSPThreadPool.get_max_threads (self):
#python wrapper for 'gst_rtsp_thread_pool_get_max_threads'
Get the maximum number of threads used for client connections. See GstRtspServer.RTSPThreadPool.set_max_threads.
Parameters:
the maximum number of threads.
gst_rtsp_thread_pool_get_thread
GstRTSPThread * gst_rtsp_thread_pool_get_thread (GstRTSPThreadPool * pool, GstRTSPThreadType type, GstRTSPContext * ctx)
Get a new GstRTSPThread for type and ctx.
Parameters:
pool
–
type
–
ctx
(
[transfer: none])
–
a new GstRTSPThread, gst_rtsp_thread_stop after usage
GstRtspServer.RTSPThreadPool.prototype.get_thread
function GstRtspServer.RTSPThreadPool.prototype.get_thread(type: GstRtspServer.RTSPThreadType, ctx: GstRtspServer.RTSPContext): {
// javascript wrapper for 'gst_rtsp_thread_pool_get_thread'
}
Get a new GstRtspServer.RTSPThread for type and ctx.
Parameters:
a new GstRtspServer.RTSPThread, GstRtspServer.RTSPThread.prototype.stop after usage
GstRtspServer.RTSPThreadPool.get_thread
def GstRtspServer.RTSPThreadPool.get_thread (self, type, ctx):
#python wrapper for 'gst_rtsp_thread_pool_get_thread'
Get a new GstRtspServer.RTSPThread for type and ctx.
Parameters:
a new GstRtspServer.RTSPThread, GstRtspServer.RTSPThread.stop after usage
gst_rtsp_thread_pool_set_max_threads
gst_rtsp_thread_pool_set_max_threads (GstRTSPThreadPool * pool, gint max_threads)
Set the maximum threads used by the pool to handle client requests. A value of 0 will use the pool mainloop, a value of -1 will use an unlimited number of threads.
GstRtspServer.RTSPThreadPool.prototype.set_max_threads
function GstRtspServer.RTSPThreadPool.prototype.set_max_threads(max_threads: Number): {
// javascript wrapper for 'gst_rtsp_thread_pool_set_max_threads'
}
Set the maximum threads used by the pool to handle client requests. A value of 0 will use the pool mainloop, a value of -1 will use an unlimited number of threads.
Parameters:
maximum threads
GstRtspServer.RTSPThreadPool.set_max_threads
def GstRtspServer.RTSPThreadPool.set_max_threads (self, max_threads):
#python wrapper for 'gst_rtsp_thread_pool_set_max_threads'
Set the maximum threads used by the pool to handle client requests. A value of 0 will use the pool mainloop, a value of -1 will use an unlimited number of threads.
Parameters:
maximum threads
Functions
gst_rtsp_thread_pool_cleanup
gst_rtsp_thread_pool_cleanup ()
Wait for all tasks to be stopped and free all allocated resources. This is mainly used in test suites to ensure proper cleanup of internal data structures.
GstRtspServer.RTSPThreadPool.prototype.cleanup
function GstRtspServer.RTSPThreadPool.prototype.cleanup(): {
// javascript wrapper for 'gst_rtsp_thread_pool_cleanup'
}
Wait for all tasks to be stopped and free all allocated resources. This is mainly used in test suites to ensure proper cleanup of internal data structures.
GstRtspServer.RTSPThreadPool.cleanup
def GstRtspServer.RTSPThreadPool.cleanup ():
#python wrapper for 'gst_rtsp_thread_pool_cleanup'
Wait for all tasks to be stopped and free all allocated resources. This is mainly used in test suites to ensure proper cleanup of internal data structures.
Properties
Virtual Methods
configure_thread
configure_thread (GstRTSPThreadPool * pool, GstRTSPThread * thread, GstRTSPContext * ctx)
configure a thread object. this vmethod is called when a new thread has been created and should be configured.
Parameters:
pool
–
thread
–
ctx
–
vfunc_configure_thread
function vfunc_configure_thread(pool: GstRtspServer.RTSPThreadPool, thread: GstRtspServer.RTSPThread, ctx: GstRtspServer.RTSPContext): {
// javascript implementation of the 'configure_thread' virtual method
}
configure a thread object. this vmethod is called when a new thread has been created and should be configured.
Parameters:
do_configure_thread
def do_configure_thread (pool, thread, ctx):
#python implementation of the 'configure_thread' virtual method
configure a thread object. this vmethod is called when a new thread has been created and should be configured.
Parameters:
get_thread
GstRTSPThread * get_thread (GstRTSPThreadPool * pool, GstRTSPThreadType type, GstRTSPContext * ctx)
this function should make or reuse an existing thread that runs a mainloop.
Parameters:
pool
–
type
–
ctx
–
vfunc_get_thread
function vfunc_get_thread(pool: GstRtspServer.RTSPThreadPool, type: GstRtspServer.RTSPThreadType, ctx: GstRtspServer.RTSPContext): {
// javascript implementation of the 'get_thread' virtual method
}
this function should make or reuse an existing thread that runs a mainloop.
Parameters:
do_get_thread
def do_get_thread (pool, type, ctx):
#python implementation of the 'get_thread' virtual method
this function should make or reuse an existing thread that runs a mainloop.
Parameters:
thread_enter
thread_enter (GstRTSPThreadPool * pool, GstRTSPThread * thread)
called from the thread when it is entered
Parameters:
pool
–
thread
–
vfunc_thread_enter
function vfunc_thread_enter(pool: GstRtspServer.RTSPThreadPool, thread: GstRtspServer.RTSPThread): {
// javascript implementation of the 'thread_enter' virtual method
}
called from the thread when it is entered
Parameters:
do_thread_enter
def do_thread_enter (pool, thread):
#python implementation of the 'thread_enter' virtual method
called from the thread when it is entered
Parameters:
thread_leave
thread_leave (GstRTSPThreadPool * pool, GstRTSPThread * thread)
called from the thread when it is left
Parameters:
pool
–
thread
–
vfunc_thread_leave
function vfunc_thread_leave(pool: GstRtspServer.RTSPThreadPool, thread: GstRtspServer.RTSPThread): {
// javascript implementation of the 'thread_leave' virtual method
}
called from the thread when it is left
Parameters:
do_thread_leave
def do_thread_leave (pool, thread):
#python implementation of the 'thread_leave' virtual method
called from the thread when it is left
Parameters:
Function Macros
GST_RTSP_THREAD_CAST
#define GST_RTSP_THREAD_CAST(obj) ((GstRTSPThread*)(obj))
GST_RTSP_THREAD_POOL_CAST
#define GST_RTSP_THREAD_POOL_CAST(obj) ((GstRTSPThreadPool*)(obj))
GST_RTSP_THREAD_POOL_CLASS_CAST
#define GST_RTSP_THREAD_POOL_CLASS_CAST(klass) ((GstRTSPThreadPoolClass*)(klass))
Enumerations
GstRTSPThreadType
Different thread types
Members
GST_RTSP_THREAD_TYPE_CLIENT
(0)
–
a thread to handle the client communication
GST_RTSP_THREAD_TYPE_MEDIA
(1)
–
a thread to handle media
GstRtspServer.RTSPThreadType
Different thread types
Members
GstRtspServer.RTSPThreadType.CLIENT
(0)
–
a thread to handle the client communication
GstRtspServer.RTSPThreadType.MEDIA
(1)
–
a thread to handle media
GstRtspServer.RTSPThreadType
Different thread types
Members
GstRtspServer.RTSPThreadType.CLIENT
(0)
–
a thread to handle the client communication
GstRtspServer.RTSPThreadType.MEDIA
(1)
–
a thread to handle media
The results of the search are