GstRtspServer.RTSPClient

g GObject.Object GObject.Object GstRtspServer.RTSPClient GstRtspServer.RTSPClient GObject.Object->GstRtspServer.RTSPClient

Subclasses:GstRtspServer.RTSPOnvifClient

Methods

Inherited:GObject.Object (37)
Structs:GObject.ObjectClass (5)
class new ()
  attach (context)
  close ()
  get_auth ()
  get_connection ()
  get_content_length_limit ()
  get_mount_points ()
  get_session_pool ()
  get_stream_transport (channel)
  get_thread_pool ()
  handle_message (message)
  send_message (session, message)
  session_filter (func, *user_data)
  set_auth (auth)
  set_connection (conn)
  set_content_length_limit (limit)
  set_mount_points (mounts)
  set_send_func (func, *user_data)
  set_send_messages_func (func, *user_data)
  set_session_pool (pool)
  set_thread_pool (pool)

Virtual Methods

Inherited:GObject.Object (7)
  do_adjust_play_mode (context, range, flags, rate, trickmode_interval, enable_rate_control)
  do_adjust_play_response (context)
  do_announce_request (ctx)
  do_check_requirements (ctx, arr)
  do_closed ()
  do_configure_client_media (media, stream, ctx)
  do_configure_client_transport (ctx, ct)
  do_create_sdp (media)
  do_describe_request (ctx)
  do_get_parameter_request (ctx)
  do_handle_response (ctx)
  do_handle_sdp (ctx, media, sdp)
  do_make_path_from_uri (uri)
  do_new_session (session)
  do_options_request (ctx)
  do_params_get (ctx)
  do_params_set (ctx)
  do_pause_request (ctx)
  do_play_request (ctx)
  do_pre_announce_request (ctx)
  do_pre_describe_request (ctx)
  do_pre_get_parameter_request (ctx)
  do_pre_options_request (ctx)
  do_pre_pause_request (ctx)
  do_pre_play_request (ctx)
  do_pre_record_request (ctx)
  do_pre_set_parameter_request (ctx)
  do_pre_setup_request (ctx)
  do_pre_teardown_request (ctx)
  do_record_request (ctx)
  do_send_message (ctx, response)
  do_set_parameter_request (ctx)
  do_setup_request (ctx)
  do_teardown_request (ctx)
  do_tunnel_http_response (request, response)

Properties

Name Type Flags Short Description
drop-backlog bool r/w Drop GstRtsp.data when the backlog queue is full
mount-points GstRtspServer.RTSPMountPoints r/w The mount points to use for client session
post-session-timeout int r/w An extra TCP connection timeout after session timeout
session-pool GstRtspServer.RTSPSessionPool r/w The session pool to use for client session

Fields

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

Class Details

class GstRtspServer.RTSPClient(**kwargs)
Bases:GObject.Object
Abstract:No
Structure:GstRtspServer.RTSPClientClass

The client object represents the connection and its state with a client.

classmethod new()[source]
Returns:a new GstRtspServer.RTSPClient
Return type:GstRtspServer.RTSPClient

Create a new GstRtspServer.RTSPClient instance.

attach(context)[source]
Parameters:context (GLib.MainContext or None) – a GLib.MainContext
Returns:the ID (greater than 0) for the source within the GLib.MainContext.
Return type:int

Attaches self to context. When the mainloop for context is run, the client will be dispatched. When context is None, the default context will be used).

This function should be called when the client properties and urls are fully configured and the client is ready to start.

close()[source]

Close the connection of self and remove all media it was managing.

New in version 1.4.

get_auth()[source]
Returns:the GstRtspServer.RTSPAuth of self. GObject.Object.unref() after usage.
Return type:GstRtspServer.RTSPAuth or None

Get the GstRtspServer.RTSPAuth used as the authentication manager of self.

get_connection()[source]
Returns:the GstRtsp.RTSPConnection of self. The connection object returned remains valid until the client is freed.
Return type:GstRtsp.RTSPConnection or None

Get the GstRtsp.RTSPConnection of self.

get_content_length_limit()[source]
Returns:the Content-Length limit.
Return type:int

