rtsp session pool

The GstRTSPSessionPool object manages a list of GstRTSPSession objects.

The maximum number of sessions can be configured with gst_rtsp_session_pool_set_max_sessions. The current number of sessions can be retrieved with gst_rtsp_session_pool_get_n_sessions.

Use gst_rtsp_session_pool_create to create a new GstRTSPSession object. The session object can be found again with its id and gst_rtsp_session_pool_find.

All sessions can be iterated with gst_rtsp_session_pool_filter.

Run gst_rtsp_session_pool_cleanup periodically to remove timed out sessions or use gst_rtsp_session_pool_create_watch to be notified when session cleanup should be performed.

Last reviewed on 2013-07-11 (1.0.0)

GstRTSPSessionPool

GObject
    ╰──GstRTSPSessionPool

An object that keeps track of the active sessions. This object is usually attached to a GstRTSPServer object to manage the sessions in that server.

Members

parent (GObject) –
No description available

Class structure

GstRTSPSessionPoolClass

Fields
parent_class (GObjectClass) –
No description available

GstRtspServer.RTSPSessionPoolClass

Attributes
parent_class (GObject.ObjectClass) –
No description available

GstRtspServer.RTSPSessionPoolClass

Attributes
parent_class (GObject.ObjectClass) –
No description available

GstRtspServer.RTSPSessionPool

GObject.Object
    ╰──GstRtspServer.RTSPSessionPool

An object that keeps track of the active sessions. This object is usually attached to a GstRtspServer.RTSPServer object to manage the sessions in that server.

Members

parent (GObject.Object) –
No description available

GstRtspServer.RTSPSessionPool

GObject.Object
    ╰──GstRtspServer.RTSPSessionPool

An object that keeps track of the active sessions. This object is usually attached to a GstRtspServer.RTSPServer object to manage the sessions in that server.

Members

parent (GObject.Object) –
No description available

Constructors

gst_rtsp_session_pool_new

GstRTSPSessionPool *
gst_rtsp_session_pool_new ()

Create a new GstRTSPSessionPool instance.

Returns ( [transfer: full])

A new GstRTSPSessionPool. g_object_unref after usage.


GstRtspServer.RTSPSessionPool.prototype.new

function GstRtspServer.RTSPSessionPool.prototype.new(): {
    // javascript wrapper for 'gst_rtsp_session_pool_new'
}

Create a new GstRtspServer.RTSPSessionPool instance.


GstRtspServer.RTSPSessionPool.new

def GstRtspServer.RTSPSessionPool.new ():
    #python wrapper for 'gst_rtsp_session_pool_new'

Create a new GstRtspServer.RTSPSessionPool instance.


Methods

gst_rtsp_session_pool_cleanup

guint
gst_rtsp_session_pool_cleanup (GstRTSPSessionPool * pool)

Inspect all the sessions in pool and remove the sessions that are inactive for more than their timeout.

Parameters:

pool

a GstRTSPSessionPool

Returns

the amount of sessions that got removed.


GstRtspServer.RTSPSessionPool.prototype.cleanup

function GstRtspServer.RTSPSessionPool.prototype.cleanup(): {
    // javascript wrapper for 'gst_rtsp_session_pool_cleanup'
}

Inspect all the sessions in pool and remove the sessions that are inactive for more than their timeout.

Returns (Number)

the amount of sessions that got removed.


GstRtspServer.RTSPSessionPool.cleanup

def GstRtspServer.RTSPSessionPool.cleanup (self):
    #python wrapper for 'gst_rtsp_session_pool_cleanup'

Inspect all the sessions in pool and remove the sessions that are inactive for more than their timeout.

Returns (int)

the amount of sessions that got removed.


gst_rtsp_session_pool_create

GstRTSPSession *
gst_rtsp_session_pool_create (GstRTSPSessionPool * pool)

Create a new GstRTSPSession object in pool.

Parameters:

pool

a GstRTSPSessionPool

Returns ( [transfer: full][nullable])

a new GstRTSPSession.


GstRtspServer.RTSPSessionPool.prototype.create

function GstRtspServer.RTSPSessionPool.prototype.create(): {
    // javascript wrapper for 'gst_rtsp_session_pool_create'
}

Create a new GstRtspServer.RTSPSession object in pool.


