GstRtp.RTPBaseDepayload¶
- Subclasses:
None
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 |
Max seqnum reorder before assuming sender has restarted |
||
r/w |
Add RTP source information as buffer meta |
||
r |
Various statistics |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Add ext as an extension for reading part of an RTP header extension from incoming RTP packets. |
|
Clear all RTP header extensions used by this depayloader. |
|
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 |
||
need_newsegment |
r |
||
parent |
r |
||
segment |
r |
||
sinkpad |
r |
||
srcpad |
r |
Class Details¶
- class GstRtp.RTPBaseDepayload(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
Provides a base class for RTP depayloaders
In order to handle RTP header extensions correctly if the depayloader aggregates multiple RTP packet payloads into one output buffer this class provides the function
GstRtp.RTPBaseDepayload.set_aggregate_hdrext_enabled
(). If the aggregation is enabled the virtual functions GstRTPBaseDepayload.process or GstRTPBaseDepayload.process_rtp_packet must tell the base class what happens to the current RTP packet. By default the base class assumes that the packet payload is used with the next output buffer.If the RTP packet will not be used with an output buffer
GstRtp.RTPBaseDepayload.dropped
() must be called. A typical situation would be if we are waiting for a keyframe.If the RTP packet will be used but not with the current output buffer but with the next one
GstRtp.RTPBaseDepayload.delayed
() must be called. This may happen if the current RTP packet signals the start of a new output buffer and the currently processed output buffer will be pushed first. The undelay happens implicitly once the current buffer has been pushed orGstRtp.RTPBaseDepayload.flush
() has been called.If
GstRtp.RTPBaseDepayload.flush
() is called all RTP packets that have not been dropped since the last output buffer are dropped, e.g. if an output buffer is discarded due to malformed data. This may or may not include the current RTP packet depending on the 2nd parameter keep_current.Be aware that in case
GstRtp.RTPBaseDepayload.push_list
() is used each buffer will see the same list of RTP header extensions.- delayed()[source]¶
Called from GstRTPBaseDepayload.process or GstRTPBaseDepayload.process_rtp_packet when the depayloader needs to keep the current input RTP header for use with the next output buffer.
The delayed buffer will remain until the end of processing the current output buffer and then enqueued for processing with the next output buffer.
A typical use-case is when the depayloader implementation will start a new output buffer for the current input RTP buffer but push the current output buffer first.
Must be called with the stream lock held.
New in version 1.24.
- dropped()[source]¶
Called from GstRTPBaseDepayload.process or GstRTPBaseDepayload.process_rtp_packet if the depayloader does not use the current buffer for the output buffer. This will either drop the delayed buffer or the last buffer from the header extension cache.
A typical use-case is when the depayloader implementation is dropping an input RTP buffer while waiting for the first keyframe.
Must be called with the stream lock held.
New in version 1.24.
- flush(keep_current)[source]¶
- Parameters:
keep_current (
bool
) – if the current RTP buffer shall be kept
If GstRTPBaseDepayload.process or GstRTPBaseDepayload.process_rtp_packet drop an output buffer this function tells the base class to flush header extension cache as well.
This will not drop an input RTP header marked as delayed from
GstRtp.RTPBaseDepayload.delayed
().If keep_current is
True
the current input RTP header will be kept and enqueued after flushing the previous input RTP headers.A typical use-case for keep_current is when the depayloader implementation invalidates the current output buffer and starts a new one with the current RTP input buffer.
Must be called with the stream lock held.
New in version 1.24.
- is_aggregate_hdrext_enabled()[source]¶
-
Queries whether header extensions will be aggregated per depayloaded buffers.
New in version 1.24.
- is_source_info_enabled()[source]¶
-
Queries whether
GstRtp.RTPSourceMeta
will be added to depayloaded buffers.New in version 1.16.
- push(out_buf)[source]¶
- Parameters:
out_buf (
Gst.Buffer
) – aGst.Buffer
- Returns:
- Return type:
Push out_buf to the peer of self. This function takes ownership of out_buf.
This function will by default apply the last incoming timestamp on the outgoing buffer when it didn’t have a timestamp already.
- push_list(out_list)[source]¶
- Parameters:
out_list (
Gst.BufferList
) – aGst.BufferList
- Returns:
- Return type:
Push out_list to the peer of self. This function takes ownership of out_list.
- set_aggregate_hdrext_enabled(enable)[source]¶
- Parameters:
enable (
bool
) – whether to aggregate header extensions per output buffer
Enable or disable aggregating header extensions.
New in version 1.24.
- set_source_info_enabled(enable)[source]¶
- Parameters:
enable (
bool
) – whether to add meta about RTP sources to buffer
Enable or disable adding
GstRtp.RTPSourceMeta
to depayloaded buffers.New in version 1.16.
- do_handle_event(event) virtual¶
-
custom event handling
- do_packet_lost(event) virtual¶
-
signal the depayloader about packet loss
- do_process(in_) virtual¶
- Parameters:
in (
Gst.Buffer
) –- Return type:
process incoming rtp packets. Subclass must implement either this method or process_rtp_packet to process incoming rtp packets. If the child returns a buffer without a valid timestamp, the timestamp of the provided buffer will be applied to the result buffer and the buffer will be pushed. If this function returns
None
, nothing is pushed.
- do_process_rtp_packet(rtp_buffer) virtual¶
- Parameters:
rtp_buffer (
GstRtp.RTPBuffer
) –- Return type:
Same as the process virtual function, but slightly more efficient, since it is passed the rtp buffer structure that has already been mapped (with
Gst.MapFlags.READ
) by the base class and thus does not have to be mapped again by the subclass. Can be used by the subclass to process incoming rtp packets. If the subclass returns a buffer without a valid timestamp, the timestamp of the input buffer will be applied to the result buffer and the output buffer will be pushed out. If this function returnsNone
, nothing is pushed out.New in version 1.6.
Signal Details¶
- GstRtp.RTPBaseDepayload.signals.add_extension(r_t_p_base_depayload, ext)¶
- Signal Name:
add-extension
- Flags:
- Parameters:
r_t_p_base_depayload (
GstRtp.RTPBaseDepayload
) – The object which received the signalext (
GstRtp.RTPHeaderExtension
) – theGstRtp.RTPHeaderExtension
Add ext as an extension for reading part of an RTP header extension from incoming RTP packets.
New in version 1.20.
- GstRtp.RTPBaseDepayload.signals.clear_extensions(r_t_p_base_depayload)¶
- Signal Name:
clear-extensions
- Flags:
- Parameters:
r_t_p_base_depayload (
GstRtp.RTPBaseDepayload
) – The object which received the signal
Clear all RTP header extensions used by this depayloader.
New in version 1.20.
- GstRtp.RTPBaseDepayload.signals.request_extension(r_t_p_base_depayload, ext_id, ext_uri)¶
- Signal Name:
request-extension
- Flags:
- Parameters:
r_t_p_base_depayload (
GstRtp.RTPBaseDepayload
) – The object which received the signalext_id (
int
) – the extension id 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.RTPBaseDepayload.props.auto_header_extension¶
-
If enabled, the depayloader will automatically try to enable all the RTP header extensions provided in the sink caps, saving the application the need to handle these extensions manually using the
GstRtp.RTPBaseDepayload
::request-extension
: signal.New in version 1.20.
- GstRtp.RTPBaseDepayload.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.RTPBaseDepayload.props.max_reorder¶
-
Max seqnum reorder before the sender is assumed to have restarted.
When max-reorder is set to 0 all reordered/duplicate packets are considered coming from a restarted sender.
New in version 1.18.
- GstRtp.RTPBaseDepayload.props.source_info¶
-
Add RTP source information found in RTP header as meta to output buffer.
New in version 1.16.
- GstRtp.RTPBaseDepayload.props.stats¶
- Name:
stats
- Type:
- Default Value:
- Flags:
Various depayloader statistics retrieved atomically (and are therefore synchroized with each other). This property return a
Gst.Structure
named application/x-rtp-depayload-stats containing the following fields relating to the last processed buffer and current state of the stream being depayloaded:clock-rate
:GObject.TYPE_UINT
, clock-rate of the streamnpt-start
:GObject.TYPE_UINT64
, time of playback startnpt-stop
:GObject.TYPE_UINT64
, time of playback stopplay-speed
:GObject.TYPE_DOUBLE
, the playback speedplay-scale
:GObject.TYPE_DOUBLE
, the playback scalerunning-time-dts
:GObject.TYPE_UINT64
, the last running-time of the last DTSrunning-time-pts
:GObject.TYPE_UINT64
, the last running-time of the last PTSseqnum
:GObject.TYPE_UINT
, the last seen seqnumtimestamp
:GObject.TYPE_UINT
, the last seen RTP timestamp