Get the Content-Length limit of self.

New in version 1.18.

get_mount_points()[source]
Returns:a GstRtspServer.RTSPMountPoints, unref after usage.
Return type:GstRtspServer.RTSPMountPoints or None

Get the GstRtspServer.RTSPMountPoints object that self uses to manage its sessions.

get_session_pool()[source]
Returns:a GstRtspServer.RTSPSessionPool, unref after usage.
Return type:GstRtspServer.RTSPSessionPool or None

Get the GstRtspServer.RTSPSessionPool object that self uses to manage its sessions.

get_stream_transport(channel)[source]
Parameters:channel (int) –
Returns:the GstRtspServer.RTSPStreamTransport associated with channel.
Return type:GstRtspServer.RTSPStreamTransport or None

This is useful when providing a send function through GstRtspServer.RTSPClient.set_send_func() when doing RTSP over TCP: the send function must call GstRtspServer.RTSPStreamTransport.message_sent () on the appropriate transport when GstRtsp.data has been received for streaming to continue.

New in version 1.18.

get_thread_pool()[source]
Returns:the GstRtspServer.RTSPThreadPool of self. GObject.Object.unref() after usage.
Return type:GstRtspServer.RTSPThreadPool or None

Get the GstRtspServer.RTSPThreadPool used as the thread pool of self.

handle_message(message)[source]
Parameters:message (GstRtsp.RTSPMessage) – an GstRtsp.RTSPMessage
Returns:a GstRtsp.RTSPResult.
Return type:GstRtsp.RTSPResult

Let the client handle message.

send_message(session, message)[source]
Parameters:
Return type:

GstRtsp.RTSPResult

Send a message message to the remote end. message must be a GstRtsp.RTSPMsgType.REQUEST or a GstRtsp.RTSPMsgType.RESPONSE.

session_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 managed by self. The result value of func determines what happens to the session. 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 session will be 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 each session.

set_auth(auth)[source]
Parameters:auth (GstRtspServer.RTSPAuth or None) – a GstRtspServer.RTSPAuth

configure auth to be used as the authentication manager of self.

set_connection(conn)[source]
Parameters:conn (GstRtsp.RTSPConnection) – a GstRtsp.RTSPConnection
Returns:True on success.
Return type:bool

Set the GstRtsp.RTSPConnection of self. This function takes ownership of conn.

set_content_length_limit(limit)[source]
Parameters:limit (int) – Content-Length limit

Configure self to use the specified Content-Length limit.

Define an appropriate GstRtsp.request size limit and reject requests exceeding the limit with GstRtsp.response status 413 Request Entity Too Large

New in version 1.18.

set_mount_points(mounts)[source]
Parameters:mounts (GstRtspServer.RTSPMountPoints or None) – a GstRtspServer.RTSPMountPoints

Set mounts as the mount points for self which it will use to map urls to media streams. These mount points are usually inherited from the server that created the client but can be overriden later.

set_send_func(func, *user_data)[source]
Parameters:

Set func as the callback that will be called when a new message needs to be sent to the client. user_data is passed to func and notify is called when user_data is no longer in use.

By default, the client will send the messages on the GstRtsp.RTSPConnection that was configured with GstRtspServer.RTSPClient.attach() was called.

It is only allowed to set either a send_func or a send_messages_func but not both at the same time.

set_send_messages_func(func, *user_data)[source]
Parameters:

Set func as the callback that will be called when new messages needs to be sent to the client. user_data is passed to func and notify is called when user_data is no longer in use.

By default, the client will send the messages on the GstRtsp.RTSPConnection that was configured with GstRtspServer.RTSPClient.attach() was called.

It is only allowed to set either a send_func or a send_messages_func but not both at the same time.

New in version 1.16.

set_session_pool(pool)[source]
Parameters:pool (GstRtspServer.RTSPSessionPool or None) – a GstRtspServer.RTSPSessionPool

Set pool as the sessionpool for self which it will use to find or allocate sessions. the sessionpool is usually inherited from the server that created the client but can be overridden later.

