GstRtp.RTPBasePayload¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
|
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Whether RTP header extensions should be automatically enabled, if an implementation is available |
||
r |
A list of already enabled RTP header extensions |
||
r/w |
Maximum duration of the packet data in ns (-1 = unlimited up to MTU) |
||
r/w |
Minimum duration of the packet data in ns (can’t go above MTU) |
||
r/w |
Maximum size of one packet |
||
r/w |
Enable ONVIF Rate-Control=no timestamping mode |
||
r/w |
Generate perfect RTP timestamps when possible |
||
r/w |
The payload type of the packets |
||
r/w |
Force buffers to be multiples of this duration in ns (0 disables) |
||
r/w |
Whether the RTP timestamp should be scaled with the rate (speed) |
||
r |
The RTP sequence number of the last processed packet |
||
r/w |
Offset to add to all outgoing seqnum (-1 = random) |
||
r/w |
Write CSRC based on buffer meta RTP source information |
||
r/w |
The SSRC of the packets (default == random) |
||
r |
Various statistics |
||
r |
The RTP timestamp of the last processed packet |
||
r/w |
Offset to add to all outgoing timestamps (default = random) |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Add ext as an extension for writing part of an RTP header extension onto outgoing RTP packets. |
|
Clear all RTP header extensions used by this payloader. |
|
The returned ext must be configured with the correct ext_id and with the necessary attributes as required by the extension implementation. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
clock_rate |
r |
||
current_ssrc |
r |
||
dynamic |
r |
||
element |
r |
||
encoding_name |
r |
||
max_ptime |
r |
||
media |
r |
||
min_ptime |
r |
||
mtu |
r |
||
pt |
r |
||
ptime |
r |
||
ptime_multiple |
r |
||
segment |
r |
||
seqnum |
r |
||
seqnum_base |
r |
||
seqnum_offset |
r |
||
sinkpad |
r |
||
srcpad |
r |
||
ssrc |
r |
||
timestamp |
r |
||
ts_base |
r |
||
ts_offset |
r |
Class Details¶
- class GstRtp.RTPBasePayload(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
Provides a base class for RTP payloaders
- allocate_output_buffer(payload_len, pad_len, csrc_count)[source]¶
- Parameters:
- Returns:
A newly allocated buffer that can hold an RTP packet with given parameters.
- Return type:
Allocate a new
Gst.Buffer
with enough data to hold an RTP packet with minimum csrc_count CSRCs, a payload length of payload_len and padding of pad_len. If self hasGstRtp.RTPBasePayload
:source-info
True
additional CSRCs may be allocated and filled with RTP source information.New in version 1.16.
- get_source_count(buffer)[source]¶
- Parameters:
buffer (
Gst.Buffer
) – aGst.Buffer
, typically the buffer to payload- Returns:
The number of sources.
- Return type:
Count the total number of RTP sources found in the meta of buffer, which will be automically added by
GstRtp.RTPBasePayload.allocate_output_buffer
(). IfGstRtp.RTPBasePayload
:source-info
isFalse
the count will be 0.New in version 1.16.
- is_filled(size, duration)[source]¶
- Parameters:
- Returns:
True
if the packet of size and duration would exceed the configured MTU or max_ptime.- Return type:
Check if the packet with size and duration would exceed the configured maximum size.
- is_source_info_enabled()[source]¶
-
Queries whether the payloader will add contributing sources (CSRCs) to the RTP header from
GstRtp.RTPSourceMeta
.New in version 1.16.
- push(buffer)[source]¶
- Parameters:
buffer (
Gst.Buffer
) – aGst.Buffer
- Returns:
- Return type:
Push buffer to the peer element of the payloader. The SSRC, payload type, seqnum and timestamp of the RTP buffer will be updated first.
This function takes ownership of buffer.
- push_list(list)[source]¶
- Parameters:
list (
Gst.BufferList
) – aGst.BufferList
- Returns:
- Return type:
Push list to the peer element of the payloader. The SSRC, payload type, seqnum and timestamp of the RTP buffer will be updated first.
This function takes ownership of list.
- set_options(media, dynamic, encoding_name, clock_rate)[source]¶
- Parameters:
Set the rtp options of the payloader. These options will be set in the caps of the payloader. Subclasses must call this method before calling
GstRtp.RTPBasePayload.push
() or gst_rtp_base_payload_set_outcaps().
- set_outcaps_structure(s)[source]¶
- Parameters:
s (
Gst.Structure
orNone
) – aGst.Structure
with the caps fields- Returns:
True
if the caps could be set.- Return type:
Configure the output caps with the optional fields.
New in version 1.20.
- set_source_info_enabled(enable)[source]¶
- Parameters:
enable (
bool
) – whether to add contributing sources to RTP packets
Enable or disable adding contributing sources to RTP packets from
GstRtp.RTPSourceMeta
.New in version 1.16.
- do_get_caps(pad, filter) virtual¶
-
get desired caps
- do_handle_buffer(buffer) virtual¶
- Parameters:
buffer (
Gst.Buffer
) –- Return type:
process data
- do_query(pad, query) virtual¶
-
custom query handling
- do_sink_event(event) virtual¶
-
custom event handling on the sinkpad
Signal Details¶
- GstRtp.RTPBasePayload.signals.add_extension(r_t_p_base_payload, ext)¶
- Signal Name:
add-extension
- Flags:
- Parameters:
r_t_p_base_payload (
GstRtp.RTPBasePayload
) – The object which received the signalext (
GstRtp.RTPHeaderExtension
) – theGstRtp.RTPHeaderExtension
Add ext as an extension for writing part of an RTP header extension onto outgoing RTP packets.
New in version 1.20.
- GstRtp.RTPBasePayload.signals.clear_extensions(r_t_p_base_payload)¶
- Signal Name:
clear-extensions
- Flags:
- Parameters:
r_t_p_base_payload (
GstRtp.RTPBasePayload
) – The object which received the signal
Clear all RTP header extensions used by this payloader.
New in version 1.20.
- GstRtp.RTPBasePayload.signals.request_extension(r_t_p_base_payload, ext_id, ext_uri)¶
- Signal Name:
request-extension
- Flags:
- Parameters:
r_t_p_base_payload (
GstRtp.RTPBasePayload
) – The object which received the signalext_id (
int
) – the extension id being requestedext_uri (
str
) – the extension URI being requested
- Returns:
the
GstRtp.RTPHeaderExtension
for ext_id, orNone
- Return type:
The returned ext must be configured with the correct ext_id and with the necessary attributes as required by the extension implementation.
New in version 1.20.
Property Details¶
- GstRtp.RTPBasePayload.props.auto_header_extension¶
-
If enabled, the payloader will automatically try to enable all the RTP header extensions provided in the src caps, saving the application the need to handle these extensions manually using the
GstRtp.RTPBasePayload
::request-extension
: signal.New in version 1.20.
- GstRtp.RTPBasePayload.props.extensions¶
- Name:
extensions
- Type:
- Default Value:
- Flags:
A list of already enabled RTP header extensions. This may be useful for finding out which extensions are already enabled (with add-extension signal) and picking a non-conflicting ID for a new extension that needs to be added on top of the existing ones.
Note that the value returned by reading this property is not dynamically updated when the set of enabled extensions changes by any of existing action signals. Rather, it represents the current state at the time the property is read.
Dynamic updates of this property can be received by subscribing to its corresponding “notify” signal, i.e. “notify::extensions”.
New in version 1.24.
- GstRtp.RTPBasePayload.props.max_ptime¶
-
Maximum duration of the packet data in ns (-1 = unlimited up to MTU)
- GstRtp.RTPBasePayload.props.min_ptime¶
-
Minimum duration of the packet data in ns (can’t go above MTU)
- GstRtp.RTPBasePayload.props.mtu¶
-
Maximum size of one packet
- GstRtp.RTPBasePayload.props.onvif_no_rate_control¶
-
Make the payloader timestamp packets according to the Rate-Control=no behaviour specified in the ONVIF replay spec.
New in version 1.16.
- GstRtp.RTPBasePayload.props.perfect_rtptime¶
-
Try to use the offset fields to generate perfect RTP timestamps. When this option is disabled, RTP timestamps are generated from GST_BUFFER_PTS of each payloaded buffer. The PTSes of buffers may not necessarily increment with the amount of data in each input buffer, consider e.g. the case where the buffer arrives from a network which means that the PTS is unrelated to the amount of data. Because the RTP timestamps are generated from GST_BUFFER_PTS this can result in RTP timestamps that also don’t increment with the amount of data in the payloaded packet. To circumvent this it is possible to set the perfect rtptime option enabled. When this option is enabled the payloader will increment the RTP timestamps based on GST_BUFFER_OFFSET which relates to the amount of data in each packet rather than the GST_BUFFER_PTS of each buffer and therefore the RTP timestamps will more closely correlate with the amount of data in each buffer. Currently
GstRtp.RTPBasePayload
is limited to handling perfect RTP timestamps for audio streams.
- GstRtp.RTPBasePayload.props.pt¶
-
The payload type of the packets
- GstRtp.RTPBasePayload.props.ptime_multiple¶
-
Force buffers to be multiples of this duration in ns (0 disables)
- GstRtp.RTPBasePayload.props.scale_rtptime¶
-
Make the RTP packets’ timestamps be scaled with the segment’s rate (corresponding to RTSP speed parameter). Disabling this property means the timestamps will not be affected by the set delivery speed (RTSP speed).
Example: A server wants to allow streaming a recorded video in double speed but still have the timestamps correspond to the position in the video. This is achieved by the client setting RTSP Speed to 2 while the server has this property disabled.
New in version 1.18.
- GstRtp.RTPBasePayload.props.seqnum¶
-
The RTP sequence number of the last processed packet
- GstRtp.RTPBasePayload.props.seqnum_offset¶
-
Offset to add to all outgoing seqnum (-1 = random)
- GstRtp.RTPBasePayload.props.source_info¶
-
Enable writing the CSRC field in allocated RTP header based on RTP source information found in the input buffer’s
GstRtp.RTPSourceMeta
.New in version 1.16.
- GstRtp.RTPBasePayload.props.ssrc¶
-
The SSRC of the packets (default == random)
- GstRtp.RTPBasePayload.props.stats¶
- Name:
stats
- Type:
- Default Value:
- Flags:
Various payloader statistics retrieved atomically (and are therefore synchroized with each other), these can be used e.g. to generate an RTP-Info header. This property return a
Gst.Structure
named application/x-rtp-payload-stats containing the following fields relating to the last processed buffer and current state of the stream being payloaded:clock-rate
:GObject.TYPE_UINT
, clock-rate of the streamrunning-time
:GObject.TYPE_UINT64
, running timeseqnum
:GObject.TYPE_UINT
, sequence number, same asGstRtp.RTPBasePayload
:seqnum
timestamp
:GObject.TYPE_UINT
, RTP timestamp, same asGstRtp.RTPBasePayload
:timestamp
ssrc
:GObject.TYPE_UINT
, The SSRC in usept
:GObject.TYPE_UINT
, The Payload type in use, same asGstRtp.RTPBasePayload
:pt
seqnum-offset
:GObject.TYPE_UINT
, The current offset added to the seqnumtimestamp-offset
:GObject.TYPE_UINT
, The current offset added to the timestamp
- GstRtp.RTPBasePayload.props.timestamp¶
-
The RTP timestamp of the last processed packet