Functions

rtsp_auth_credentials_free (credentials)

rtsp_connection_accept (socket, cancellable)

rtsp_connection_create (url)

rtsp_connection_create_from_socket (socket, ip, port, initial_buffer)

rtsp_find_header_field (header)

rtsp_find_method (method)

rtsp_generate_digest_auth_response (algorithm, method, realm, username, password, uri, nonce)

rtsp_generate_digest_auth_response_from_md5 (algorithm, method, md5, uri, nonce)

rtsp_header_allow_multiple (field)

rtsp_header_as_text (field)

rtsp_message_new ()

rtsp_message_new_data (channel)

rtsp_message_new_request (method, uri)

rtsp_message_new_response (code, reason, request)

rtsp_method_as_text (method)

rtsp_options_as_text (options)

rtsp_options_from_text (options)

rtsp_range_convert_units (range, unit)

rtsp_range_free (range)

rtsp_range_get_times (range)

rtsp_range_parse (rangestr)

rtsp_range_to_string (range)

rtsp_status_as_text (code)

rtsp_strresult (result)

rtsp_transport_get_manager (trans, option)

rtsp_transport_get_mime (trans)

rtsp_transport_init ()

rtsp_transport_new ()

rtsp_transport_parse (str)

rtsp_url_parse (urlstr)

rtsp_version_as_text (version)

Details

GstRtsp.rtsp_auth_credentials_free(credentials)[source]
Parameters:

credentials (GstRtsp.RTSPAuthCredential) – a None-terminated array of GstRtsp.RTSPAuthCredential

Free a None-terminated array of credentials returned from GstRtsp.RTSPMessage.parse_auth_credentials().

New in version 1.12.

GstRtsp.rtsp_connection_accept(socket, cancellable)[source]
Parameters:
Returns:

GstRtsp.RTSPResult.OK when conn contains a valid connection.

conn:

storage for a GstRtsp.RTSPConnection

Return type:

(GstRtsp.RTSPResult, conn: GstRtsp.RTSPConnection or None)

Accept a new connection on socket and create a new GstRtsp.RTSPConnection for handling communication on new socket.

GstRtsp.rtsp_connection_create(url)[source]
Parameters:

url (GstRtsp.RTSPUrl) – a GstRtsp.RTSPUrl

Returns:

GstRtsp.RTSPResult.OK when conn contains a valid connection.

conn:

storage for a GstRtsp.RTSPConnection

Return type:

(GstRtsp.RTSPResult, conn: GstRtsp.RTSPConnection)

Create a newly allocated GstRtsp.RTSPConnection from url and store it in conn. The connection will not yet attempt to connect to url, use GstRtsp.RTSPConnection.connect().

A copy of url will be made.

GstRtsp.rtsp_connection_create_from_socket(socket, ip, port, initial_buffer)[source]
Parameters:
  • socket (Gio.Socket) – a Gio.Socket

  • ip (str) – the IP address of the other end

  • port (int) – the port used by the other end

  • initial_buffer (str) – GstRtsp.data already read from fd

Returns:

GstRtsp.RTSPResult.OK when conn contains a valid connection.

conn:

storage for a GstRtsp.RTSPConnection

Return type:

(GstRtsp.RTSPResult, conn: GstRtsp.RTSPConnection or None)

Create a new GstRtsp.RTSPConnection for handling communication on the existing socket socket. The initial_buffer contains zero terminated GstRtsp.data already read from socket which should be used before starting to read new GstRtsp.data.

GstRtsp.rtsp_find_header_field(header)[source]
Parameters:

header (str) – a header string

Returns:

a GstRtsp.RTSPHeaderField for header or GstRtsp.RTSPHeaderField.INVALID if the header field is unknown.

Return type:

GstRtsp.RTSPHeaderField

Convert header to a GstRtsp.RTSPHeaderField.

GstRtsp.rtsp_find_method(method)[source]
Parameters:

method (str) – a method

Returns:

a GstRtsp.RTSPMethod for method or GstRtsp.RTSPMethod.INVALID if the method is unknown.

Return type:

GstRtsp.RTSPMethod

Convert method to a GstRtsp.RTSPMethod.

GstRtsp.rtsp_generate_digest_auth_response(algorithm, method, realm, username, password, uri, nonce)[source]
Parameters:
  • algorithm (str or None) – Hash algorithm to use, or None for MD5

  • method (str) – Request method, e.g. PLAY

  • realm (str) – Realm

  • username (str) – Username

  • password (str) – Password

  • uri (str) – Original GstRtsp.request URI

  • nonce (str) – Nonce

Returns:

Authentication GstRtsp.response or None if unsupported

Return type:

str or None

