GstRtspServer.RTSPServer¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
The address the server uses to listen on |
||
r/w |
The maximum length to which the queue of pending connections may grow |
||
r |
The port number the server is listening on |
||
r/w |
Limitation of Content-Length |
||
r/w |
The mount points to use for client session |
||
r/w |
The service or port number the server uses to listen on |
||
r/w |
The session pool to use for client session |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class GstRtspServer.RTSPServer(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
This object listens on a port, creates and manages the clients connected to it.
- classmethod io_func(socket, condition, server)[source]¶
- Parameters:
socket (
Gio.Socket
) – aGio.Socket
condition (
GLib.IOCondition
) – the condition on sourceserver (
GstRtspServer.RTSPServer
) – aGstRtspServer.RTSPServer
- Returns:
True
if the source could be connected,False
if an error occurred.- Return type:
A default
Gio.SocketSourceFunc
that creates a newGstRtspServer.RTSPClient
to accept and handle a new connection on socket or server.
- classmethod new()[source]¶
- Returns:
a new
GstRtspServer.RTSPServer
- Return type:
Create a new
GstRtspServer.RTSPServer
instance.
- attach(context)[source]¶
- Parameters:
context (
GLib.MainContext
orNone
) – aGLib.MainContext
- Returns:
the ID (greater than 0) for the source within the
GLib.MainContext
.- Return type:
Attaches self to context. When the mainloop for context is run, the server will be dispatched. When context is
None
, the default context will be used).This function should be called when the server properties and urls are fully configured and the server is ready to start.
This takes a reference on self until the source is destroyed. Note that if context is not the default main context as returned by
GLib.MainContext.default
() (orNone
),GLib.Source.remove
() cannot be used to destroy the source. In that case it is recommended to useGstRtspServer.RTSPServer.create_source
() and attach it to context manually.
- client_filter(func, *user_data)[source]¶
- Parameters:
func (
GstRtspServer.RTSPServerClientFilterFunc
orNone
) – a callbackuser_data (
object
orNone
) – userGstRtsp.data
passed to func
- Returns:
a
GLib.List
with all clients 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 client managed by self. The result value of func determines what happens to the client. 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 client will be removed from self.If func returns
GstRtspServer.RTSPFilterResult.KEEP
, the client will remain in self.If func returns
GstRtspServer.RTSPFilterResult.REF
, the client 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 each client.
- create_socket(cancellable)[source]¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
- Raises:
- Returns:
the
Gio.Socket
for self orNone
when an error occurred.- Return type:
Create a
Gio.Socket
for self. The socket will listen on the configured service.
- create_source(cancellable)[source]¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
orNone
.- Raises:
- Returns:
the
GLib.Source
for self orNone
when an error occurred. Free withGLib.Source.unref
()- Return type:
Create a
GLib.Source
for self. The new source will have a defaultGio.SocketSourceFunc
ofGstRtspServer.RTSPServer.io_func
().cancellable if not
None
can be used to cancel the source, which will cause the source to trigger, reporting the current condition (which is likely 0 unless cancellation happened at the same time as a condition change). You can check for this in the callback usingGio.Cancellable.is_cancelled
().This takes a reference on self until source is destroyed.
- get_auth()[source]¶
- Returns:
the
GstRtspServer.RTSPAuth
of self.GObject.Object.unref
() after usage.- Return type:
Get the
GstRtspServer.RTSPAuth
used as the authentication manager of self.
- get_backlog()[source]¶
- Returns:
the server backlog.
- Return type:
The maximum amount of queued requests for the server.
- get_bound_port()[source]¶
- Returns:
the port number
- Return type:
Get the port number where the server was bound to.
- get_content_length_limit()[source]¶
- Returns:
the Content-Length limit.
- Return type:
Get the Content-Length limit of self.
New in version 1.18.
- get_mount_points()[source]¶
- Returns:
the
GstRtspServer.RTSPMountPoints
of self.GObject.Object.unref
() after usage.- Return type:
Get the
GstRtspServer.RTSPMountPoints
used as the mount points of self.
- get_session_pool()[source]¶
- Returns:
the
GstRtspServer.RTSPSessionPool
used for sessions.GObject.Object.unref
() after usage.- Return type:
Get the
GstRtspServer.RTSPSessionPool
used as the session pool of self.
- get_thread_pool()[source]¶
- Returns:
the
GstRtspServer.RTSPThreadPool
of self.GObject.Object.unref
() after usage.- Return type:
Get the
GstRtspServer.RTSPThreadPool
used as the thread pool of self.
- set_address(address)[source]¶
- Parameters:
address (
str
) – the address
Configure self to accept connections on the given address.
This function must be called before the server is bound.
- set_auth(auth)[source]¶
- Parameters:
auth (
GstRtspServer.RTSPAuth
orNone
) – aGstRtspServer.RTSPAuth
configure auth to be used as the authentication manager of self.
- set_backlog(backlog)[source]¶
- Parameters:
backlog (
int
) – the backlog
configure the maximum amount of requests that may be queued for the server.
This function must be called before the server is bound.
- set_content_length_limit(limit)[source]¶
- Parameters:
limit (
int
) –
Define an appropriate
GstRtsp.request
size limit and reject requests exceeding the limit.New in version 1.18.
- set_mount_points(mounts)[source]¶
- Parameters:
mounts (
GstRtspServer.RTSPMountPoints
orNone
) – aGstRtspServer.RTSPMountPoints
configure mounts to be used as the mount points of self.
- set_service(service)[source]¶
- Parameters:
service (
str
) – the service
Configure self to accept connections on the given service. service should be a string containing the service name (see services(5)) or a string containing a port number between 1 and 65535.
When service is set to “0”, the server will listen on a random free port. The actual used port can be retrieved with
GstRtspServer.RTSPServer.get_bound_port
().This function must be called before the server is bound.
- set_session_pool(pool)[source]¶
- Parameters:
pool (
GstRtspServer.RTSPSessionPool
orNone
) – aGstRtspServer.RTSPSessionPool
configure pool to be used as the session pool of self.
- set_thread_pool(pool)[source]¶
- Parameters:
pool (
GstRtspServer.RTSPThreadPool
orNone
) – aGstRtspServer.RTSPThreadPool
configure pool to be used as the thread pool of self.
- transfer_connection(socket, ip, port, initial_buffer)[source]¶
- Parameters:
socket (
Gio.Socket
) – a network socketip (
str
) – the IP address of the remote clientport (
int
) – the port used by the other endinitial_buffer (
str
orNone
) – any initialGstRtsp.data
that was already read from the socket
- Returns:
- Return type:
Take an existing network socket and use it for an RTSP connection. This is used when transferring a socket from an HTTP server which should be used as an RTSP over HTTP tunnel. The initial_buffer contains any remaining
GstRtsp.data
that the HTTP server read from the socket while parsing the HTTP header.
- do_client_connected(client) virtual¶
- Parameters:
client (
GstRtspServer.RTSPClient
) –
emitted when a new client connected.
Signal Details¶
- GstRtspServer.RTSPServer.signals.client_connected(r_t_s_p_server, object)¶
- Signal Name:
client-connected
- Flags:
- Parameters:
r_t_s_p_server (
GstRtspServer.RTSPServer
) – The object which received the signalobject (
GstRtspServer.RTSPClient
) –
Property Details¶
- GstRtspServer.RTSPServer.props.address¶
-
The address the server uses to listen on
- GstRtspServer.RTSPServer.props.backlog¶
-
The maximum length to which the queue of pending connections may grow
- GstRtspServer.RTSPServer.props.bound_port¶
-
The port number the server is listening on
- GstRtspServer.RTSPServer.props.content_length_limit¶
-
Limitation of Content-Length
- GstRtspServer.RTSPServer.props.mount_points¶
- Name:
mount-points
- Type:
- Default Value:
- Flags:
The mount points to use for client session
- GstRtspServer.RTSPServer.props.service¶
-
The service or port number the server uses to listen on
- GstRtspServer.RTSPServer.props.session_pool¶
- Name:
session-pool
- Type:
- Default Value:
- Flags:
The session pool to use for client session