Skip to content

Instantly share code, notes, and snippets.

@gyf304
Created October 8, 2019 22:05
Show Gist options
  • Save gyf304/b2beaa95b1ceca63e69a8774f505851c to your computer and use it in GitHub Desktop.
Save gyf304/b2beaa95b1ceca63e69a8774f505851c to your computer and use it in GitHub Desktop.
meta:
id: rtp_packet
file-extension: rtp
endian: be
license: CC0-1.0
doc-ref: https://tools.ietf.org/html/rfc3550
seq:
- id: version
type: b2
- id: has_padding
type: b1
- id: has_extension
type: b1
- id: crsc_count
type: b4
- id: marker
type: b1
- id: payload_type
type: b7
- id: sequence_number
type: u2
- id: timestamp
type: u4
- id: ssrc
type: u4
- id: csrc
type: u4
repeat: expr
repeat-expr: crsc_count
- id: header_extension
type: header_extension
if: has_extension
- id: payload
size: has_padding ? _io.size - _io.pos - padding_len : _io.size - _io.pos
- id: padding
size: padding_len
if: has_padding
instances:
padding_len:
pos: _io.size - 1
type: u1
types:
header_extension:
seq:
- id: identifier
type: u2
- id: length
type: u2
- id: payload
size: length
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment