# HG changeset patch # User rbultje # Date 1226687878 0 # Node ID 175eeb7a88d5dbad86b69488440035f5fa6f4193 # Parent 9be14682f7b32f6853973e2894bb698f9765a2f3 Add comment describing the RDT packet header. See discussion in "[PATCH] RDT/Realmedia patches #2" thread on the mailinglist. diff -r 9be14682f7b3 -r 175eeb7a88d5 rdt.c --- a/rdt.c Fri Nov 14 03:45:31 2008 +0000 +++ b/rdt.c Fri Nov 14 18:37:58 2008 +0000 @@ -184,6 +184,57 @@ } if (len < 10) return -1; + /** + * Layout of the header (in bits): + * 1: len_included + * Flag indicating whether this header includes a length field; + * this can be used to concatenate multiple RDT packets in a + * single UDP/TCP data frame and is used to precede RDT data + * by stream status packets + * 1: need_reliable + * Flag indicating whether this header includes a "reliable + * sequence number"; these are apparently sequence numbers of + * data packets alone. For data packets, this flag is always + * set, according to the Real documentation [1] + * 5: set_id + * ID of a set of streams of identical content, possibly with + * different codecs or bitrates + * 1: is_reliable + * Flag set for certain streams deemed less tolerable for packet + * loss + * 16: seq_no + * Packet sequence number; if >=0xFF00, this is a non-data packet + * containing stream status info, the second byte indicates the + * type of status packet (see wireshark docs / source code [2]) + * if (len_included) { + * 16: packet_len + * } else { + * packet_len = remainder of UDP/TCP frame + * } + * 1: is_back_to_back + * Back-to-Back flag; used for timing, set for one in every 10 + * packets, according to the Real documentation [1] + * 1: is_slow_data + * Slow-data flag; currently unused, according to Real docs [1] + * 5: stream_id + * ID of the stream within this particular set of streams + * 1: is_no_keyframe + * Non-keyframe flag (unset if packet belongs to a keyframe) + * 32: timestamp (PTS) + * if (set_id == 0x1F) { + * 16: set_id (extended set-of-streams ID; see set_id) + * } + * if (need_reliable) { + * 16: reliable_seq_no + * Reliable sequence number (see need_reliable) + * } + * if (stream_id == 0x3F) { + * 16: stream_id (extended stream ID; see stream_id) + * } + * [1] https://protocol.helixcommunity.org/files/2005/devdocs/RDT_Feature_Level_20.txt + * [2] http://www.wireshark.org/docs/dfref/r/rdt.html and + * http://anonsvn.wireshark.org/viewvc/trunk/epan/dissectors/packet-rdt.c + */ if (sn) *sn = (buf[0]>>1) & 0x1f; if (seq) *seq = AV_RB16(buf+1); if (ts) *ts = AV_RB32(buf+4);