GstRtp.RTCPPacket¶
Fields¶
Name |
Type |
Access |
Description |
|---|---|---|---|
count |
r |
||
entry_offset |
r |
||
item_count |
r |
||
item_offset |
r |
||
length |
r |
||
offset |
r/w |
offset of packet in buffer data |
|
padding |
r |
||
rtcp |
r/w |
pointer to RTCP buffer |
|
type |
r |
Methods¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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:
Trueif the profile specific extension data was added.- Return type:
Add profile-specific extension data to self. If self already contains profile-specific extension data will be appended to the existing extension.
New in version 1.10.
- add_rb(ssrc, fractionlost, packetslost, exthighestseq, jitter, lsr, dlsr)[source]¶
- Parameters:
ssrc (
int) – data source being reportedfractionlost (
int) – fraction lost since last SR/RRpacketslost (
int) – the cumululative number of packets lostexthighestseq (
int) – the extended last sequence number receivedjitter (
int) – the interarrival jitterlsr (
int) – the last SR packet from this sourcedlsr (
int) – the delay since last SR packet
- Returns:
Trueif the packet was created. This function can returnFalseif the max MTU is exceeded or the number of report blocks is greater thanGstRtp.RTCP_MAX_RB_COUNT.- Return type:
Add a new report block to self with the given values.
- app_get_data()[source]¶
- Returns:
A pointer to the data
- Return type:
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:
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:
Get the name field of the APP self.
New in version 1.10.
- app_get_ssrc()[source]¶
- Returns:
The SSRC/CSRC.
- Return type:
Get the SSRC/CSRC field of the APP self.
New in version 1.10.
- app_get_subtype()[source]¶
- Returns:
The subtype.
- Return type:
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:
Trueif there was enough space in the packet to add this much data.- Return type:
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:
Trueif the ssrc was added. This function can returnFalseif the max MTU is exceeded or the number of sources blocks is greater thanGstRtp.RTCP_MAX_BYE_SSRC_COUNT.- Return type:
Add ssrc to the BYE self.
- bye_add_ssrcs(ssrc)[source]¶
- Parameters:
ssrc ([
int]) – an array of SSRCs to add- Returns:
Trueif the all the SSRCs were added. This function can returnFalseif the max MTU is exceeded or the number of sources blocks is greater thanGstRtp.RTCP_MAX_BYE_SSRC_COUNT.- Return type:
Adds len SSRCs in ssrc to BYE self.
- bye_get_reason()[source]¶
- Returns:
The reason for the BYE self or
Noneif the packet did not contain a reason string. The string must be freed withGLib.free() after usage.- Return type:
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:
Get the length of the reason string.
- bye_get_ssrc_count()[source]¶
- Returns:
The number of SSRC fields in self.
- Return type:
Get the number of SSRC fields in self.
- bye_set_reason(reason)[source]¶
-
Set the reason string to reason in self.
- copy_profile_specific_ext()[source]¶
- Returns:
Trueif there was valid data.- data:
result profile-specific data
- Return type:
The profile-specific extension data is copied into a new allocated memory area data. This must be freed with
GLib.free() after usage.New in version 1.10.
- fb_get_fci()[source]¶
- Returns:
a pointer to the FCI
- Return type:
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:
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:
Get the media SSRC field of the RTPFB or PSFB self.
- fb_get_sender_ssrc()[source]¶
- Returns:
the sender SSRC.
- Return type:
Get the sender SSRC field of the RTPFB or PSFB self.
- fb_get_type()[source]¶
- Returns:
The feedback message type.
- Return type:
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:
Trueif there was enough space in the packet to add this much FCI- Return type:
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) – theGstRtp.RTCPFBTypeto 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:
Get the count field in self.
- get_length()[source]¶
- Returns:
The length field of self.
- Return type:
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:
Get the packet padding of the packet pointed to by self.
- get_profile_specific_ext()[source]¶
- Returns:
Trueif there was valid data.- data:
result profile-specific data
- Return type:
New in version 1.10.
- get_profile_specific_ext_length()[source]¶
- Returns:
The number of 32-bit words containing profile-specific extension data from self.
- Return type:
New in version 1.10.
- 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:
Get the number of report blocks in self.
- get_type()[source]¶
- Returns:
The packet type or
GstRtp.RTCPType.INVALIDwhen self is not pointing to a valid packet.- Return type:
Get the packet type of the packet pointed to by self.
- move_to_next()[source]¶
-
Move the packet pointer self to the next packet in the payload. Use
GstRtp.RTCPBuffer.get_first_packet() to initialize 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:
type (
GstRtp.RTCPSDESType) – theGstRtp.RTCPSDESTypeof the SDES entrydata (
bytes) – the data
- Returns:
Trueif the item could be added,Falseif the MTU has been reached.- Return type:
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:
Trueif the item could be added,Falseif the maximum amount of items has been exceeded for the SDES packet or the MTU has been reached.- Return type:
Add a new SDES item for ssrc to self.
- sdes_copy_entry(type)[source]¶
- Parameters:
type (
GstRtp.RTCPSDESType) – result of the entry type- Returns:
Trueif there was valid data.- data:
result entry data
- Return type:
This function is like
GstRtp.RTCPPacket.sdes_get_entry() but it returns a null-terminated copy of the data instead. useGLib.free() after usage.
- sdes_get_entry(type)[source]¶
- Parameters:
type (
GstRtp.RTCPSDESType) – result of the entry type- Returns:
Trueif there was valid data.- data:
result entry data
- Return type:
Get the data of the current SDES item entry. type (when not
None) will contain the type of the entry. data (when notNone) 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:
Get the number of items in the SDES packet self.
- sdes_get_ssrc()[source]¶
- Returns:
the SSRC of the current item.
- Return type:
Get the SSRC of the current SDES item.
- set_rb(nth, ssrc, fractionlost, packetslost, exthighestseq, jitter, lsr, dlsr)[source]¶
- Parameters:
nth (
int) – the nth report block to setssrc (
int) – data source being reportedfractionlost (
int) – fraction lost since last SR/RRpacketslost (
int) – the cumululative number of packets lostexthighestseq (
int) – the extended last sequence number receivedjitter (
int) – the interarrival jitterlsr (
int) – the last SR packet from this sourcedlsr (
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:
Set the given values in the SR packet self.
- xr_get_block_length()[source]¶
- Returns:
The number of 32-bit words containing type-specific block data from self.
- Return type:
New in version 1.16.
- xr_get_block_type()[source]¶
- Returns:
The extended report block type.
- Return type:
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:
- Returns:
Trueif the report block is correctly parsed.- Return type:
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:
- Returns:
Trueif the report block returns the receipt time correctly.- Return type:
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:
Trueif the report block is correctly parsed.- Return type:
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:
Trueif the report block is correctly parsed.- Return type:
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:
- Returns:
Trueif the report block returns chunk correctly.- Return type:
Retrieve actual chunk data.
New in version 1.16.
- xr_get_rrt(timestamp)[source]¶
- Parameters:
timestamp (
int) – NTP timestamp- Returns:
Trueif the report block returns the reference time correctly.- Return type:
New in version 1.16.
- xr_get_ssrc()[source]¶
- Returns:
the ssrc.
- Return type:
Get the ssrc field of the XR self.
New in version 1.16.
- xr_get_summary_info(ssrc, begin_seq, end_seq)[source]¶
- Parameters:
- Returns:
Trueif the report block is correctly parsed.- Return type:
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:
Trueif the report block is correctly parsed.- Return type:
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:
- Returns:
Trueif the report block is correctly parsed.- Return type:
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:
Trueif the report block is correctly parsed.- Return type:
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:
- Returns:
Trueif the report block is correctly parsed.- Return type:
New in version 1.16.
- xr_get_voip_configuration_params(gmin, rx_config)[source]¶
- Parameters:
- Returns:
Trueif the report block is correctly parsed.- Return type:
New in version 1.16.
- xr_get_voip_delay_metrics(roundtrip_delay, end_system_delay)[source]¶
- Parameters:
- Returns:
Trueif the report block is correctly parsed.- Return type:
New in version 1.16.
- xr_get_voip_jitter_buffer_params(jb_nominal, jb_maximum, jb_abs_max)[source]¶
- Parameters:
- Returns:
Trueif the report block is correctly parsed.- Return type:
New in version 1.16.
- xr_get_voip_metrics_ssrc(ssrc)[source]¶
- Parameters:
ssrc (
int) – the SSRC of source- Returns:
Trueif the report block is correctly parsed.- Return type:
New in version 1.16.
- xr_get_voip_packet_metrics(loss_rate, discard_rate)[source]¶
- Parameters:
- Returns:
Trueif the report block is correctly parsed.- Return type:
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:
Trueif the report block is correctly parsed.- Return type:
New in version 1.16.