Class: RTP::Packet

Inherits:
BinData::Record
  • Object
show all
Defined in:
lib/rtp/packet.rb

Overview

Decodes a single RTP packet into a Hash, so the packet can inspected and used accordingly. Form more info on types, see bindata.

Instance Method Summary collapse

Instance Method Details

#csrc_countBinData::Bit4

Returns:

  • (BinData::Bit4)

25
# File 'lib/rtp/packet.rb', line 25

bit4 :csrc_count

#csrc_idsBinData::Array

Returns:

  • (BinData::Array)

43
# File 'lib/rtp/packet.rb', line 43

array :csrc_ids, :type => :uint32, :initial_length => lambda { csrc_count }

#extensionBinData::Bit1

Returns:

  • (BinData::Bit1)

22
# File 'lib/rtp/packet.rb', line 22

bit1 :extension

#extension_idBinData::Uint16be

Returns:

  • (BinData::Uint16be)

50
# File 'lib/rtp/packet.rb', line 50

uint16 :extension_id, onlyif: :has_extension?

#extension_lengthBinData::Uint16be

Returns:

  • (BinData::Uint16be)

53
# File 'lib/rtp/packet.rb', line 53

uint16 :extension_length, onlyif: :has_extension?

#has_extension?Boolean

Returns:

  • (Boolean)

75
76
77
# File 'lib/rtp/packet.rb', line 75

def has_extension?
  extension == 1
end

#markerBinData::Bit1

Returns:

  • (BinData::Bit1)

28
# File 'lib/rtp/packet.rb', line 28

bit1 :marker

#paddingBinData::Bit1

Returns:

  • (BinData::Bit1)

19
# File 'lib/rtp/packet.rb', line 19

bit1 :padding

#payload_typeBinData::Bit7

Returns:

  • (BinData::Bit7)

31
# File 'lib/rtp/packet.rb', line 31

bit7 :payload_type

#rtp_payloadBinData::String

Returns:

  • (BinData::String)

73
# File 'lib/rtp/packet.rb', line 73

string :rtp_payload, read_length: lambda { bytes_remaining }

#sequence_numberBinData::Uint16be

Returns:

  • (BinData::Uint16be)

34
# File 'lib/rtp/packet.rb', line 34

uint16 :sequence_number

#ssrc_idBinData::Uint32be

Returns:

  • (BinData::Uint32be)

40
# File 'lib/rtp/packet.rb', line 40

uint32 :ssrc_id

#timestampBinData::Uint32be

Returns:

  • (BinData::Uint32be)

37
# File 'lib/rtp/packet.rb', line 37

uint32 :timestamp

#versionBinData::Bit2

Returns:

  • (BinData::Bit2)

16
# File 'lib/rtp/packet.rb', line 16

bit2 :version