Calculates the digest auth GstRtsp.response from the values given by the server and the username and password. See RFC2069 for details.

Currently only supported algorithm “md5”.

New in version 1.12.

GstRtsp.rtsp_generate_digest_auth_response_from_md5(algorithm, method, md5, uri, nonce)[source]
Parameters:
  • algorithm (str or None) – Hash algorithm to use, or None for MD5

  • method (str) – Request method, e.g. PLAY

  • md5 (str) – The md5 sum of username:realm:password

  • uri (str) – Original GstRtsp.request URI

  • nonce (str) – Nonce

Returns:

Authentication GstRtsp.response or None if unsupported

Return type:

str or None

Calculates the digest auth GstRtsp.response from the values given by the server and the md5sum. See RFC2069 for details.

This function is useful when the passwords are not stored in clear text, but instead in the same format as the .htdigest file.

Currently only supported algorithm “md5”.

New in version 1.16.

GstRtsp.rtsp_header_allow_multiple(field)[source]
Parameters:

field (GstRtsp.RTSPHeaderField) – a GstRtsp.RTSPHeaderField

Returns:

True if multiple headers are allowed.

Return type:

bool

Check whether field may appear multiple times in a message.

GstRtsp.rtsp_header_as_text(field)[source]
Parameters:

field (GstRtsp.RTSPHeaderField) – a GstRtsp.RTSPHeaderField

Returns:

a string representation of field.

Return type:

str or None

Convert field to a string.

GstRtsp.rtsp_message_new()[source]
Returns:

a GstRtsp.RTSPResult.

msg:

a location for the new GstRtsp.RTSPMessage

Return type:

(GstRtsp.RTSPResult, msg: GstRtsp.RTSPMessage)

Create a new initialized GstRtsp.RTSPMessage. Free with GstRtsp.RTSPMessage.free().

GstRtsp.rtsp_message_new_data(channel)[source]
Parameters:

channel (int) – the channel

Returns:

a GstRtsp.RTSPResult.

msg:

a location for the new GstRtsp.RTSPMessage

Return type:

(GstRtsp.RTSPResult, msg: GstRtsp.RTSPMessage)

Create a new GstRtsp.data GstRtsp.RTSPMessage with channel and store the result message in msg. Free with GstRtsp.RTSPMessage.free().

GstRtsp.rtsp_message_new_request(method, uri)[source]
Parameters:
  • method (GstRtsp.RTSPMethod) – the GstRtsp.request method to use

  • uri (str) – the uri of the GstRtsp.request

Returns:

a GstRtsp.RTSPResult.

msg:

a location for the new GstRtsp.RTSPMessage

Return type:

(GstRtsp.RTSPResult, msg: GstRtsp.RTSPMessage)

Create a new GstRtsp.RTSPMessage with method and uri and store the result GstRtsp.request message in msg. Free with GstRtsp.RTSPMessage.free().

GstRtsp.rtsp_message_new_response(code, reason, request)[source]
Parameters:
Returns:

a GstRtsp.RTSPResult.

msg:

a location for the new GstRtsp.RTSPMessage

Return type:

(GstRtsp.RTSPResult, msg: GstRtsp.RTSPMessage)

Create a new GstRtsp.response GstRtsp.RTSPMessage with code and reason and store the result message in msg. Free with GstRtsp.RTSPMessage.free().

When reason is None, the default reason for code will be used.

When request is not None, the relevant headers will be copied to the new GstRtsp.response message.

GstRtsp.rtsp_method_as_text(method)[source]
Parameters:

method (GstRtsp.RTSPMethod) – a GstRtsp.RTSPMethod

Returns:

a string representation of method.

Return type:

str or None

Convert method to a string.

GstRtsp.rtsp_options_as_text(options)[source]
Parameters:

options (GstRtsp.RTSPMethod) – one or more GstRtsp.RTSPMethod

Returns:

a new string of options. GLib.free() after usage.

Return type:

str

Convert options to a string.

GstRtsp.rtsp_options_from_text(options)[source]
Parameters:

options (str) – a comma separated list of options

Returns:

a GstRtsp.RTSPMethod

Return type:

GstRtsp.RTSPMethod

Convert the comma separated list options to a GstRtsp.RTSPMethod bitwise or of methods. This functions is the reverse of GstRtsp.rtsp_options_as_text().

New in version 1.2.

GstRtsp.rtsp_range_convert_units(range, unit)[source]
Parameters:
Returns:

True if the range could be converted

Return type:

bool

Converts the range in-place between different types of units. Ranges containing the special value GstRtsp.RTSPTimeType.NOW can not be converted as these are only valid for GstRtsp.RTSPRangeUnit.NPT.

GstRtsp.rtsp_range_free(range)[source]
Parameters:

