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.Socketcondition (
GLib.IOCondition) – the condition on sourceserver (
GstRtspServer.RTSPServer) – aGstRtspServer.RTSPServer
- Returns:
 Trueif the source could be connected,Falseif an error occurred.- Return type:
 
A default
Gio.SocketSourceFuncthat creates a newGstRtspServer.RTSPClientto accept and handle a new connection on socket or server.
- classmethod new()[source]¶
 - Returns:
 a new
GstRtspServer.RTSPServer- Return type:
 
Create a new
GstRtspServer.RTSPServerinstance.
- attach(context)[source]¶
 - Parameters:
 context (
GLib.MainContextorNone) – 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.RTSPServerClientFilterFuncorNone) – a callbackuser_data (
objectorNone) – userGstRtsp.datapassed to func
- Returns:
 a
GLib.Listwith all clients for which func returnedGstRtspServer.RTSPFilterResult.REF. After usage, each element in theGLib.Listshould 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.Listof this function..When func is
None,GstRtspServer.RTSPFilterResult.REFwill be assumed for each client.
- create_socket(cancellable)[source]¶
 - Parameters:
 cancellable (
Gio.CancellableorNone) – aGio.Cancellable- Raises:
 - Returns:
 the
Gio.Socketfor self orNonewhen an error occurred.- Return type:
 
Create a
Gio.Socketfor self. The socket will listen on the configured service.
- create_source(cancellable)[source]¶
 - Parameters:
 cancellable (
Gio.CancellableorNone) – aGio.CancellableorNone.- Raises:
 - Returns:
 the
GLib.Sourcefor self orNonewhen an error occurred. Free withGLib.Source.unref()- Return type:
 
Create a
GLib.Sourcefor self. The new source will have a defaultGio.SocketSourceFuncofGstRtspServer.RTSPServer.io_func().cancellable if not
Nonecan 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.RTSPAuthof self.GObject.Object.unref() after usage.- Return type:
 
Get the
GstRtspServer.RTSPAuthused 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.RTSPMountPointsof self.GObject.Object.unref() after usage.- Return type:
 
Get the
GstRtspServer.RTSPMountPointsused as the mount points of self.
- get_session_pool()[source]¶
 - Returns:
 the
GstRtspServer.RTSPSessionPoolused for sessions.GObject.Object.unref() after usage.- Return type:
 
Get the
GstRtspServer.RTSPSessionPoolused as the session pool of self.
- get_thread_pool()[source]¶
 - Returns:
 the
GstRtspServer.RTSPThreadPoolof self.GObject.Object.unref() after usage.- Return type:
 
Get the
GstRtspServer.RTSPThreadPoolused 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.RTSPAuthorNone) – 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.requestsize limit and reject requests exceeding the limit.New in version 1.18.
- set_mount_points(mounts)[source]¶
 - Parameters:
 mounts (
GstRtspServer.RTSPMountPointsorNone) – 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.RTSPSessionPoolorNone) – aGstRtspServer.RTSPSessionPool
configure pool to be used as the session pool of self.
- set_thread_pool(pool)[source]¶
 - Parameters:
 pool (
GstRtspServer.RTSPThreadPoolorNone) – 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 (
strorNone) – any initialGstRtsp.datathat 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.datathat 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