set_thread_pool(pool)[source]
Parameters:pool (GstRtspServer.RTSPThreadPool or None) – a GstRtspServer.RTSPThreadPool

configure pool to be used as the thread pool of self.

do_adjust_play_mode(context, range, flags, rate, trickmode_interval, enable_rate_control) virtual
Parameters:
Return type:

GstRtsp.RTSPStatusCode

do_adjust_play_response(context) virtual
Parameters:context (GstRtspServer.RTSPContext) –
Return type:GstRtsp.RTSPStatusCode
do_announce_request(ctx) virtual
Parameters:ctx (GstRtspServer.RTSPContext) –
do_check_requirements(ctx, arr) virtual
Parameters:
Return type:

str

do_closed() virtual
do_configure_client_media(media, stream, ctx) virtual
Parameters:
Return type:

bool

do_configure_client_transport(ctx, ct) virtual
Parameters:
Return type:

bool

do_create_sdp(media) virtual
Parameters:media (GstRtspServer.RTSPMedia) –
Return type:GstSdp.SDPMessage
do_describe_request(ctx) virtual
Parameters:ctx (GstRtspServer.RTSPContext) –
do_get_parameter_request(ctx) virtual
Parameters:ctx (GstRtspServer.RTSPContext) –
do_handle_response(ctx) virtual
Parameters:ctx (GstRtspServer.RTSPContext) –
do_handle_sdp(ctx, media, sdp) virtual
Parameters:
Return type:

bool

do_make_path_from_uri(uri) virtual
Parameters:uri (GstRtsp.RTSPUrl) –
Return type:str
do_new_session(session) virtual
Parameters:session (GstRtspServer.RTSPSession) –
do_options_request(ctx) virtual
Parameters:ctx (GstRtspServer.RTSPContext) –
do_params_get(ctx) virtual
Parameters:ctx (GstRtspServer.RTSPContext) –
Return type:GstRtsp.RTSPResult
do_params_set(ctx) virtual
Parameters:ctx (GstRtspServer.RTSPContext) –
Return type:GstRtsp.RTSPResult
do_pause_request(ctx) virtual
Parameters:ctx (GstRtspServer.RTSPContext) –
do_play_request(ctx) virtual
Parameters:ctx (GstRtspServer.RTSPContext) –
do_pre_announce_request(ctx) virtual
Parameters:ctx (GstRtspServer.RTSPContext) –
Return type:GstRtsp.RTSPStatusCode
do_pre_describe_request(ctx) virtual
Parameters:ctx (GstRtspServer.RTSPContext) –
Return type:GstRtsp.RTSPStatusCode
do_pre_get_parameter_request(ctx) virtual
Parameters:ctx (GstRtspServer.RTSPContext) –
Return type:GstRtsp.RTSPStatusCode
do_pre_options_request(ctx) virtual
Parameters:ctx (GstRtspServer.RTSPContext) –
Return type:GstRtsp.RTSPStatusCode
do_pre_pause_request(ctx) virtual
Parameters:ctx (GstRtspServer.RTSPContext) –
Return type:GstRtsp.RTSPStatusCode
do_pre_play_request(ctx) virtual
Parameters:ctx (GstRtspServer.RTSPContext) –
Return type:GstRtsp.RTSPStatusCode
do_pre_record_request(ctx) virtual
Parameters:ctx (GstRtspServer.RTSPContext) –
Return type:GstRtsp.RTSPStatusCode
do_pre_set_parameter_request(ctx) virtual
Parameters:ctx (GstRtspServer.RTSPContext) –
Return type:GstRtsp.RTSPStatusCode
do_pre_setup_request(ctx) virtual
Parameters:ctx (GstRtspServer.RTSPContext) –
Return type:GstRtsp.RTSPStatusCode
do_pre_teardown_request(ctx) virtual
Parameters:ctx (GstRtspServer.RTSPContext) –
Return type:GstRtsp.RTSPStatusCode
do_record_request(ctx) virtual
Parameters:ctx (GstRtspServer.RTSPContext) –
do_send_message(ctx, response) virtual
Parameters:
do_set_parameter_request(ctx) virtual
Parameters:ctx (GstRtspServer.RTSPContext) –
do_setup_request(ctx) virtual
Parameters:ctx (GstRtspServer.RTSPContext) –
do_teardown_request(ctx) virtual
Parameters:ctx (GstRtspServer.RTSPContext) –
do_tunnel_http_response(request, response) virtual
Parameters:

