Revision 9e164392 libavformat/rdt.c

View differences:

libavformat/rdt.c
184 184
    }
185 185
    if (len < 10)
186 186
        return -1;
187
    /**
188
     * Layout of the header (in bits):
189
     * 1:  len_included
190
     *     Flag indicating whether this header includes a length field;
191
     *     this can be used to concatenate multiple RDT packets in a
192
     *     single UDP/TCP data frame and is used to precede RDT data
193
     *     by stream status packets
194
     * 1:  need_reliable
195
     *     Flag indicating whether this header includes a "reliable
196
     *     sequence number"; these are apparently sequence numbers of
197
     *     data packets alone. For data packets, this flag is always
198
     *     set, according to the Real documentation [1]
199
     * 5:  set_id
200
     *     ID of a set of streams of identical content, possibly with
201
     *     different codecs or bitrates
202
     * 1:  is_reliable
203
     *     Flag set for certain streams deemed less tolerable for packet
204
     *     loss
205
     * 16: seq_no
206
     *     Packet sequence number; if >=0xFF00, this is a non-data packet
207
     *     containing stream status info, the second byte indicates the
208
     *     type of status packet (see wireshark docs / source code [2])
209
     * if (len_included) {
210
     *     16: packet_len
211
     * } else {
212
     *     packet_len = remainder of UDP/TCP frame
213
     * }
214
     * 1:  is_back_to_back
215
     *     Back-to-Back flag; used for timing, set for one in every 10
216
     *     packets, according to the Real documentation [1]
217
     * 1:  is_slow_data
218
     *     Slow-data flag; currently unused, according to Real docs [1]
219
     * 5:  stream_id
220
     *     ID of the stream within this particular set of streams
221
     * 1:  is_no_keyframe
222
     *     Non-keyframe flag (unset if packet belongs to a keyframe)
223
     * 32: timestamp (PTS)
224
     * if (set_id == 0x1F) {
225
     *     16: set_id (extended set-of-streams ID; see set_id)
226
     * }
227
     * if (need_reliable) {
228
     *     16: reliable_seq_no
229
     *         Reliable sequence number (see need_reliable)
230
     * }
231
     * if (stream_id == 0x3F) {
232
     *     16: stream_id (extended stream ID; see stream_id)
233
     * }
234
     * [1] https://protocol.helixcommunity.org/files/2005/devdocs/RDT_Feature_Level_20.txt
235
     * [2] http://www.wireshark.org/docs/dfref/r/rdt.html and
236
     *     http://anonsvn.wireshark.org/viewvc/trunk/epan/dissectors/packet-rdt.c
237
     */
187 238
    if (sn)  *sn  = (buf[0]>>1) & 0x1f;
188 239
    if (seq) *seq = AV_RB16(buf+1);
189 240
    if (ts)  *ts  = AV_RB32(buf+4);

Also available in: Unified diff