GstRtp.RTCPPacket

Fields

Name Type Access Description
count int r  
entry_offset int r  
item_count int r  
item_offset int r  
length int r  
offset int r/w offset of packet in buffer data
padding bool r  
rtcp GstRtp.RTCPBuffer r/w pointer to RTCP buffer
type GstRtp.RTCPType r  

Methods

  add_profile_specific_ext (data)
  add_rb (ssrc, fractionlost, packetslost, exthighestseq, jitter, lsr, dlsr)
  app_get_data ()
  app_get_data_length ()
  app_get_name ()
  app_get_ssrc ()
  app_get_subtype ()
  app_set_data_length (wordlen)
  app_set_name (name)
  app_set_ssrc (ssrc)
  app_set_subtype (subtype)
  bye_add_ssrc (ssrc)
  bye_add_ssrcs (ssrc)
  bye_get_nth_ssrc (nth)
  bye_get_reason ()
  bye_get_reason_len ()
  bye_get_ssrc_count ()
  bye_set_reason (reason)
  copy_profile_specific_ext ()
  fb_get_fci ()
  fb_get_fci_length ()
  fb_get_media_ssrc ()
  fb_get_sender_ssrc ()
  fb_get_type ()
  fb_set_fci_length (wordlen)
  fb_set_media_ssrc (ssrc)
  fb_set_sender_ssrc (ssrc)
  fb_set_type (type)
  get_count ()
  get_length ()
  get_padding ()
  get_profile_specific_ext ()
  get_profile_specific_ext_length ()
  get_rb (nth)
  get_rb_count ()
  get_type ()
  move_to_next ()
  remove ()
  rr_get_ssrc ()
  rr_set_ssrc (ssrc)
  sdes_add_entry (type, data)
  sdes_add_item (ssrc)
  sdes_copy_entry (type)
  sdes_first_entry ()
  sdes_first_item ()
  sdes_get_entry (type)
  sdes_get_item_count ()
  sdes_get_ssrc ()
  sdes_next_entry ()
  sdes_next_item ()
  set_rb (nth, ssrc, fractionlost, packetslost, exthighestseq, jitter, lsr, dlsr)
  sr_get_sender_info ()
  sr_set_sender_info (ssrc, ntptime, rtptime, packet_count, octet_count)
  xr_first_rb ()
  xr_get_block_length ()
  xr_get_block_type ()
  xr_get_dlrr_block (nth, ssrc, last_rr, delay)
  xr_get_prt_by_seq (seq, receipt_time)
  xr_get_prt_info (ssrc, thinning, begin_seq, end_seq)
  xr_get_rle_info (ssrc, thinning, begin_seq, end_seq, chunk_count)
  xr_get_rle_nth_chunk (nth, chunk)
  xr_get_rrt (timestamp)
  xr_get_ssrc ()
  xr_get_summary_info (ssrc, begin_seq, end_seq)
  xr_get_summary_jitter (min_jitter, max_jitter, mean_jitter, dev_jitter)
  xr_get_summary_pkt (lost_packets, dup_packets)
  xr_get_summary_ttl (is_ipv4, min_ttl, max_ttl, mean_ttl, dev_ttl)
  xr_get_voip_burst_metrics (burst_density, gap_density, burst_duration, gap_duration)
  xr_get_voip_configuration_params (gmin, rx_config)
  xr_get_voip_delay_metrics (roundtrip_delay, end_system_delay)
  xr_get_voip_jitter_buffer_params (jb_nominal, jb_maximum, jb_abs_max)
  xr_get_voip_metrics_ssrc (ssrc)
  xr_get_voip_packet_metrics (loss_rate, discard_rate)
  xr_get_voip_quality_metrics (r_factor, ext_r_factor, mos_lq, mos_cq)
  xr_get_voip_signal_metrics (signal_level, noise_level, rerl, gmin)
  xr_next_rb ()

Details

class GstRtp.RTCPPacket

Data structure that points to a packet at offset in buffer. The size of the structure is made public to allow stack allocations.