Signal Details

GstRtspServer.RTSPClient.signals.announce_request(r_t_s_p_client, ctx)
Signal Name:

announce-request

Flags:

RUN_LAST

Parameters:
GstRtspServer.RTSPClient.signals.check_requirements(r_t_s_p_client, ctx, arr)
Signal Name:

check-requirements

Flags:

RUN_LAST

Parameters:
Returns:

a newly allocated string with comma-separated list of unsupported options. An empty string must be returned if all options are supported.

Return type:

str

New in version 1.6.

GstRtspServer.RTSPClient.signals.closed(r_t_s_p_client)
Signal Name:closed
Flags:RUN_LAST
Parameters:r_t_s_p_client (GstRtspServer.RTSPClient) – The object which received the signal
GstRtspServer.RTSPClient.signals.describe_request(r_t_s_p_client, ctx)
Signal Name:

describe-request

Flags:

RUN_LAST

Parameters:
GstRtspServer.RTSPClient.signals.get_parameter_request(r_t_s_p_client, ctx)
Signal Name:

get-parameter-request

Flags:

RUN_LAST

Parameters:
GstRtspServer.RTSPClient.signals.handle_response(r_t_s_p_client, ctx)
Signal Name:

handle-response

Flags:

RUN_LAST

Parameters:
GstRtspServer.RTSPClient.signals.new_session(r_t_s_p_client, object)
Signal Name:

new-session

Flags:

RUN_LAST

Parameters:
GstRtspServer.RTSPClient.signals.options_request(r_t_s_p_client, ctx)
Signal Name:

options-request

Flags:

RUN_LAST

Parameters:
GstRtspServer.RTSPClient.signals.pause_request(r_t_s_p_client, ctx)
Signal Name:

pause-request

Flags:

RUN_LAST

Parameters:
GstRtspServer.RTSPClient.signals.play_request(r_t_s_p_client, ctx)
Signal Name:

play-request

Flags:

RUN_LAST

Parameters:
GstRtspServer.RTSPClient.signals.pre_announce_request(r_t_s_p_client, ctx)
Signal Name:

pre-announce-request

Flags:

RUN_LAST

Parameters:
Returns:

a GstRtsp.RTSPStatusCode, GstRtsp.RTSPStatusCode.OK in case of success, otherwise an appropriate return code

Return type:

GstRtsp.RTSPStatusCode

New in version 1.12.

GstRtspServer.RTSPClient.signals.pre_describe_request(r_t_s_p_client, ctx)
Signal Name:

pre-describe-request

Flags:

RUN_LAST

Parameters:
Returns:

a GstRtsp.RTSPStatusCode, GstRtsp.RTSPStatusCode.OK in case of success, otherwise an appropriate return code

Return type:

GstRtsp.RTSPStatusCode

New in version 1.12.

GstRtspServer.RTSPClient.signals.pre_get_parameter_request(r_t_s_p_client, ctx)
Signal Name:

pre-get-parameter-request

Flags:

RUN_LAST

Parameters:
Returns:

a GstRtsp.RTSPStatusCode, GstRtsp.RTSPStatusCode.OK in case of success, otherwise an appropriate return code

Return type:

GstRtsp.RTSPStatusCode

New in version 1.12.

GstRtspServer.RTSPClient.signals.pre_options_request(r_t_s_p_client, ctx)
Signal Name:

pre-options-request

Flags:

RUN_LAST

Parameters:
Returns:

a GstRtsp.RTSPStatusCode, GstRtsp.RTSPStatusCode.OK in case of success, otherwise an appropriate return code

Return type:

GstRtsp.RTSPStatusCode

New in version 1.12.

GstRtspServer.RTSPClient.signals.pre_pause_request(r_t_s_p_client, ctx)
Signal Name:

pre-pause-request