GstRtspServer.RTSPSessionPool.create

def GstRtspServer.RTSPSessionPool.create (self):
    #python wrapper for 'gst_rtsp_session_pool_create'

Create a new GstRtspServer.RTSPSession object in pool.


gst_rtsp_session_pool_create_watch

GSource *
gst_rtsp_session_pool_create_watch (GstRTSPSessionPool * pool)

Create a GSource that will be dispatched when the session should be cleaned up.

Parameters:

pool

a GstRTSPSessionPool

Returns ( [transfer: full])

a GSource


GstRtspServer.RTSPSessionPool.prototype.create_watch

function GstRtspServer.RTSPSessionPool.prototype.create_watch(): {
    // javascript wrapper for 'gst_rtsp_session_pool_create_watch'
}

Create a GSource (not introspectable) that will be dispatched when the session should be cleaned up.


GstRtspServer.RTSPSessionPool.create_watch

def GstRtspServer.RTSPSessionPool.create_watch (self):
    #python wrapper for 'gst_rtsp_session_pool_create_watch'

Create a GSource (not introspectable) that will be dispatched when the session should be cleaned up.


gst_rtsp_session_pool_filter

GList *
gst_rtsp_session_pool_filter (GstRTSPSessionPool * pool,
                              GstRTSPSessionPoolFilterFunc func,
                              gpointer user_data)

Call func for each session in pool. The result value of func determines what happens to the session. func will be called with the session pool locked so no further actions on pool can be performed from func.

If func returns GST_RTSP_FILTER_REMOVE, the session will be set to the expired state and removed from pool.

If func returns GST_RTSP_FILTER_KEEP, the session will remain in pool.

If func returns GST_RTSP_FILTER_REF, the session will remain in pool but will also be added with an additional ref to the result GList of this function..

When func is NULL, GST_RTSP_FILTER_REF will be assumed for all sessions.

Parameters:

pool

a GstRTSPSessionPool

func ( [scope call][allow-none][closure])

a callback

user_data

user data passed to func

Returns ( [element-typeGstRTSPSession][transfer: full])

a GList with all sessions for which func returned GST_RTSP_FILTER_REF. After usage, each element in the GList should be unreffed before the list is freed.


GstRtspServer.RTSPSessionPool.prototype.filter

function GstRtspServer.RTSPSessionPool.prototype.filter(func: GstRtspServer.RTSPSessionPoolFilterFunc, user_data: Object): {
    // javascript wrapper for 'gst_rtsp_session_pool_filter'
}

Call func for each session in pool. The result value of func determines what happens to the session. func will be called with the session pool locked so no further actions on pool can be performed from func.

If func returns GstRtspServer.RTSPFilterResult.REMOVE, the session will be set to the expired state and removed from pool.

If func returns GstRtspServer.RTSPFilterResult.KEEP, the session will remain in pool.

If func returns GstRtspServer.RTSPFilterResult.REF, the session will remain in pool but will also be added with an additional ref to the result GList of this function..

When func is null, GstRtspServer.RTSPFilterResult.REF will be assumed for all sessions.

Parameters:

user_data (Object)

user data passed to func

Returns ([ GstRtspServer.RTSPSession ])

a GList with all sessions for which func returned GstRtspServer.RTSPFilterResult.REF. After usage, each element in the GList should be unreffed before the list is freed.


GstRtspServer.RTSPSessionPool.filter

def GstRtspServer.RTSPSessionPool.filter (self, func, *user_data):
    #python wrapper for 'gst_rtsp_session_pool_filter'

Call func for each session in pool. The result value of func determines what happens to the session. func will be called with the session pool locked so no further actions on pool can be performed from func.

If func returns GstRtspServer.RTSPFilterResult.REMOVE, the session will be set to the expired state and removed from pool.

If func returns GstRtspServer.RTSPFilterResult.KEEP, the session will remain in pool.

If func returns GstRtspServer.RTSPFilterResult.REF, the session will remain in pool but will also be added with an additional ref to the result GList of this function..

When func is None, GstRtspServer.RTSPFilterResult.REF will be assumed for all sessions.

Parameters:

user_data (variadic)

user data passed to func

Returns ([ GstRtspServer.RTSPSession ])