add_profile_specific_ext(data)[source]
Parameters:data (bytes) – profile-specific data
Returns:True if the profile specific extension data was added.
Return type:bool

Add profile-specific extension data to self. If self already contains profile-specific extension data will be appended to the existing extension.

add_rb(ssrc, fractionlost, packetslost, exthighestseq, jitter, lsr, dlsr)[source]
Parameters:
  • ssrc (int) – data source being reported
  • fractionlost (int) – fraction lost since last SR/RR
  • packetslost (int) – the cumululative number of packets lost
  • exthighestseq (int) – the extended last sequence number received
  • jitter (int) – the interarrival jitter
  • lsr (int) – the last SR packet from this source
  • dlsr (int) – the delay since last SR packet
Returns:

True if the packet was created. This function can return False if the max MTU is exceeded or the number of report blocks is greater than GstRtp.RTCP_MAX_RB_COUNT.

Return type:

bool

Add a new report block to self with the given values.

app_get_data()[source]
Returns:A pointer to the data
Return type:int

Get the application-dependent data attached to a RTPFB or PSFB self.

New in version 1.10.

app_get_data_length()[source]
Returns:The length of data in 32-bit words.
Return type:int

Get the length of the application-dependent data attached to an APP self.

New in version 1.10.

app_get_name()[source]
Returns:The 4-byte name field, not zero-terminated.
Return type:str

Get the name field of the APP self.

New in version 1.10.

app_get_ssrc()[source]
Returns:The SSRC/CSRC.
Return type:int

Get the SSRC/CSRC field of the APP self.

New in version 1.10.

app_get_subtype()[source]
Returns:The subtype.
Return type:int

Get the subtype field of the APP self.

New in version 1.10.

app_set_data_length(wordlen)[source]
Parameters:wordlen (int) – Length of the data in 32-bit words
Returns:True if there was enough space in the packet to add this much data.
Return type:bool

Set the length of the application-dependent data attached to an APP self.

New in version 1.10.

app_set_name(name)[source]
Parameters:name (str) – 4-byte ASCII name

Set the name field of the APP self.

New in version 1.10.

app_set_ssrc(ssrc)[source]
Parameters:ssrc (int) – SSRC/CSRC of the packet

Set the SSRC/CSRC field of the APP self.

New in version 1.10.

app_set_subtype(subtype)[source]
Parameters:subtype (int) – subtype of the packet

Set the subtype field of the APP self.

New in version 1.10.

bye_add_ssrc(ssrc)[source]
Parameters:ssrc (int) – an SSRC to add
Returns:True if the ssrc was added. This function can return False if the max MTU is exceeded or the number of sources blocks is greater than GstRtp.RTCP_MAX_BYE_SSRC_COUNT.
Return type:bool

Add ssrc to the BYE self.

bye_add_ssrcs(ssrc)[source]
Parameters:ssrc ([int]) – an array of SSRCs to add
Returns:True if the all the SSRCs were added. This function can return False if the max MTU is exceeded or the number of sources blocks is greater than GstRtp.RTCP_MAX_BYE_SSRC_COUNT.
Return type:bool

Adds len SSRCs in ssrc to BYE self.

bye_get_nth_ssrc(nth)[source]
Parameters:nth (int) – the nth SSRC to get
Returns:The nth SSRC of self.
Return type:int

Get the nth SSRC of the BYE self.

bye_get_reason()[source]
Returns:The reason for the BYE self or None if the packet did not contain a reason string. The string must be freed with GLib.free() after usage.
Return type:str

Get the reason in self.

bye_get_reason_len()[source]
Returns:The length of the reason string or 0 when there is no reason string present.
Return type:int

Get the length of the reason string.

bye_get_ssrc_count()[source]
Returns:The number of SSRC fields in self.
Return type:int

Get the number of SSRC fields in self.

bye_set_reason(reason)[source]
Parameters:reason (str) – a reason string
Returns:True if the string could be set.
Return type:bool