Flags:

RUN_LAST

Parameters:
Returns:

a GstRtsp.RTSPStatusCode, GstRtsp.RTSPStatusCode.OK in case of success, otherwise an appropriate return code

Return type:

GstRtsp.RTSPStatusCode

New in version 1.12.

GstRtspServer.RTSPClient.signals.pre_play_request(r_t_s_p_client, ctx)
Signal Name:

pre-play-request

Flags:

RUN_LAST

Parameters:
Returns:

a GstRtsp.RTSPStatusCode, GstRtsp.RTSPStatusCode.OK in case of success, otherwise an appropriate return code

Return type:

GstRtsp.RTSPStatusCode

New in version 1.12.

GstRtspServer.RTSPClient.signals.pre_record_request(r_t_s_p_client, ctx)
Signal Name:

pre-record-request

Flags:

RUN_LAST

Parameters:
Returns:

a GstRtsp.RTSPStatusCode, GstRtsp.RTSPStatusCode.OK in case of success, otherwise an appropriate return code

Return type:

GstRtsp.RTSPStatusCode

New in version 1.12.

GstRtspServer.RTSPClient.signals.pre_set_parameter_request(r_t_s_p_client, ctx)
Signal Name:

pre-set-parameter-request

Flags:

RUN_LAST

Parameters:
Returns:

a GstRtsp.RTSPStatusCode, GstRtsp.RTSPStatusCode.OK in case of success, otherwise an appropriate return code

Return type:

GstRtsp.RTSPStatusCode

New in version 1.12.

GstRtspServer.RTSPClient.signals.pre_setup_request(r_t_s_p_client, ctx)
Signal Name:

pre-setup-request

Flags:

RUN_LAST

Parameters:
Returns:

a GstRtsp.RTSPStatusCode, GstRtsp.RTSPStatusCode.OK in case of success, otherwise an appropriate return code

Return type:

GstRtsp.RTSPStatusCode

New in version 1.12.

GstRtspServer.RTSPClient.signals.pre_teardown_request(r_t_s_p_client, ctx)
Signal Name:

pre-teardown-request

Flags:

RUN_LAST

Parameters:
Returns:

a GstRtsp.RTSPStatusCode, GstRtsp.RTSPStatusCode.OK in case of success, otherwise an appropriate return code

Return type:

GstRtsp.RTSPStatusCode

New in version 1.12.

GstRtspServer.RTSPClient.signals.record_request(r_t_s_p_client, ctx)
Signal Name:

record-request

Flags:

RUN_LAST

Parameters:
GstRtspServer.RTSPClient.signals.send_message(r_t_s_p_client, session, message)
Signal Name:

send-message

Flags:

RUN_LAST

Parameters:
GstRtspServer.RTSPClient.signals.set_parameter_request(r_t_s_p_client, ctx)
Signal Name:

set-parameter-request

Flags:

RUN_LAST

Parameters:
GstRtspServer.RTSPClient.signals.setup_request(r_t_s_p_client, ctx)
Signal Name:

setup-request

Flags:

RUN_LAST

Parameters:
GstRtspServer.RTSPClient.signals.teardown_request(r_t_s_p_client, ctx)
Signal Name:

teardown-request

Flags:

RUN_LAST

Parameters:

Property Details

GstRtspServer.RTSPClient.props.drop_backlog
Name:drop-backlog
Type:bool
Default Value:True
Flags:READABLE, WRITABLE

Drop GstRtsp.data when the backlog queue is full

GstRtspServer.RTSPClient.props.mount_points
Name:mount-points
Type:GstRtspServer.RTSPMountPoints
Default Value:None
Flags:READABLE, WRITABLE

The mount points to use for client session

GstRtspServer.RTSPClient.props.post_session_timeout
Name:post-session-timeout
Type:int
Default Value:-1
Flags:READABLE, WRITABLE

An extra TCP connection timeout after session timeout

GstRtspServer.RTSPClient.props.session_pool
Name:session-pool
Type:GstRtspServer.RTSPSessionPool
Default Value:None
Flags:READABLE, WRITABLE

The session pool to use for client session