GstRtspServer.RTSPSessionPool¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
the maximum amount of sessions (0 = unlimited) |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class GstRtspServer.RTSPSessionPool(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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.- classmethod new()[source]¶
- Returns:
A new
GstRtspServer.RTSPSessionPool
.GObject.Object.unref
() after usage.- Return type:
Create a new
GstRtspServer.RTSPSessionPool
instance.
- cleanup()[source]¶
- Returns:
the amount of sessions that got removed.
- Return type:
Inspect all the sessions in self and remove the sessions that are inactive for more than their timeout.
- create()[source]¶
- Returns:
a new
GstRtspServer.RTSPSession
.- Return type:
Create a new
GstRtspServer.RTSPSession
object in self.
- create_watch()[source]¶
- Returns:
- Return type:
Create a
GLib.Source
that will be dispatched when the session should be cleaned up.
- filter(func, *user_data)[source]¶
- Parameters:
func (
GstRtspServer.RTSPSessionPoolFilterFunc
orNone
) – a callbackuser_data (
object
orNone
) – userGstRtsp.data
passed to func
- Returns:
a
GLib.List
with all sessions for which func returnedGstRtspServer.RTSPFilterResult.REF
. After usage, each element in theGLib.List
should be unreffed before the list is freed.- Return type:
Call func for each session in self. 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 self can be performed from func.
If func returns
GstRtspServer.RTSPFilterResult.REMOVE
, the session will be set to the expired state and removed from self.If func returns
GstRtspServer.RTSPFilterResult.KEEP
, the session will remain in self.If func returns
GstRtspServer.RTSPFilterResult.REF
, the session will remain in self but will also be added with an additional ref to the resultGLib.List
of this function..When func is
None
,GstRtspServer.RTSPFilterResult.REF
will be assumed for all sessions.
- find(sessionid)[source]¶
- Parameters:
sessionid (
str
) – the session id- Returns:
the
GstRtspServer.RTSPSession
with sessionid orNone
when the session did not exist.GObject.Object.unref
() after usage.- Return type:
Find the session with sessionid in self. The access time of the session will be updated with
GstRtspServer.RTSPSession.touch
().
- get_max_sessions()[source]¶
- Returns:
the maximum allowed number of sessions.
- Return type:
Get the maximum allowed number of sessions in self. 0 means an unlimited amount of sessions.
- get_n_sessions()[source]¶
- Returns:
the amount of active sessions in self.
- Return type:
Get the amount of active sessions in self.
- remove(sess)[source]¶
- Parameters:
sess (
GstRtspServer.RTSPSession
) – aGstRtspServer.RTSPSession
- Returns:
True
if the session was found and removed.- Return type:
Remove sess from self, releasing the ref that the pool has on sess.
- set_max_sessions(max)[source]¶
- Parameters:
max (
int
) – the maximum number of sessions
Configure the maximum allowed number of sessions in self to max. A value of 0 means an unlimited amount of sessions.
- do_create_session_id() virtual¶
- Return type:
create a new random session id. Subclasses can create custom session ids and should not check if the session exists.
- do_session_removed(session) virtual¶
- Parameters:
session (
GstRtspServer.RTSPSession
) –
a session was removed from the pool
Signal Details¶
- GstRtspServer.RTSPSessionPool.signals.session_removed(r_t_s_p_session_pool, object)¶
- Signal Name:
session-removed
- Flags:
- Parameters:
r_t_s_p_session_pool (
GstRtspServer.RTSPSessionPool
) – The object which received the signalobject (
GstRtspServer.RTSPSession
) –