Set the reason string to reason in self.

copy_profile_specific_ext()[source]
Returns:True if there was valid data.
data:result profile-specific data
Return type:(bool, data: bytes)

The profile-specific extension data is copied into a new allocated memory area data. This must be freed with GLib.free() after usage.

fb_get_fci()[source]
Returns:a pointer to the FCI
Return type:int

Get the Feedback Control Information attached to a RTPFB or PSFB self.

fb_get_fci_length()[source]
Returns:The length of the FCI in 32-bit words.
Return type:int

Get the length of the Feedback Control Information attached to a RTPFB or PSFB self.

fb_get_media_ssrc()[source]
Returns:the media SSRC.
Return type:int

Get the media SSRC field of the RTPFB or PSFB self.

fb_get_sender_ssrc()[source]
Returns:the sender SSRC.
Return type:int

Get the sender SSRC field of the RTPFB or PSFB self.

fb_get_type()[source]
Returns:The feedback message type.
Return type:GstRtp.RTCPFBType

Get the feedback message type of the FB self.

fb_set_fci_length(wordlen)[source]
Parameters:wordlen (int) – Length of the FCI in 32-bit words
Returns:True if there was enough space in the packet to add this much FCI
Return type:bool

Set the length of the Feedback Control Information attached to a RTPFB or PSFB self.

fb_set_media_ssrc(ssrc)[source]
Parameters:ssrc (int) – a media SSRC

Set the media SSRC field of the RTPFB or PSFB self.

fb_set_sender_ssrc(ssrc)[source]
Parameters:ssrc (int) – a sender SSRC

Set the sender SSRC field of the RTPFB or PSFB self.

fb_set_type(type)[source]
Parameters:type (GstRtp.RTCPFBType) – the GstRtp.RTCPFBType to set

Set the feedback message type of the FB self.

get_count()[source]
Returns:The count field in self or -1 if self does not point to a valid packet.
Return type:int

Get the count field in self.

get_length()[source]
Returns:The length field of self.
Return type:int

Get the length field of self. This is the length of the packet in 32-bit words minus one.

get_padding()[source]
Returns:If the packet has the padding bit set.
Return type:bool

Get the packet padding of the packet pointed to by self.

get_profile_specific_ext()[source]
Returns:True if there was valid data.
data:result profile-specific data
Return type:(bool, data: bytes)
get_profile_specific_ext_length()[source]
Returns:The number of 32-bit words containing profile-specific extension data from self.
Return type:int
get_rb(nth)[source]
Parameters:nth (int) – the nth report block in self
Returns:
ssrc:result for data source being reported
fractionlost:result for fraction lost since last SR/RR
packetslost:result for the cumululative number of packets lost
exthighestseq:result for the extended last sequence number received
jitter:result for the interarrival jitter
lsr:result for the last SR packet from this source
dlsr:result for the delay since last SR packet
Return type:(ssrc: int, fractionlost: int, packetslost: int, exthighestseq: int, jitter: int, lsr: int, dlsr: int)

Parse the values of the nth report block in self and store the result in the values.

get_rb_count()[source]
Returns:The number of report blocks in self.
Return type:int

Get the number of report blocks in self.

get_type()[source]
Returns:The packet type or GstRtp.RTCPType.INVALID when self is not pointing to a valid packet.
Return type:GstRtp.RTCPType

Get the packet type of the packet pointed to by self.

move_to_next()[source]
Returns:True if self is pointing to a valid packet after calling this function.
Return type:bool

Move the packet pointer self to the next packet in the payload. Use GstRtp.RTCPBuffer.get_first_packet() to initialize self.

remove()[source]
Returns:True if self is pointing to a valid packet after calling this function.
Return type:bool

Removes the packet pointed to by self and moves pointer to the next one

rr_get_ssrc()[source]
Returns:the ssrc.
Return type:int

Get the ssrc field of the RR self.

rr_set_ssrc(ssrc)[source]
Parameters:ssrc (int) – the SSRC to set

