GstRtspServer.RTSPStream¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
The control string for this stream |
||
r/w |
Allowed transfer profiles |
||
r/w |
Allowed lower transport protocols |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class GstRtspServer.RTSPStream(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The definition of a media stream.
- classmethod new(idx, payloader, pad)[source]¶
- Parameters:
idx (
int
) – an indexpayloader (
Gst.Element
) – aGst.Element
- Returns:
a new
GstRtspServer.RTSPStream
- Return type:
Create a new media stream with index idx that handles RTP
GstRtsp.data
on pad and has a payloader element payloader if pad is a source pad or a depayloader element payloader if pad is a sink pad.
- add_multicast_client_address(destination, rtp_port, rtcp_port, family)[source]¶
- Parameters:
destination (
str
) – a multicast address to addrtp_port (
int
) – RTP portrtcp_port (
int
) – RTCP portfamily (
Gio.SocketFamily
) – socket family
- Returns:
True
if 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.data
to destination are supposed to be allocated.New in version 1.16.
- add_transport(trans)[source]¶
- Parameters:
trans (
GstRtspServer.RTSPStreamTransport
) – aGstRtspServer.RTSPStreamTransport
- Returns:
True
if trans was added- Return type:
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 familytransport (
GstRtsp.RTSPTransport
) – transport methoduse_client_settings (
bool
) – Whether to use client settings or not
- Returns:
True
if the RTP and RTCP sockets have been succeccully allocated.- Return type:
Allocates RTP and RTCP ports.
- complete_stream(transport)[source]¶
- Parameters:
transport (
GstRtsp.RTSPTransport
) – aGstRtsp.RTSPTransport
- Returns:
True
if the stream has been successfully updated.- Return type:
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.RTSPAddressPool
of self.GObject.Object.unref
() after usage.- Return type:
Get the
GstRtspServer.RTSPAddressPool
used as the address pool of self.
- get_buffer_size()[source]¶
- Returns:
the size of the UDP TX buffer
- Return type:
Get the size of the UDP transmission buffer (in bytes)
New in version 1.6.
- get_dscp_qos()[source]¶
- Returns:
the DSCP QoS value of the outgoing sockets, or -1 if disbled.
- Return type:
Get the configured DSCP QoS in of the outgoing sockets.
- get_joined_bin()[source]¶
-
Get the previous joined bin with
GstRtspServer.RTSPStream.join_bin
() orNone
.
- get_max_mcast_ttl()[source]¶
- Returns:
the maximum time-to-live value of outgoing multicast packets.
- Return type:
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:
Get the configured MTU in the payloader of self.
- get_multicast_address(family)[source]¶
- Parameters:
family (
Gio.SocketFamily
) – theGio.SocketFamily
- Returns:
the
GstRtspServer.RTSPAddress
of self orNone
when no address could be allocated.GstRtspServer.RTSPAddress.free
() after usage.- Return type:
Get the multicast address of self for family. The original
GstRtspServer.RTSPAddress
is 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:
Get all multicast client addresses that RTP
GstRtsp.data
will be sent toNew in version 1.16.
- get_publish_clock_mode()[source]¶
- Returns:
- Return type:
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:
New in version 1.18.
- get_rates()[source]¶
- Returns:
True
if rate and/or applied_rate could be determined.- rate:
the configured rate
- applied_rate:
the configured applied_rate
- Return type:
Retrieve the current rate and/or applied_rate.
New in version 1.18.
- get_retransmission_pt()[source]¶
- Returns:
The retransmission PT.
- Return type:
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:
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
None
if no socket could be allocated for family. Unref after usage- Return type:
Gio.Socket
orNone
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
None
if no socket could be allocated for family. Unref after usage- Return type:
Gio.Socket
orNone
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
None
if nosocket could be allocated for family. Unref after usage
- Return type:
Gio.Socket
orNone
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
None
if no socket could be allocated for family. Unref after usage- Return type:
Gio.Socket
orNone
Get the RTP socket from self for a family.
self must be joined to a bin.
- get_rtpinfo()[source]¶
- Returns:
True
when 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:
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_srtp_encoder()[source]¶
- Returns:
The SRTP encoder for this stream. Unref after usage.
- Return type:
Gst.Element
orNone
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:
New in version 1.16.
- get_ulpfec_pt()[source]¶
- Returns:
the payload type used for ULPFEC protection packets
- Return type:
New in version 1.16.
- has_control(control)[source]¶
- Parameters:
- Returns:
True
is self has control as the control string- Return type:
Check if self has the control string control.
- is_bind_mcast_address()[source]¶
- Returns:
True
if multicast sockets are configured to be bound to multicast addresses.- Return type:
Check if multicast sockets are configured to be bound to multicast addresses.
New in version 1.16.
- is_blocking()[source]¶
-
Check if self is blocking on a
Gst.Buffer
.
- is_client_side()[source]¶
- Returns:
True
if thisGstRtspServer.RTSPStream
is client-side.- Return type:
- is_complete()[source]¶
-
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_transport_supported(transport)[source]¶
- Parameters:
transport (
GstRtsp.RTSPTransport
) – aGstRtsp.RTSPTransport
- Returns:
True
if transport can be handled by self.- Return type:
Check if transport can be handled by stream
- join_bin(bin, rtpbin, state)[source]¶
- Parameters:
rtpbin (
Gst.Element
) – a rtpbin element in binstate (
Gst.State
) – the target state of the new elements
- Returns:
True
on success.- Return type:
Join the
Gst.Bin
bin 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.
- leave_bin(bin, rtpbin)[source]¶
- Parameters:
rtpbin (
Gst.Element
) – a rtpbinGst.Element
- Returns:
True
on success.- Return type:
Remove the elements of self from bin.
- query_position()[source]¶
- Returns:
True
if the position could be queried- position:
current position of a
GstRtspServer.RTSPStream
- Return type:
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:
True
if the stop could be queried- stop:
current stop of a
GstRtspServer.RTSPStream
- Return type:
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
) – aGst.Buffer
- Returns:
- Return type:
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
) – aGst.Buffer
- Returns:
- Return type:
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
) – aGstRtspServer.RTSPStreamTransport
- Returns:
True
if trans was removed- Return type:
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.Element
orNone
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.Element
orNone
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.Element
orNone
Creating a rtpulpfecdec element
New in version 1.16.
- request_ulpfec_encoder(sessid)[source]¶
- Parameters:
sessid (
int
) –- Returns:
a
Gst.Element
.- Return type:
Gst.Element
orNone
Creating a rtpulpfecenc element
New in version 1.16.
- reserve_address(address, port, n_ports, ttl)[source]¶
- Parameters:
- Returns:
the
GstRtspServer.RTSPAddress
of self orNone
when 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.RTSPAddress
is cached and copy is returned, so freeing the return value won’t release the address from the pool.
- set_address_pool(pool)[source]¶
- Parameters:
pool (
GstRtspServer.RTSPAddressPool
orNone
) – aGstRtspServer.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:
True
on success- Return type:
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
) –True
if thisGstRtspServer.RTSPStream
is running on the ‘client’ side of an RTSP connection.
Sets the
GstRtspServer.RTSPStream
as 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_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:
True
if the requested ttl has been set successfully.- Return type:
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_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_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.RTSPStreamTransportFilterFunc
orNone
) – a callbackuser_data (
object
orNone
) – userGstRtsp.data
passed to func
- Returns:
a
GLib.List
with all transports 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 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 resultGLib.List
of this function..When func is
None
,GstRtspServer.RTSPFilterResult.REF
will be assumed for each transport.
- unblock_rtcp()[source]¶
Remove blocking probe from the RTCP source. When creating an UDP source for RTCP it is initially blocked until this function is called. This functions should be called once the pipeline is ready for handling RTCP packets.
New in version 1.20.
- update_crypto(ssrc, crypto)[source]¶
- Parameters:
- Returns:
True
if 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.
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 signalobject (
Gst.Element
) –
- 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 signalobject (
Gst.Element
) –
- 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 signalobject (
Gst.Element
) –
Property Details¶
- GstRtspServer.RTSPStream.props.control¶
-
The control string for this stream
- GstRtspServer.RTSPStream.props.profiles¶
- Name:
profiles
- Type:
- Default Value:
- Flags:
Allowed transfer profiles
- GstRtspServer.RTSPStream.props.protocols¶
- Name:
protocols
- Type:
- Default Value:
GstRtsp.RTSPLowerTrans.UDP
|GstRtsp.RTSPLowerTrans.UDP_MCAST
|GstRtsp.RTSPLowerTrans.TCP
- Flags:
Allowed lower transport protocols