a GList with all sessions for which func returned GstRtspServer.RTSPFilterResult.REF. After usage, each element in the GList should be unreffed before the list is freed.


gst_rtsp_session_pool_find

GstRTSPSession *
gst_rtsp_session_pool_find (GstRTSPSessionPool * pool,
                            const gchar * sessionid)

Find the session with sessionid in pool. The access time of the session will be updated with gst_rtsp_session_touch.

Parameters:

pool

the pool to search

sessionid

the session id

Returns ( [transfer: full][nullable])

the GstRTSPSession with sessionid or NULL when the session did not exist. g_object_unref after usage.


GstRtspServer.RTSPSessionPool.prototype.find

function GstRtspServer.RTSPSessionPool.prototype.find(sessionid: String): {
    // javascript wrapper for 'gst_rtsp_session_pool_find'
}

Find the session with sessionid in pool. The access time of the session will be updated with GstRtspServer.RTSPSession.prototype.touch.

Parameters:

the pool to search

sessionid (String)

the session id

the GstRtspServer.RTSPSession with sessionid or null when the session did not exist. GObject.Object.prototype.unref after usage.


GstRtspServer.RTSPSessionPool.find

def GstRtspServer.RTSPSessionPool.find (self, sessionid):
    #python wrapper for 'gst_rtsp_session_pool_find'

Find the session with sessionid in pool. The access time of the session will be updated with GstRtspServer.RTSPSession.touch.

Parameters:

the pool to search

sessionid (str)

the session id

the GstRtspServer.RTSPSession with sessionid or None when the session did not exist. GObject.Object.unref after usage.


gst_rtsp_session_pool_get_max_sessions

guint
gst_rtsp_session_pool_get_max_sessions (GstRTSPSessionPool * pool)

Get the maximum allowed number of sessions in pool. 0 means an unlimited amount of sessions.

Parameters:

pool

a GstRTSPSessionPool

Returns

the maximum allowed number of sessions.


GstRtspServer.RTSPSessionPool.prototype.get_max_sessions

function GstRtspServer.RTSPSessionPool.prototype.get_max_sessions(): {
    // javascript wrapper for 'gst_rtsp_session_pool_get_max_sessions'
}

Get the maximum allowed number of sessions in pool. 0 means an unlimited amount of sessions.

Returns (Number)

the maximum allowed number of sessions.


GstRtspServer.RTSPSessionPool.get_max_sessions

def GstRtspServer.RTSPSessionPool.get_max_sessions (self):
    #python wrapper for 'gst_rtsp_session_pool_get_max_sessions'

Get the maximum allowed number of sessions in pool. 0 means an unlimited amount of sessions.

Returns (int)

the maximum allowed number of sessions.


gst_rtsp_session_pool_get_n_sessions

guint
gst_rtsp_session_pool_get_n_sessions (GstRTSPSessionPool * pool)

Get the amount of active sessions in pool.

Parameters:

pool

a GstRTSPSessionPool

Returns

the amount of active sessions in pool.


GstRtspServer.RTSPSessionPool.prototype.get_n_sessions

function GstRtspServer.RTSPSessionPool.prototype.get_n_sessions(): {
    // javascript wrapper for 'gst_rtsp_session_pool_get_n_sessions'
}

Get the amount of active sessions in pool.

Returns (Number)

the amount of active sessions in pool.


GstRtspServer.RTSPSessionPool.get_n_sessions

def GstRtspServer.RTSPSessionPool.get_n_sessions (self):
    #python wrapper for 'gst_rtsp_session_pool_get_n_sessions'

Get the amount of active sessions in pool.

Returns (int)

the amount of active sessions in pool.


gst_rtsp_session_pool_remove

gboolean
gst_rtsp_session_pool_remove (GstRTSPSessionPool * pool,
                              GstRTSPSession * sess)

Remove sess from pool, releasing the ref that the pool has on sess.

Parameters:

pool

a GstRTSPSessionPool

sess ( [transfer: none])

a GstRTSPSession

Returns

TRUE if the session was found and removed.


GstRtspServer.RTSPSessionPool.prototype.remove

function GstRtspServer.RTSPSessionPool.prototype.remove(sess: GstRtspServer.RTSPSession): {
    // javascript wrapper for 'gst_rtsp_session_pool_remove'
}

