From 985b05d3c91c9edbf9501307878daa4eba223e1d Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Wed, 1 Oct 2008 12:37:07 +0000 Subject: This patch refactors RDT packet header parsing so that it can be used in rtsp.c to detect the ID of the packet source also in case of TCP streams. This allows proper playback of RDT streams with multiple stream types, e.g. audio + video. Accepted by LucaB in "RDT/Realmedia patches #2" thread on ML. Originally committed as revision 15496 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/rdt.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libavformat/rdt.h') diff --git a/libavformat/rdt.h b/libavformat/rdt.h index 5a13127fb5..2fe11873ac 100644 --- a/libavformat/rdt.h +++ b/libavformat/rdt.h @@ -56,6 +56,20 @@ void ff_rdt_subscribe_rule(char *cmd, int size, void ff_rdt_subscribe_rule2(RTPDemuxContext *s, char *cmd, int size, int stream_nr, int rule_nr); +/** + * Parse RDT-style packet header. + * + * @param buf input buffer + * @param len length of input buffer + * @param sn will be set to the stream number this packet belongs to + * @param seq will be set to the sequence number this packet belongs to + * @param rn will be set to the rule number this packet belongs to + * @param ts will be set to the timestamp of the packet + * @return the amount of bytes consumed, or <0 on error + */ +int ff_rdt_parse_header(const uint8_t *buf, int len, + int *sn, int *seq, int *rn, uint32_t *ts); + /** * Parse RDT-style packet data (header + media data). * Usage similar to rtp_parse_packet(). -- cgit v1.2.3