Class: RTCP::SR
Overview
SR: Sender Report RTCP Packet Documentation: RFC 3550, 6.4.1
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
header |V=2|P| RC | PT=SR=200 | length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| SSRC of sender |
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
sender | NTP timestamp, most significant word | info -
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
-+
| NTP timestamp, least significant word |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| RTP timestamp |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| sender's packet count |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| sender's octet count |
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
report | SSRC_1 (SSRC of first source) | block -
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
-+
1 | fraction lost | cumulative number of packets lost |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| extended highest sequence number received |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| interarrival jitter |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| last SR (LSR) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| delay since last SR (DLSR) |
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
report | SSRC_2 (SSRC of second source) | block -
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
-+
2 : ... :
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
| profile-specific extensions |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Direct Known Subclasses
Constant Summary collapse
- PT_ID =
200
Constants inherited from RTCP
Instance Attribute Summary collapse
-
#ntp_timestamp ⇒ Object
readonly
Returns the value of attribute ntp_timestamp.
-
#octet_count ⇒ Object
readonly
Returns the value of attribute octet_count.
-
#packet_count ⇒ Object
readonly
Returns the value of attribute packet_count.
-
#padding ⇒ Object
readonly
Returns the value of attribute padding.
-
#report_blocks ⇒ Object
readonly
Returns the value of attribute report_blocks.
-
#rtp_timestamp ⇒ Object
readonly
Returns the value of attribute rtp_timestamp.
-
#ssrc ⇒ Object
readonly
Returns the value of attribute ssrc.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Attributes inherited from RTCP
Instance Method Summary collapse
Methods inherited from RTCP
Instance Attribute Details
#ntp_timestamp ⇒ Object (readonly)
Returns the value of attribute ntp_timestamp.
44 45 46 |
# File 'lib/rtcp/sr.rb', line 44 def @ntp_timestamp end |
#octet_count ⇒ Object (readonly)
Returns the value of attribute octet_count.
44 45 46 |
# File 'lib/rtcp/sr.rb', line 44 def octet_count @octet_count end |
#packet_count ⇒ Object (readonly)
Returns the value of attribute packet_count.
44 45 46 |
# File 'lib/rtcp/sr.rb', line 44 def packet_count @packet_count end |
#padding ⇒ Object (readonly)
Returns the value of attribute padding.
44 45 46 |
# File 'lib/rtcp/sr.rb', line 44 def padding @padding end |
#report_blocks ⇒ Object (readonly)
Returns the value of attribute report_blocks.
44 45 46 |
# File 'lib/rtcp/sr.rb', line 44 def report_blocks @report_blocks end |
#rtp_timestamp ⇒ Object (readonly)
Returns the value of attribute rtp_timestamp.
44 45 46 |
# File 'lib/rtcp/sr.rb', line 44 def @rtp_timestamp end |
#ssrc ⇒ Object (readonly)
Returns the value of attribute ssrc.
44 45 46 |
# File 'lib/rtcp/sr.rb', line 44 def ssrc @ssrc end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
44 45 46 |
# File 'lib/rtcp/sr.rb', line 44 def version @version end |
Instance Method Details
#decode(packet_data) ⇒ Object
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/rtcp/sr.rb', line 47 def decode(packet_data) vprc, packet_type, length, @ssrc, ntp_h, ntp_l, @rtp_timestamp, @packet_count, @octet_count = packet_data.unpack('CCnN6') ensure_packet_type(packet_type) @length = 4 * (length + 1) @version, @padding, rc = decode_vprc(vprc, @length - 28) @ntp_timestamp = Time.at(ntp_h - 2208988800 + (ntp_l.to_f / 0x100000000)) @report_blocks = decode_reports(payload_data(packet_data, @length, 28), rc) self end |