GstRtspServer.RTSPSessionPool

g GObject.Object GObject.Object GstRtspServer.RTSPSessionPool GstRtspServer.RTSPSessionPool GObject.Object->GstRtspServer.RTSPSessionPool

Subclasses:None

Methods

Inherited:GObject.Object (37)
Structs:GObject.ObjectClass (5)
class new ()
  cleanup ()
  create ()
  create_watch ()
  filter (func, *user_data)
  find (sessionid)
  get_max_sessions ()
  get_n_sessions ()
  remove (sess)
  set_max_sessions (max)

Virtual Methods

Inherited:GObject.Object (7)
  do_create_session_id ()
  do_session_removed (session)

Properties

Name Type Flags Short Description
max-sessions int r/w the maximum amount of sessions (0 = unlimited)

Signals

Inherited:GObject.Object (1)
Name Short Description
session-removed  

Fields

Inherited:GObject.Object (1)
Name Type Access Description
parent GObject.Object r  

Class Details

class GstRtspServer.RTSPSessionPool(**kwargs)
Bases:GObject.Object
Abstract:No
Structure:GstRtspServer.RTSPSessionPoolClass

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:GstRtspServer.RTSPSessionPool

Create a new GstRtspServer.RTSPSessionPool instance.

cleanup()[source]
Returns:the amount of sessions that got removed.
Return type:int

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:GstRtspServer.RTSPSession or None

Create a new GstRtspServer.RTSPSession object in self.

create_watch()[source]
Returns:a GLib.Source
Return type:GLib.Source

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

filter(func, *user_data)[source]
Parameters:
Returns:

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

Return type:

[GstRtspServer.RTSPSession]

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 result GLib.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 or None when the session did not exist. GObject.Object.unref() after usage.
Return type:GstRtspServer.RTSPSession or None

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:int

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:int

Get the amount of active sessions in self.

remove(sess)[source]
Parameters:sess (GstRtspServer.RTSPSession) – a GstRtspServer.RTSPSession
Returns:True if the session was found and removed.
Return type:bool

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:str
do_session_removed(session) virtual
Parameters:session (GstRtspServer.RTSPSession) –

Signal Details

GstRtspServer.RTSPSessionPool.signals.session_removed(r_t_s_p_session_pool, object)
Signal Name:

session-removed

Flags:

RUN_LAST

Parameters:

Property Details

GstRtspServer.RTSPSessionPool.props.max_sessions
Name:max-sessions
Type:int
Default Value:0
Flags:READABLE, WRITABLE

the maximum amount of sessions (0 = unlimited)