GstRtspServer.RTSPStream¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
Virtual Methods¶
| Inherited: | GObject.Object (7) | 
|---|
Properties¶
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| control | str | r/w | The control string for this stream | 
| profiles | GstRtsp.RTSPProfile | r/w | Allowed transfer profiles | 
| protocols | GstRtsp.RTSPLowerTrans | r/w | Allowed lower transport protocols | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
| Name | Short Description | 
|---|---|
| new-rtcp-encoder | |
| new-rtp-encoder | |
| new-rtp-rtcp-decoder | 
Class Details¶
- 
class GstRtspServer.RTSPStream(**kwargs)¶
- Bases: - GObject.Object- Abstract: - No - Structure: - GstRtspServer.RTSPStreamClass- The definition of a media stream. - 
classmethod new(idx, payloader, pad)[source]¶
- Parameters: - idx (int) – an index
- payloader (Gst.Element) – aGst.Element
- pad (Gst.Pad) – aGst.Pad
 - Returns: - a new - GstRtspServer.RTSPStream- Return type: - Create a new media stream with index idx that handles RTP - GstRtsp.dataon pad and has a payloader element payloader if pad is a source pad or a depayloader element payloader if pad is a sink pad.
- idx (
 - 
add_multicast_client_address(destination, rtp_port, rtcp_port, family)[source]¶
- Parameters: - destination (str) – a multicast address to add
- rtp_port (int) – RTP port
- rtcp_port (int) – RTCP port
- family (Gio.SocketFamily) – socket family
 - Returns: - Trueif destination can be addedd and handled by self.- Return type: - Add multicast client address to stream. At this point, the sockets that will stream RTP and RTCP - GstRtsp.datato destination are supposed to be allocated.- New in version 1.16. 
- destination (
 - 
add_transport(trans)[source]¶
- Parameters: - trans ( - GstRtspServer.RTSPStreamTransport) – a- GstRtspServer.RTSPStreamTransport- Returns: - Trueif trans was added- Return type: - bool- Add the transport in trans to self. The media of self will then also be send to the values configured in trans. Adding the same transport twice will not add it a second time. - self must be joined to a bin. - trans must contain a valid - GstRtsp.RTSPTransport.
 - 
allocate_udp_sockets(family, transport, use_client_settings)[source]¶
- Parameters: - family (Gio.SocketFamily) – protocol family
- transport (GstRtsp.RTSPTransport) – transport method
- use_client_settings (bool) – Whether to use client settings or not
 - Returns: - Trueif the RTP and RTCP sockets have been succeccully allocated.- Return type: - Allocates RTP and RTCP ports. 
- family (
 - 
complete_stream(transport)[source]¶
- Parameters: - transport ( - GstRtsp.RTSPTransport) – a- GstRtsp.RTSPTransport- Returns: - Trueif the stream has been sucessfully updated.- Return type: - bool- Add a receiver and sender part to the pipeline based on the transport from SETUP. - New in version 1.14. 
 - 
get_address_pool()[source]¶
- Returns: - the - GstRtspServer.RTSPAddressPoolof self.- GObject.Object.unref() after usage.- Return type: - GstRtspServer.RTSPAddressPoolor- None- Get the - GstRtspServer.RTSPAddressPoolused as the address pool of self.
 - 
get_buffer_size()[source]¶
- Returns: - the size of the UDP TX buffer - Return type: - int- Get the size of the UDP transmission buffer (in bytes) - New in version 1.6. 
 - 
get_caps()[source]¶
- Returns: - the - Gst.Capsof self. use gst_caps_unref() after usage.- Return type: - Gst.Capsor- None- Retrieve the current caps of self. 
 - 
get_control()[source]¶
- Returns: - the control string. - GLib.free() after usage.- Return type: - stror- None- Get the control string to identify this stream. 
 - 
get_dscp_qos()[source]¶
- Returns: - the DSCP QoS value of the outgoing sockets, or -1 if disbled. - Return type: - int- Get the configured DSCP QoS in of the outgoing sockets. 
 - 
get_joined_bin()[source]¶
- Returns: - the joined bin or - None.- Return type: - Gst.Binor- None- Get the previous joined bin with - GstRtspServer.RTSPStream.join_bin() or- None.
 - 
get_max_mcast_ttl()[source]¶
- Returns: - the maximum time-to-live value of outgoing multicast packets. - Return type: - int- Get the the maximum time-to-live value of outgoing multicast packets. - New in version 1.16. 
 - 
get_mtu()[source]¶
- Returns: - the MTU of the payloader. - Return type: - int- Get the configured MTU in the payloader of self. 
 - 
get_multicast_address(family)[source]¶
- Parameters: - family ( - Gio.SocketFamily) – the- Gio.SocketFamily- Returns: - the - GstRtspServer.RTSPAddressof self or- Nonewhen no address could be allocated.- GstRtspServer.RTSPAddress.free() after usage.- Return type: - GstRtspServer.RTSPAddressor- None- Get the multicast address of self for family. The original - GstRtspServer.RTSPAddressis cached and copy is returned, so freeing the return value won’t release the address from the pool.
 - 
get_multicast_client_addresses()[source]¶
- Returns: - A comma separated list of host:port pairs with destinations - Return type: - str- Get all multicast client addresses that RTP - GstRtsp.datawill be sent to- New in version 1.16. 
 - 
get_multicast_iface()[source]¶
- Returns: - the multicast interface for self. - GLib.free() after usage.- Return type: - stror- None- Get the multicast interface used for self. 
 - 
get_profiles()[source]¶
- Returns: - a - GstRtsp.RTSPProfile- Return type: - GstRtsp.RTSPProfile- Get the allowed profiles of self. 
 - 
get_protocols()[source]¶
- Returns: - a - GstRtsp.RTSPLowerTrans- Return type: - GstRtsp.RTSPLowerTrans- Get the allowed protocols of self. 
 - 
get_publish_clock_mode()[source]¶
- Returns: - The - GstRtspServer.RTSPPublishClockMode- Return type: - GstRtspServer.RTSPPublishClockMode- Gets if and how the stream clock should be published according to RFC7273. - New in version 1.8. 
 - 
get_rate_control()[source]¶
- Returns: - whether self will follow the Rate-Control=no behaviour as specified in the ONVIF replay spec. - Return type: - bool- New in version 1.18. 
 - 
get_rates()[source]¶
- Returns: - Trueif rate and/or applied_rate could be determined.- rate: - the configured rate - applied_rate: - the configured applied_rate - Return type: - ( - bool, rate:- float, applied_rate:- float)- Retrieve the current rate and/or applied_rate. - New in version 1.18. 
 - 
get_retransmission_pt()[source]¶
- Returns: - The retransmission PT. - Return type: - int- Get the payload-type used for retransmission of this stream 
 - 
get_retransmission_time()[source]¶
- Returns: - the amount of time to store retransmission - GstRtsp.data.- Return type: - int- Get the amount of time to store retransmission - GstRtsp.data.
 - 
get_rtcp_multicast_socket(family)[source]¶
- Parameters: - family ( - Gio.SocketFamily) – the socket family- Returns: - the multicast RTCP socket or - Noneif no socket could be allocated for family. Unref after usage- Return type: - Gio.Socketor- None- Get the multicast RTCP socket from self for a family. - New in version 1.14. 
 - 
get_rtcp_socket(family)[source]¶
- Parameters: - family ( - Gio.SocketFamily) – the socket family- Returns: - the RTCP socket or - Noneif no socket could be allocated for family. Unref after usage- Return type: - Gio.Socketor- None- Get the RTCP socket from self for a family. - self must be joined to a bin. 
 - 
get_rtp_multicast_socket(family)[source]¶
- Parameters: - family ( - Gio.SocketFamily) – the socket family- Returns: - the multicast RTP socket or - Noneif no- socket could be allocated for family. Unref after usage - Return type: - Gio.Socketor- None- Get the multicast RTP socket from self for a family. 
 - 
get_rtp_socket(family)[source]¶
- Parameters: - family ( - Gio.SocketFamily) – the socket family- Returns: - the RTP socket or - Noneif no socket could be allocated for family. Unref after usage- Return type: - Gio.Socketor- None- Get the RTP socket from self for a family. - self must be joined to a bin. 
 - 
get_rtpinfo()[source]¶
- Returns: - Truewhen rtptime, seq and running-time could be determined.- rtptime: - result RTP timestamp - seq: - result RTP seqnum - clock_rate: - the clock rate - running_time: - result running-time - Return type: - ( - bool, rtptime:- int, seq:- int, clock_rate:- int, running_time:- int)- Retrieve the current rtptime, seq and running-time. This is used to construct a RTPInfo reply header. 
 - 
get_rtpsession()[source]¶
- Returns: - The RTP session of this stream. Unref after usage. - Return type: - GObject.Object- Get the RTP session of this stream. 
 - 
get_server_port(family)[source]¶
- Parameters: - family ( - Gio.SocketFamily) – the port family to get- Returns: - result server port - Return type: - server_port: - GstRtsp.RTSPRange- Fill server_port with the port pair used by the server. This function can only be called when self has been joined. 
 - 
get_sinkpad()[source]¶
- Returns: - the sinkpad. Unref after usage. - Return type: - Gst.Pador- None- Get the sinkpad associated with self. 
 - 
get_srcpad()[source]¶
- Returns: - the srcpad. Unref after usage. - Return type: - Gst.Pador- None- Get the srcpad associated with self. 
 - 
get_srtp_encoder()[source]¶
- Returns: - The SRTP encoder for this stream. Unref after usage. - Return type: - Gst.Element- Get the SRTP encoder for this stream. 
 - 
get_ssrc()[source]¶
- Returns: - result ssrc - Return type: - ssrc: - int- Get the SSRC used by the RTP session of this stream. This function can only be called when self has been joined. 
 - 
get_ulpfec_percentage()[source]¶
- Returns: - the amount of redundancy applied when creating ULPFEC protection packets. - Return type: - int- New in version 1.16. 
 - 
get_ulpfec_pt()[source]¶
- Returns: - the payload type used for ULPFEC protection packets - Return type: - int- New in version 1.16. 
 - 
handle_keymgmt(keymgmt)[source]¶
- Parameters: - keymgmt ( - str) – a keymgmt header- Return type: - bool- Parse and handle a KeyMgmt header. - New in version 1.16. 
 - 
has_control(control)[source]¶
- Parameters: - control ( - stror- None) – a control string- Returns: - Trueis self has control as the control string- Return type: - bool- Check if self has the control string control. 
 - 
is_bind_mcast_address()[source]¶
- Returns: - Trueif multicast sockets are configured to be bound to multicast addresses.- Return type: - bool- Check if multicast sockets are configured to be bound to multicast addresses. - New in version 1.16. 
 - 
is_blocking()[source]¶
- Returns: - Trueif self is blocking- Return type: - bool- Check if self is blocking on a - Gst.Buffer.
 - 
is_client_side()[source]¶
- Returns: - Trueif this- GstRtspServer.RTSPStreamis client-side.- Return type: - bool
 - 
is_complete()[source]¶
- Returns: - Trueif the stream contains at least one sink element.- Return type: - bool- Checks whether the stream is complete, contains the receiver and the sender parts. As the stream contains sink(s) element(s), it’s possible to perform seek operations on it. - New in version 1.14. 
 - 
is_receiver()[source]¶
- Returns: - Trueif the stream is a receiver and- Falseotherwise.- Return type: - bool- Checks whether the stream is a receiver. - New in version 1.14. 
 - 
is_sender()[source]¶
- Returns: - Trueif the stream is a sender and- Falseotherwise.- Return type: - bool- Checks whether the stream is a sender. - New in version 1.14. 
 - 
is_transport_supported(transport)[source]¶
- Parameters: - transport ( - GstRtsp.RTSPTransport) – a- GstRtsp.RTSPTransport- Returns: - Trueif transport can be handled by self.- Return type: - bool- Check if transport can be handled by stream 
 - 
join_bin(bin, rtpbin, state)[source]¶
- Parameters: - bin (Gst.Bin) – aGst.Binto join
- rtpbin (Gst.Element) – a rtpbin element in bin
- state (Gst.State) – the target state of the new elements
 - Returns: - Trueon success.- Return type: - Join the - Gst.Binbin that contains the element rtpbin.- self will link to rtpbin, which must be inside bin. The elements added to bin will be set to the state given in state. 
- bin (
 - 
leave_bin(bin, rtpbin)[source]¶
- Parameters: - bin (Gst.Bin) – aGst.Bin
- rtpbin (Gst.Element) – a rtpbinGst.Element
 - Returns: - Trueon success.- Return type: - Remove the elements of self from bin. 
- bin (
 - 
query_position()[source]¶
- Returns: - Trueif the position could be queried- position: - current position of a - GstRtspServer.RTSPStream- Return type: - ( - bool, position:- int)- Query the position of the stream in - Gst.Format.TIME. This only considers the RTP parts of the pipeline and not the RTCP parts.
 - 
query_stop()[source]¶
- Returns: - Trueif the stop could be queried- stop: - current stop of a - GstRtspServer.RTSPStream- Return type: - ( - bool, stop:- int)- Query the stop of the stream in - Gst.Format.TIME. This only considers the RTP parts of the pipeline and not the RTCP parts.
 - 
recv_rtcp(buffer)[source]¶
- Parameters: - buffer ( - Gst.Buffer) – a- Gst.Buffer- Returns: - a - Gst.FlowReturn.- Return type: - Gst.FlowReturn- Handle an RTCP buffer for the stream. This method is usually called when a message has been received from a client using the TCP transport. - This function takes ownership of buffer. 
 - 
recv_rtp(buffer)[source]¶
- Parameters: - buffer ( - Gst.Buffer) – a- Gst.Buffer- Returns: - a - Gst.FlowReturn.- Return type: - Gst.FlowReturn- Handle an RTP buffer for the stream. This method is usually called when a message has been received from a client using the TCP transport. - This function takes ownership of buffer. 
 - 
remove_transport(trans)[source]¶
- Parameters: - trans ( - GstRtspServer.RTSPStreamTransport) – a- GstRtspServer.RTSPStreamTransport- Returns: - Trueif trans was removed- Return type: - bool- Remove the transport in trans from self. The media of self will not be sent to the values configured in trans. - self must be joined to a bin. - trans must contain a valid - GstRtsp.RTSPTransport.
 - 
request_aux_receiver(sessid)[source]¶
- Parameters: - sessid ( - int) – the session id- Returns: - a - Gst.Element.- Return type: - Gst.Elementor- None- Creating a rtxreceive bin - New in version 1.16. 
 - 
request_aux_sender(sessid)[source]¶
- Parameters: - sessid ( - int) – the session id- Returns: - a - Gst.Element.- Return type: - Gst.Elementor- None- Creating a rtxsend bin - New in version 1.6. 
 - 
request_ulpfec_decoder(rtpbin, sessid)[source]¶
- Parameters: - rtpbin (Gst.Element) –
- sessid (int) –
 - Returns: - a - Gst.Element.- Return type: - Gst.Elementor- None- Creating a rtpulpfecdec element - New in version 1.16. 
- rtpbin (
 - 
request_ulpfec_encoder(sessid)[source]¶
- Parameters: - sessid ( - int) –- Returns: - a - Gst.Element.- Return type: - Gst.Elementor- None- Creating a rtpulpfecenc element - New in version 1.16. 
 - 
reserve_address(address, port, n_ports, ttl)[source]¶
- Parameters: - Returns: - the - GstRtspServer.RTSPAddressof self or- Nonewhen the address could not be reserved.- GstRtspServer.RTSPAddress.free() after usage.- Return type: - Reserve address and port as the address and port of self. The original - GstRtspServer.RTSPAddressis cached and copy is returned, so freeing the return value won’t release the address from the pool.
 - 
seekable()[source]¶
- Returns: - Trueif self is seekable, else- False.- Return type: - bool- Checks whether the individual self is seekable. - New in version 1.14. 
 - 
set_address_pool(pool)[source]¶
- Parameters: - pool ( - GstRtspServer.RTSPAddressPoolor- None) – a- GstRtspServer.RTSPAddressPool- configure pool to be used as the address pool of self. 
 - 
set_bind_mcast_address(bind_mcast_addr)[source]¶
- Parameters: - bind_mcast_addr ( - bool) – the new value- Decide whether the multicast socket should be bound to a multicast address or INADDR_ANY. - New in version 1.16. 
 - 
set_blocked(blocked)[source]¶
- Parameters: - blocked ( - bool) – boolean indicating we should block or unblock- Returns: - Trueon success- Return type: - bool- Blocks or unblocks the dataflow on self. 
 - 
set_buffer_size(size)[source]¶
- Parameters: - size ( - int) – the buffer size- Set the size of the UDP transmission buffer (in bytes) Needs to be set before the stream is joined to a bin. - New in version 1.6. 
 - 
set_client_side(client_side)[source]¶
- Parameters: - client_side ( - bool) –- Trueif this- GstRtspServer.RTSPStreamis running on the ‘client’ side of an RTSP connection.- Sets the - GstRtspServer.RTSPStreamas a ‘client side’ stream - used for sending streams to an RTSP server via RECORD. This has the practical effect of changing which UDP port numbers are used when setting up the local side of the stream sending to be either the ‘server’ or ‘client’ pair of a configured UDP transport.
 - 
set_control(control)[source]¶
- Parameters: - control ( - stror- None) – a control string- Set the control string in self. 
 - 
set_dscp_qos(dscp_qos)[source]¶
- Parameters: - dscp_qos ( - int) – a new dscp qos value (0-63, or -1 to disable)- Configure the dscp qos of the outgoing sockets to dscp_qos. 
 - 
set_max_mcast_ttl(ttl)[source]¶
- Parameters: - ttl ( - int) – the new multicast ttl value- Returns: - Trueif the requested ttl has been set successfully.- Return type: - bool- Set the maximum time-to-live value of outgoing multicast packets. - New in version 1.16. 
 - 
set_mtu(mtu)[source]¶
- Parameters: - mtu ( - int) – a new MTU- Configure the mtu in the payloader of self to mtu. 
 - 
set_multicast_iface(multicast_iface)[source]¶
- Parameters: - multicast_iface ( - stror- None) – a multicast interface name- configure multicast_iface to be used for self. 
 - 
set_profiles(profiles)[source]¶
- Parameters: - profiles ( - GstRtsp.RTSPProfile) – the new profiles- Configure the allowed profiles for self. 
 - 
set_protocols(protocols)[source]¶
- Parameters: - protocols ( - GstRtsp.RTSPLowerTrans) – the new flags- Configure the allowed lower transport for self. 
 - 
set_publish_clock_mode(mode)[source]¶
- Parameters: - mode ( - GstRtspServer.RTSPPublishClockMode) – the clock publish mode- Sets if and how the stream clock should be published according to RFC7273. - New in version 1.8. 
 - 
set_rate_control(enabled)[source]¶
- Parameters: - enabled ( - bool) –- Define whether self will follow the Rate-Control=no behaviour as specified in the ONVIF replay spec. - New in version 1.18. 
 - 
set_retransmission_pt(rtx_pt)[source]¶
- Parameters: - rtx_pt ( - int) – a- int- Set the payload type (pt) for retransmission of this stream. 
 - 
set_retransmission_time(time)[source]¶
- Parameters: - time ( - int) – a #GstClockTime- Set the amount of time to store retransmission packets. 
 - 
set_ulpfec_percentage(percentage)[source]¶
- Parameters: - percentage ( - int) –- Sets the amount of redundancy to apply when creating ULPFEC protection packets. - New in version 1.16. 
 - 
set_ulpfec_pt(pt)[source]¶
- Parameters: - pt ( - int) –- Set the payload type to be used for ULPFEC protection packets - New in version 1.16. 
 - 
transport_filter(func, *user_data)[source]¶
- Parameters: - func (GstRtspServer.RTSPStreamTransportFilterFuncorNone) – a callback
- user_data (objectorNone) – userGstRtsp.datapassed to func
 - Returns: - a - GLib.Listwith all transports for which func returned- GstRtspServer.RTSPFilterResult.REF. After usage, each element in the- GLib.Listshould be unreffed before the list is freed.- Return type: - Call func for each transport managed by self. The result value of func determines what happens to the transport. 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 transport will be removed from self.- If func returns - GstRtspServer.RTSPFilterResult.KEEP, the transport will remain in self.- If func returns - GstRtspServer.RTSPFilterResult.REF, the transport will remain in self but will also be added with an additional ref to the result- GLib.Listof this function..- When func is - None,- GstRtspServer.RTSPFilterResult.REFwill be assumed for each transport.
- func (
 - 
update_crypto(ssrc, crypto)[source]¶
- Parameters: - Returns: - Trueif crypto could be updated- Return type: - Update the new crypto information for ssrc in self. If information for ssrc did not exist, it will be added. If information for ssrc existed, it will be replaced. If crypto is - None, it will be removed from self.
 
- 
classmethod 
Signal Details¶
- 
GstRtspServer.RTSPStream.signals.new_rtcp_encoder(r_t_s_p_stream, object)¶
- Signal Name: - new-rtcp-encoder- Flags: - Parameters: - r_t_s_p_stream (GstRtspServer.RTSPStream) – The object which received the signal
- object (Gst.Element) –
 
- r_t_s_p_stream (
- 
GstRtspServer.RTSPStream.signals.new_rtp_encoder(r_t_s_p_stream, object)¶
- Signal Name: - new-rtp-encoder- Flags: - Parameters: - r_t_s_p_stream (GstRtspServer.RTSPStream) – The object which received the signal
- object (Gst.Element) –
 
- r_t_s_p_stream (
- 
GstRtspServer.RTSPStream.signals.new_rtp_rtcp_decoder(r_t_s_p_stream, object)¶
- Signal Name: - new-rtp-rtcp-decoder- Flags: - Parameters: - r_t_s_p_stream (GstRtspServer.RTSPStream) – The object which received the signal
- object (Gst.Element) –
 
- r_t_s_p_stream (
Property Details¶
- 
GstRtspServer.RTSPStream.props.control¶
- Name: - control- Type: - str- Default Value: - None- Flags: - READABLE,- WRITABLE- The control string for this stream 
- 
GstRtspServer.RTSPStream.props.profiles¶
- Name: - profiles- Type: - GstRtsp.RTSPProfile- Default Value: - GstRtsp.RTSPProfile.AVP- Flags: - READABLE,- WRITABLE- Allowed transfer profiles 
- 
GstRtspServer.RTSPStream.props.protocols¶
- Name: - protocols- Type: - GstRtsp.RTSPLowerTrans- Default Value: - GstRtsp.RTSPLowerTrans.UDP|- GstRtsp.RTSPLowerTrans.UDP_MCAST|- GstRtsp.RTSPLowerTrans.TCP- Flags: - READABLE,- WRITABLE- Allowed lower transport protocols