Class: RTCP::APP

Inherits:
RTCP
  • Object
show all
Defined in:
lib/rtcp/app.rb

Overview

APP: Application-Defined RTCP Packet Documentation: RFC 3550, 6.7

 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|V=2|P| subtype |   PT=APP=204  |             length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           SSRC/CSRC                           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                          name (ASCII)                         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                   application-dependent data                ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 0                   1                   2                   3

Constant Summary collapse

PT_ID =
204

Constants inherited from RTCP

VERSION

Instance Attribute Summary collapse

Attributes inherited from RTCP

#length, #type_id

Instance Method Summary collapse

Methods inherited from RTCP

decode, decode_all, #to_s

Instance Attribute Details

#app_dataObject (readonly)

Returns the value of attribute app_data.



21
22
23
# File 'lib/rtcp/app.rb', line 21

def app_data
  @app_data
end

#nameObject (readonly)

Returns the value of attribute name.



21
22
23
# File 'lib/rtcp/app.rb', line 21

def name
  @name
end

#ssrcObject (readonly)

Returns the value of attribute ssrc.



21
22
23
# File 'lib/rtcp/app.rb', line 21

def ssrc
  @ssrc
end

#subtypeObject (readonly)

Returns the value of attribute subtype.



21
22
23
# File 'lib/rtcp/app.rb', line 21

def subtype
  @subtype
end

#versionObject (readonly)

Returns the value of attribute version.



21
22
23
# File 'lib/rtcp/app.rb', line 21

def version
  @version
end

Instance Method Details

#decode(packet_data) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/rtcp/app.rb', line 23

def decode(packet_data) 
  vpst, packet_type, length, @ssrc, @name = packet_data.unpack('CCnNa4')
  ensure_packet_type(packet_type)

  @length  = 4 * (length + 1)
  @version = vpst >> 6
  @subtype = vpst & 31

  @app_data = payload_data(packet_data, @length, 12)

  self
end