Remove sess from pool, releasing the ref that the pool has on sess.

Returns (Number)

true if the session was found and removed.


GstRtspServer.RTSPSessionPool.remove

def GstRtspServer.RTSPSessionPool.remove (self, sess):
    #python wrapper for 'gst_rtsp_session_pool_remove'

Remove sess from pool, releasing the ref that the pool has on sess.

Returns (bool)

True if the session was found and removed.


gst_rtsp_session_pool_set_max_sessions

gst_rtsp_session_pool_set_max_sessions (GstRTSPSessionPool * pool,
                                        guint max)

Configure the maximum allowed number of sessions in pool to max. A value of 0 means an unlimited amount of sessions.

Parameters:

pool

a GstRTSPSessionPool

max

the maximum number of sessions


GstRtspServer.RTSPSessionPool.prototype.set_max_sessions

function GstRtspServer.RTSPSessionPool.prototype.set_max_sessions(max: Number): {
    // javascript wrapper for 'gst_rtsp_session_pool_set_max_sessions'
}

Configure the maximum allowed number of sessions in pool to max. A value of 0 means an unlimited amount of sessions.

Parameters:

max (Number)

the maximum number of sessions


GstRtspServer.RTSPSessionPool.set_max_sessions

def GstRtspServer.RTSPSessionPool.set_max_sessions (self, max):
    #python wrapper for 'gst_rtsp_session_pool_set_max_sessions'

Configure the maximum allowed number of sessions in pool to max. A value of 0 means an unlimited amount of sessions.

Parameters:

max (int)

the maximum number of sessions


Signals

session-removed

session_removed_callback (GstRTSPSessionPool * self,
                          GstRTSPSession * object,
                          gpointer user_data)

Parameters:

self
No description available
object
No description available
user_data
No description available

Flags: Run Last


session-removed

function session_removed_callback(self: GstRtspServer.RTSPSessionPool, object: GstRtspServer.RTSPSession, user_data: Object): {
    // javascript callback for the 'session-removed' signal
}

Parameters:

No description available
No description available
user_data (Object)
No description available

Flags: Run Last


session-removed

def session_removed_callback (self, object, *user_data):
    #python callback for the 'session-removed' signal

Parameters:

No description available
No description available
user_data (variadic)
No description available

Flags: Run Last


Properties

max-sessions

“max-sessions” guint

Flags : Read / Write


max-sessions

“max-sessions” Number

Flags : Read / Write


max_sessions

“self.props.max_sessions” int

Flags : Read / Write


Virtual Methods

create_session

GstRTSPSession *
create_session (GstRTSPSessionPool * pool,
                const gchar * id)

make a new session object.

Parameters:

pool
No description available
id
No description available
Returns
No description available

create_session_id

gchar *
create_session_id (GstRTSPSessionPool * pool)

create a new random session id. Subclasses can create custom session ids and should not check if the session exists.

Parameters:

pool
No description available
Returns
No description available

vfunc_create_session_id

function vfunc_create_session_id(pool: GstRtspServer.RTSPSessionPool): {
    // javascript implementation of the 'create_session_id' virtual method
}

create a new random session id. Subclasses can create custom session ids and should not check if the session exists.

Parameters:

No description available
Returns (String)
No description available

do_create_session_id

def do_create_session_id (pool):
    #python implementation of the 'create_session_id' virtual method

create a new random session id. Subclasses can create custom session ids and should not check if the session exists.

Parameters:

No description available
Returns (str)
No description available

session_removed

session_removed (GstRTSPSessionPool * pool,
                 GstRTSPSession * session)

a session was removed from the pool

Parameters:

pool
No description available
session
No description available

vfunc_session_removed

function vfunc_session_removed(pool: GstRtspServer.RTSPSessionPool, session: GstRtspServer.RTSPSession): {
    // javascript implementation of the 'session_removed' virtual method
}

a session was removed from the pool

Parameters:

No description available
No description available

do_session_removed

def do_session_removed (pool, session):
    #python implementation of the 'session_removed' virtual method

a session was removed from the pool

Parameters:

No description available
No description available

Function Macros

GST_RTSP_SESSION_POOL_CAST

#define GST_RTSP_SESSION_POOL_CAST(obj)         ((GstRTSPSessionPool*)(obj))