Set the ssrc field of the RR self.

sdes_add_entry(type, data)[source]
Parameters:
Returns:

True if the item could be added, False if the MTU has been reached.

Return type:

bool

Add a new SDES entry to the current item in self.

sdes_add_item(ssrc)[source]
Parameters:ssrc (int) – the SSRC of the new item to add
Returns:True if the item could be added, False if the maximum amount of items has been exceeded for the SDES packet or the MTU has been reached.
Return type:bool

Add a new SDES item for ssrc to self.

sdes_copy_entry(type)[source]
Parameters:type (GstRtp.RTCPSDESType) – result of the entry type
Returns:True if there was valid data.
data:result entry data
Return type:(bool, data: bytes)

This function is like GstRtp.RTCPPacket.sdes_get_entry() but it returns a null-terminated copy of the data instead. use GLib.free() after usage.

sdes_first_entry()[source]
Returns:True if there was a first entry.
Return type:bool

Move to the first SDES entry in the current item.

sdes_first_item()[source]
Returns:True if there was a first item.
Return type:bool

Move to the first SDES item in self.

sdes_get_entry(type)[source]
Parameters:type (GstRtp.RTCPSDESType) – result of the entry type
Returns:True if there was valid data.
data:result entry data
Return type:(bool, data: bytes)

Get the data of the current SDES item entry. type (when not None) will contain the type of the entry. data (when not None) will point to len bytes.

When type refers to a text item, data will point to a UTF8 string. Note that this UTF8 string is NOT null-terminated. Use GstRtp.RTCPPacket.sdes_copy_entry() to get a null-terminated copy of the entry.

sdes_get_item_count()[source]
Returns:The number of items in self.
Return type:int

Get the number of items in the SDES packet self.

sdes_get_ssrc()[source]
Returns:the SSRC of the current item.
Return type:int

Get the SSRC of the current SDES item.

sdes_next_entry()[source]
Returns:True if there was a next entry.
Return type:bool

Move to the next SDES entry in the current item.

sdes_next_item()[source]
Returns:True if there was a next item.
Return type:bool

Move to the next SDES item in self.

set_rb(nth, ssrc, fractionlost, packetslost, exthighestseq, jitter, lsr, dlsr)[source]
Parameters:
  • nth (int) – the nth report block to set
  • ssrc (int) – data source being reported
  • fractionlost (int) – fraction lost since last SR/RR
  • packetslost (int) – the cumululative number of packets lost
  • exthighestseq (int) – the extended last sequence number received
  • jitter (int) – the interarrival jitter
  • lsr (int) – the last SR packet from this source
  • dlsr (int) – the delay since last SR packet

Set the nth new report block in self with the given values.

Note: Not implemented.

sr_get_sender_info()[source]
Returns:
ssrc:result SSRC
ntptime:result NTP time
rtptime:result RTP time
packet_count:result packet count
octet_count:result octet count
Return type:(ssrc: int, ntptime: int, rtptime: int, packet_count: int, octet_count: int)

Parse the SR sender info and store the values.

sr_set_sender_info(ssrc, ntptime, rtptime, packet_count, octet_count)[source]
Parameters:
  • ssrc (int) – the SSRC
  • ntptime (int) – the NTP time
  • rtptime (int) – the RTP time
  • packet_count (int) – the packet count
  • octet_count (int) – the octet count

Set the given values in the SR packet self.

xr_first_rb()[source]
Returns:True if there was a first extended report block.
Return type:bool

Move to the first extended report block in XR self.

New in version 1.16.

xr_get_block_length()[source]
Returns:The number of 32-bit words containing type-specific block data from self.
Return type:int

New in version 1.16.

xr_get_block_type()[source]
Returns:The extended report block type.
Return type:GstRtp.RTCPXRType

Get the extended report block type of the XR self.

New in version 1.16.

