GstRtspServer.RTSPSession¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Add extra time to timeout |
||
r/w/co |
the session id |
||
r/w |
the timeout of the session (0 = never) |
||
r/w |
timeout always visible in header |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class GstRtspServer.RTSPSession(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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:
- Return type:
Create a new
GstRtspServer.RTSPSession
instance with sessionid.
- allow_expire()[source]¶
Allow self to expire. This method must be called an equal amount of time as
GstRtspServer.RTSPSession.prevent_expire
().
- dup_media(path)[source]¶
- Parameters:
path (
str
) – the path for the media- Returns:
the configuration for path in self, should be unreferenced when no longer needed.
- matched:
the amount of matched characters
- Return type:
(
GstRtspServer.RTSPSessionMedia
orNone
, matched:int
)
Gets the session media for path, increasing its reference count. matched will contain the number of matched characters of path.
New in version 1.20.
- filter(func, *user_data)[source]¶
- Parameters:
func (
GstRtspServer.RTSPSessionFilterFunc
orNone
) – a callbackuser_data (
object
orNone
) – userGstRtsp.data
passed to func
- Returns:
a
GLib.List
with all media 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 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 resultGLib.List
of this function..When func is
None
,GstRtspServer.RTSPFilterResult.REF
will be assumed for all media.
- 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.RTSPSessionMedia
orNone
, matched:int
)
Gets 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:
Get the sessionid of self.
- get_timeout()[source]¶
- Returns:
the timeout of self in seconds.
- Return type:
Get the timeout value of self.
- is_expired(now)[source]¶
- Parameters:
now (
GLib.TimeVal
) – the current system time- Returns:
True
if self timed out- Return type:
Check if self timeout out.
Deprecated since version ???: Use
GstRtspServer.RTSPSession.is_expired_usec
() instead.
- is_expired_usec(now)[source]¶
-
Check if self timeout out.
- manage_media(path, media)[source]¶
- Parameters:
path (
str
) – the path for the mediamedia (
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.
- 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:
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:
Get the amount of milliseconds till the session will expire.
- release_media(media)[source]¶
- Parameters:
media (
GstRtspServer.RTSPSessionMedia
) – aGstRtspServer.RTSPMedia
- Returns:
True
if there are more media session left in self.- Return type:
Release the managed media in self, freeing the memory allocated by it.
Property Details¶
- GstRtspServer.RTSPSession.props.extra_timeout¶
-
Add extra time to timeout
- GstRtspServer.RTSPSession.props.sessionid¶
- Name:
sessionid
- Type:
- Default Value:
- Flags:
the session id
- GstRtspServer.RTSPSession.props.timeout¶
-
the timeout of the session (0 = never)