GstRtspServer.RTSPSession¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | new(sessionid) | 
| allow_expire() | |
| filter(func, *user_data) | |
| get_header() | |
| get_media(path) | |
| get_sessionid() | |
| get_timeout() | |
| is_expired(now) | |
| is_expired_usec(now) | |
| manage_media(path, media) | |
| next_timeout(now) | |
| next_timeout_usec(now) | |
| prevent_expire() | |
| release_media(media) | |
| set_timeout(timeout) | |
| touch() | 
Virtual Methods¶
| Inherited: | GObject.Object (7) | 
|---|
Properties¶
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| extra-timeout | int | r/w | Add extra time to timeout | 
| sessionid | str | r/w/co | the session id | 
| timeout | int | r/w | the timeout of the session (0 = never) | 
| timeout-always-visible | bool | r/w | timeout always visible in header | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
Class Details¶
- 
class GstRtspServer.RTSPSession(**kwargs)¶
- Bases: - GObject.Object- Abstract: - No - Structure: - GstRtspServer.RTSPSessionClass- Session information kept by the server for a specific client. One client session, identified with a session id, can handle multiple medias identified with the url of a media. - 
classmethod new(sessionid)[source]¶
- Parameters: - sessionid ( - str) – a session id- Returns: - a new - GstRtspServer.RTSPSession- Return type: - GstRtspServer.RTSPSession- Create a new - GstRtspServer.RTSPSessioninstance with sessionid.
 - 
allow_expire()[source]¶
- Allow self to expire. This method must be called an equal amount of time as - GstRtspServer.RTSPSession.prevent_expire().
 - 
filter(func, *user_data)[source]¶
- Parameters: - func (GstRtspServer.RTSPSessionFilterFuncorNone) – a callback
- user_data (objectorNone) – userGstRtsp.datapassed to func
 - Returns: - a - GLib.Listwith all media for which func returned- GstRtspServer.RTSPFilterResult.REF. After usage, each element in the- GLib.Listshould be unreffed before the list is freed.- Return type: - Call func for each media in self. The result value of func determines what happens to the media. func will be called with self locked so no further actions on self can be performed from func. - If func returns - GstRtspServer.RTSPFilterResult.REMOVE, the media will be removed from self.- If func returns - GstRtspServer.RTSPFilterResult.KEEP, the media will remain in self.- If func returns - GstRtspServer.RTSPFilterResult.REF, the media will remain in self but will also be added with an additional ref to the result- GLib.Listof this function..- When func is - None,- GstRtspServer.RTSPFilterResult.REFwill be assumed for all media.
- func (
 - 
get_header()[source]¶
- Returns: - the Session header of self. - GLib.free() after usage.- Return type: - stror- None- Get the string that can be placed in the Session header field. 
 - 
get_media(path)[source]¶
- Parameters: - path ( - str) – the path for the media- Returns: - the configuration for path in self. - matched: - the amount of matched characters - Return type: - ( - GstRtspServer.RTSPSessionMediaor- None, matched:- int)- Get the session media for path. matched will contain the number of matched characters of path. 
 - 
get_sessionid()[source]¶
- Returns: - the sessionid of self. The value remains valid as long as self is alive. - Return type: - stror- None- Get the sessionid of self. 
 - 
get_timeout()[source]¶
- Returns: - the timeout of self in seconds. - Return type: - int- Get the timeout value of self. 
 - 
is_expired(now)[source]¶
- Parameters: - now ( - GLib.TimeVal) – the current system time- Returns: - Trueif self timed out- Return type: - bool- Check if self timeout out. - Deprecated since version ???: Use - GstRtspServer.RTSPSession.is_expired_usec() instead.
 - 
is_expired_usec(now)[source]¶
- Parameters: - now ( - int) – the current monotonic time- Returns: - Trueif self timed out- Return type: - bool- Check if self timeout out. 
 - 
manage_media(path, media)[source]¶
- Parameters: - path (str) – the path for the media
- media (GstRtspServer.RTSPMedia) – aGstRtspServer.RTSPMedia
 - Returns: - a new GstRTSPSessionMedia object. - Return type: - Manage the media object obj in self. path will be used to retrieve this media from the session with - GstRtspServer.RTSPSession.get_media().- Ownership is taken from media. 
- path (
 - 
next_timeout(now)[source]¶
- Parameters: - now ( - GLib.TimeVal) – the current system time- Returns: - the amount of milliseconds since the session will time out. - Return type: - int- Get the amount of milliseconds till the session will expire. - Deprecated since version ???: Use - GstRtspServer.RTSPSession.next_timeout_usec() instead.
 - 
next_timeout_usec(now)[source]¶
- Parameters: - now ( - int) – the current monotonic time- Returns: - the amount of milliseconds since the session will time out. - Return type: - int- Get the amount of milliseconds till the session will expire. 
 - 
release_media(media)[source]¶
- Parameters: - media ( - GstRtspServer.RTSPSessionMedia) – a- GstRtspServer.RTSPMedia- Returns: - Trueif there are more media session left in self.- Return type: - bool- Release the managed media in self, freeing the memory allocated by it. 
 
- 
classmethod 
Property Details¶
- 
GstRtspServer.RTSPSession.props.extra_timeout¶
- Name: - extra-timeout- Type: - int- Default Value: - 5- Flags: - READABLE,- WRITABLE- Add extra time to timeout 
- 
GstRtspServer.RTSPSession.props.sessionid¶
- Name: - sessionid- Type: - str- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- the session id