xr_get_dlrr_block(nth, ssrc, last_rr, delay)[source]
Parameters:
  • nth (int) – the index of sub-block to retrieve.
  • ssrc (int) – the SSRC of the receiver.
  • last_rr (int) – the last receiver reference timestamp of ssrc.
  • delay (int) – the delay since last_rr.
Returns:

True if the report block is correctly parsed.

Return type:

bool

Parse the extended report block for DLRR report block type.

New in version 1.16.

xr_get_prt_by_seq(seq, receipt_time)[source]
Parameters:
  • seq (int) – the sequence to retrieve the time.
  • receipt_time (int) – the packet receipt time of seq.
Returns:

True if the report block returns the receipt time correctly.

Return type:

bool

Retrieve the packet receipt time of seq which ranges in [begin_seq, end_seq).

New in version 1.16.

xr_get_prt_info(ssrc, thinning, begin_seq, end_seq)[source]
Parameters:
  • ssrc (int) – the SSRC of the RTP data packet source being reported upon by this report block.
  • thinning (int) – the amount of thinning performed on the sequence number space.
  • begin_seq (int) – the first sequence number that this block reports on.
  • end_seq (int) – the last sequence number that this block reports on plus one.
Returns:

True if the report block is correctly parsed.

Return type:

bool

Parse the Packet Recept Times Report Block from a XR self

New in version 1.16.

xr_get_rle_info(ssrc, thinning, begin_seq, end_seq, chunk_count)[source]
Parameters:
  • ssrc (int) – the SSRC of the RTP data packet source being reported upon by this report block.
  • thinning (int) – the amount of thinning performed on the sequence number space.
  • begin_seq (int) – the first sequence number that this block reports on.
  • end_seq (int) – the last sequence number that this block reports on plus one.
  • chunk_count (int) – the number of chunks calculated by block length.
Returns:

True if the report block is correctly parsed.

Return type:

bool

Parse the extended report block for Loss RLE and Duplicated LRE block type.

New in version 1.16.

xr_get_rle_nth_chunk(nth, chunk)[source]
Parameters:
  • nth (int) – the index of chunk to retrieve.
  • chunk (int) – the nth chunk.
Returns:

True if the report block returns chunk correctly.

Return type:

bool

Retrieve actual chunk data.

New in version 1.16.

xr_get_rrt(timestamp)[source]
Parameters:timestamp (int) – NTP timestamp
Returns:True if the report block returns the reference time correctly.
Return type:bool

New in version 1.16.

xr_get_ssrc()[source]
Returns:the ssrc.
Return type:int

Get the ssrc field of the XR self.

New in version 1.16.

xr_get_summary_info(ssrc, begin_seq, end_seq)[source]
Parameters:
  • ssrc (int) – the SSRC of the source.
  • begin_seq (int) – the first sequence number that this block reports on.
  • end_seq (int) – the last sequence number that this block reports on plus one.
Returns:

True if the report block is correctly parsed.

Return type:

bool

Extract a basic information from static summary report block of XR self.

New in version 1.16.

xr_get_summary_jitter(min_jitter, max_jitter, mean_jitter, dev_jitter)[source]
Parameters:
  • min_jitter (int) – the minimum relative transit time between two sequences.
  • max_jitter (int) – the maximum relative transit time between two sequences.
  • mean_jitter (int) – the mean relative transit time between two sequences.
  • dev_jitter (int) – the standard deviation of the relative transit time between two sequences.
Returns:

True if the report block is correctly parsed.

Return type:

bool

Extract jitter information from the statistics summary. If the jitter flag in a block header is set as zero, all of jitters will be zero.

New in version 1.16.

xr_get_summary_pkt(lost_packets, dup_packets)[source]
Parameters:
  • lost_packets (int) – the number of lost packets between begin_seq and end_seq.
  • dup_packets (int) – the number of duplicate packets between begin_seq and end_seq.
Returns:

True if the report block is correctly parsed.

Return type:

bool

Get the number of lost or duplicate packets. If the flag in a block header is set as zero, lost_packets or dup_packets will be zero.

New in version 1.16.