range (GstRtsp.RTSPTimeRange) – a GstRtsp.RTSPTimeRange

Free the memory allocated by range.

GstRtsp.rtsp_range_get_times(range)[source]
Parameters:

range (GstRtsp.RTSPTimeRange) – a GstRtsp.RTSPTimeRange

Returns:

True on success.

min:

result minimum #GstClockTime

max:

result maximum #GstClockTime

Return type:

(bool, min: int, max: int)

Retrieve the minimum and maximum values from range converted to #GstClockTime in min and max.

A value of Gst.CLOCK_TIME_NONE will be used to signal GstRtsp.RTSPTimeType.NOW and GstRtsp.RTSPTimeType.END for min and max respectively.

UTC times will be converted to nanoseconds since 1900.

New in version 1.2.

GstRtsp.rtsp_range_parse(rangestr)[source]
Parameters:

rangestr (str) – a range string to parse

Returns:

GstRtsp.RTSPResult.OK on success.

range:

location to hold the GstRtsp.RTSPTimeRange result

Return type:

(GstRtsp.RTSPResult, range: GstRtsp.RTSPTimeRange)

Parse rangestr to a GstRtsp.RTSPTimeRange.

GstRtsp.rtsp_range_to_string(range)[source]
Parameters:

range (GstRtsp.RTSPTimeRange) – a GstRtsp.RTSPTimeRange

Returns:

The string representation of range. GLib.free() after usage.

Return type:

str

Convert range into a string representation.

GstRtsp.rtsp_status_as_text(code)[source]
Parameters:

code (GstRtsp.RTSPStatusCode) – a GstRtsp.RTSPStatusCode

Returns:

a string representation of code.

Return type:

str

Convert code to a string.

GstRtsp.rtsp_strresult(result)[source]
Parameters:

result (GstRtsp.RTSPResult) – a GstRtsp.RTSPResult

Returns:

a newly allocated string. GLib.free() after usage.

Return type:

str

Convert result in a human readable string.

GstRtsp.rtsp_transport_get_manager(trans, option)[source]
Parameters:
Returns:

GstRtsp.RTSPResult.OK.

manager:

location to hold the result

Return type:

(GstRtsp.RTSPResult, manager: str or None)

Get the Gst.Element that can handle the buffers transported over trans.

It is possible that there are several managers available, use option to selected one.

manager will contain an element name or None when no manager is needed/available for trans.

GstRtsp.rtsp_transport_get_mime(trans)[source]
Parameters:

trans (GstRtsp.RTSPTransMode) – a GstRtsp.RTSPTransMode

Returns:

GstRtsp.RTSPResult.OK.

mime:

location to hold the result

Return type:

(GstRtsp.RTSPResult, mime: str)

Get the mime type of the transport mode trans. This mime type is typically used to generate Gst.Caps events.

Deprecated since version ???: This functions only deals with the GstRtsp.RTSPTransMode and only returns the mime type for GstRtsp.RTSPProfile.AVP. Use GstRtsp.RTSPTransport.get_media_type() instead.

GstRtsp.rtsp_transport_init()[source]
Returns:

GstRtsp.RTSPResult.OK.

transport:

a GstRtsp.RTSPTransport

Return type:

(GstRtsp.RTSPResult, transport: GstRtsp.RTSPTransport)

Initialize transport so that it can be used.

GstRtsp.rtsp_transport_new()[source]
Returns:

a GstRtsp.RTSPResult.

transport:

location to hold the new GstRtsp.RTSPTransport

Return type:

(GstRtsp.RTSPResult, transport: GstRtsp.RTSPTransport)

Allocate a new initialized GstRtsp.RTSPTransport. Use GstRtsp.RTSPTransport.free() after usage.

GstRtsp.rtsp_transport_parse(str)[source]
Parameters:

str (str) – a transport string

Returns:

a GstRtsp.RTSPResult.

transport:

a GstRtsp.RTSPTransport

Return type:

(GstRtsp.RTSPResult, transport: GstRtsp.RTSPTransport)

Parse the RTSP transport string str into transport.

GstRtsp.rtsp_url_parse(urlstr)[source]
Parameters:

urlstr (str) – the url string to parse

Returns:

a GstRtsp.RTSPResult.

url:

location to hold the result.

Return type:

(GstRtsp.RTSPResult, url: GstRtsp.RTSPUrl or None)

Parse the RTSP urlstr into a newly allocated GstRtsp.RTSPUrl. Free after usage with GstRtsp.RTSPUrl.free().

GstRtsp.rtsp_version_as_text(version)[source]
Parameters:

version (GstRtsp.RTSPVersion) – a GstRtsp.RTSPVersion

Returns:

a string representation of version.

Return type:

str

Convert version to a string.