GST_RTSP_SESSION_POOL_CLASS_CAST

#define GST_RTSP_SESSION_POOL_CLASS_CAST(klass) ((GstRTSPSessionPoolClass*)(klass))

Callbacks

GstRTSPSessionPoolFilterFunc

GstRTSPFilterResult
(*GstRTSPSessionPoolFilterFunc) (GstRTSPSessionPool * pool,
                                 GstRTSPSession * session,
                                 gpointer user_data)

This function will be called by the gst_rtsp_session_pool_filter. An implementation should return a value of GstRTSPFilterResult.

When this function returns GST_RTSP_FILTER_REMOVE, session will be removed from pool.

A return value of GST_RTSP_FILTER_KEEP will leave session untouched in pool.

A value of GST_RTSP_FILTER_REF will add session to the result GList of gst_rtsp_session_pool_filter.

Parameters:

pool

a GstRTSPSessionPool object

session

a GstRTSPSession in pool

user_data

user data that has been given to gst_rtsp_session_pool_filter

Returns

a GstRTSPFilterResult.


GstRtspServer.RTSPSessionPoolFilterFunc

function GstRtspServer.RTSPSessionPoolFilterFunc(pool: GstRtspServer.RTSPSessionPool, session: GstRtspServer.RTSPSession, user_data: Object): {
    // javascript wrapper for 'GstRTSPSessionPoolFilterFunc'
}

This function will be called by the GstRtspServer.RTSPSessionPool.prototype.filter. An implementation should return a value of GstRtspServer.RTSPFilterResult.

When this function returns GstRtspServer.RTSPFilterResult.REMOVE, session will be removed from pool.

A return value of GstRtspServer.RTSPFilterResult.KEEP will leave session untouched in pool.

A value of GST_RTSP_FILTER_REF will add session to the result GLib.List of GstRtspServer.RTSPSessionPool.prototype.filter.

Parameters:

user_data (Object)

user data that has been given to GstRtspServer.RTSPSessionPool.prototype.filter


GstRtspServer.RTSPSessionPoolFilterFunc

def GstRtspServer.RTSPSessionPoolFilterFunc (pool, session, *user_data):
    #python wrapper for 'GstRTSPSessionPoolFilterFunc'

This function will be called by the GstRtspServer.RTSPSessionPool.filter. An implementation should return a value of GstRtspServer.RTSPFilterResult.

When this function returns GstRtspServer.RTSPFilterResult.REMOVE, session will be removed from pool.

A return value of GstRtspServer.RTSPFilterResult.KEEP will leave session untouched in pool.

A value of GST_RTSP_FILTER_REF will add session to the result GLib.List of GstRtspServer.RTSPSessionPool.filter.

Parameters:

user_data (variadic)

user data that has been given to GstRtspServer.RTSPSessionPool.filter


GstRTSPSessionPoolFunc

gboolean
(*GstRTSPSessionPoolFunc) (GstRTSPSessionPool * pool,
                           gpointer user_data)

The function that will be called from the GSource watch on the session pool.

The function will be called when the pool must be cleaned up because one or more sessions timed out.

Parameters:

pool

a GstRTSPSessionPool object

user_data

user data that has been given when registering the handler

Returns

FALSE if the source should be removed.


GstRtspServer.RTSPSessionPoolFunc

function GstRtspServer.RTSPSessionPoolFunc(pool: GstRtspServer.RTSPSessionPool, user_data: Object): {
    // javascript wrapper for 'GstRTSPSessionPoolFunc'
}

The function that will be called from the GSource watch on the session pool.

The function will be called when the pool must be cleaned up because one or more sessions timed out.

Parameters:

user_data (Object)

user data that has been given when registering the handler

Returns (Number)

false if the source should be removed.


GstRtspServer.RTSPSessionPoolFunc

def GstRtspServer.RTSPSessionPoolFunc (pool, *user_data):
    #python wrapper for 'GstRTSPSessionPoolFunc'

The function that will be called from the GSource watch on the session pool.

The function will be called when the pool must be cleaned up because one or more sessions timed out.

Parameters:

user_data (variadic)

user data that has been given when registering the handler

Returns (bool)

False if the source should be removed.


The results of the search are