xr_get_summary_ttl(is_ipv4, min_ttl, max_ttl, mean_ttl, dev_ttl)[source]
Parameters:
  • is_ipv4 (bool) – the flag to indicate that the return values are ipv4 ttl or ipv6 hop limits.
  • min_ttl (int) – the minimum TTL or Hop Limit value of data packets between two sequences.
  • max_ttl (int) – the maximum TTL or Hop Limit value of data packets between two sequences.
  • mean_ttl (int) – the mean TTL or Hop Limit value of data packets between two sequences.
  • dev_ttl (int) – the standard deviation of the TTL or Hop Limit value of data packets between two sequences.
Returns:

True if the report block is correctly parsed.

Return type:

bool

Extract the value of ttl for ipv4, or hop limit for ipv6.

New in version 1.16.

xr_get_voip_burst_metrics(burst_density, gap_density, burst_duration, gap_duration)[source]
Parameters:
  • burst_density (int) – the fraction of RTP data packets within burst periods.
  • gap_density (int) – the fraction of RTP data packets within inter-burst gaps.
  • burst_duration (int) – the mean duration(ms) of the burst periods.
  • gap_duration (int) – the mean duration(ms) of the gap periods.
Returns:

True if the report block is correctly parsed.

Return type:

bool

New in version 1.16.

xr_get_voip_configuration_params(gmin, rx_config)[source]
Parameters:
  • gmin (int) – the gap threshold.
  • rx_config (int) – the receiver configuration byte.
Returns:

True if the report block is correctly parsed.

Return type:

bool

New in version 1.16.

xr_get_voip_delay_metrics(roundtrip_delay, end_system_delay)[source]
Parameters:
  • roundtrip_delay (int) – the most recently calculated round trip time between RTP interfaces(ms)
  • end_system_delay (int) – the most recently estimated end system delay(ms)
Returns:

True if the report block is correctly parsed.

Return type:

bool

New in version 1.16.

xr_get_voip_jitter_buffer_params(jb_nominal, jb_maximum, jb_abs_max)[source]
Parameters:
  • jb_nominal (int) – the current nominal jitter buffer delay(ms)
  • jb_maximum (int) – the current maximum jitter buffer delay(ms)
  • jb_abs_max (int) – the absolute maximum delay(ms)
Returns:

True if the report block is correctly parsed.

Return type:

bool

New in version 1.16.

xr_get_voip_metrics_ssrc(ssrc)[source]
Parameters:ssrc (int) – the SSRC of source
Returns:True if the report block is correctly parsed.
Return type:bool

New in version 1.16.

xr_get_voip_packet_metrics(loss_rate, discard_rate)[source]
Parameters:
  • loss_rate (int) – the fraction of RTP data packets from the source lost.
  • discard_rate (int) – the fraction of RTP data packets from the source that have been discarded.
Returns:

True if the report block is correctly parsed.

Return type:

bool

New in version 1.16.

xr_get_voip_quality_metrics(r_factor, ext_r_factor, mos_lq, mos_cq)[source]
Parameters:
  • r_factor (int) – the R factor is a voice quality metric describing the segment of the call.
  • ext_r_factor (int) – the external R factor is a voice quality metric.
  • mos_lq (int) – the estimated mean opinion score for listening quality.
  • mos_cq (int) – the estimated mean opinion score for conversational quality.
Returns:

True if the report block is correctly parsed.

Return type:

bool

New in version 1.16.

xr_get_voip_signal_metrics(signal_level, noise_level, rerl, gmin)[source]
Parameters:
  • signal_level (int) – the ratio of the signal level to a 0 dBm reference.
  • noise_level (int) – the ratio of the silent period background noise level to a 0 dBm reference.
  • rerl (int) – the residual echo return loss value.
  • gmin (int) – the gap threshold.
Returns:

True if the report block is correctly parsed.

Return type:

bool

New in version 1.16.

xr_next_rb()[source]
Returns:True if there was a next extended report block.
Return type:bool

Move to the next extended report block in XR self.

New in version 1.16.