From b5c4bb989d4085625f212b9b6378e4ee0a1a9ca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Mon, 9 Aug 2010 10:31:59 +0000 Subject: [PATCH] rtpenc_xiph: Set the ident value via a define Originally committed as revision 24749 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/rtp.h | 6 ++++++ libavformat/rtpenc_xiph.c | 8 ++++---- libavformat/sdp.c | 6 +++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/libavformat/rtp.h b/libavformat/rtp.h index 7834f9deb8..333ed33d8b 100644 --- a/libavformat/rtp.h +++ b/libavformat/rtp.h @@ -76,4 +76,10 @@ enum CodecID ff_rtp_codec_id(const char *buf, enum AVMediaType codec_type); #define RTCP_TX_RATIO_NUM 5 #define RTCP_TX_RATIO_DEN 1000 +/* An arbitrary id value for RTP Xiph streams - only relevant to indicate + * the the configuration has changed within a stream (by changing the + * ident value sent). + */ +#define RTP_XIPH_IDENT 0xfecdba + #endif /* AVFORMAT_RTP_H */ diff --git a/libavformat/rtpenc_xiph.c b/libavformat/rtpenc_xiph.c index 82de5f8faf..10576c230e 100644 --- a/libavformat/rtpenc_xiph.c +++ b/libavformat/rtpenc_xiph.c @@ -52,13 +52,13 @@ void ff_rtp_send_xiph(AVFormatContext *s1, const uint8_t *buff, int size) break; } - // Set ident. Must match the one in sdp.c + // Set ident. // Probably need a non-fixed way of generating // this, but it has to be done in SDP and passed in from there. q = s->buf; - *q++ = 0xfe; - *q++ = 0xcd; - *q++ = 0xba; + *q++ = (RTP_XIPH_IDENT >> 16) & 0xff; + *q++ = (RTP_XIPH_IDENT >> 8) & 0xff; + *q++ = (RTP_XIPH_IDENT ) & 0xff; // set fragment // 0 - whole frame (possibly multiple frames) diff --git a/libavformat/sdp.c b/libavformat/sdp.c index e140cc7c7b..ab5ef400bb 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -267,9 +267,9 @@ static char *xiph_extradata2config(AVCodecContext *c) config[0] = config[1] = config[2] = 0; config[3] = 1; - config[4] = 0xfe; // ident must match the one in rtpenc_xiph.c - config[5] = 0xcd; - config[6] = 0xba; + config[4] = (RTP_XIPH_IDENT >> 16) & 0xff; + config[5] = (RTP_XIPH_IDENT >> 8) & 0xff; + config[6] = (RTP_XIPH_IDENT ) & 0xff; config[7] = (headers_len >> 8) & 0xff; config[8] = headers_len & 0xff; config[9] = 2;