From 0558e266a267b5d90d3be1d8d86e60db2c303773 Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Wed, 18 May 2011 15:41:06 +0300 Subject: sdp: Allow passing an AVFormatContext to the SDP generation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Options from the AVFormatContext can be read for modifying the generated SDP. Signed-off-by: Martin Storsjö --- libavformat/sdp.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'libavformat/sdp.c') diff --git a/libavformat/sdp.c b/libavformat/sdp.c index f72e2c567f..b996bf65f5 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -300,7 +300,7 @@ xiph_fail: return NULL; } -static char *sdp_write_media_attributes(char *buff, int size, AVCodecContext *c, int payload_type) +static char *sdp_write_media_attributes(char *buff, int size, AVCodecContext *c, int payload_type, AVFormatContext *fmt) { char *config = NULL; @@ -449,7 +449,7 @@ static char *sdp_write_media_attributes(char *buff, int size, AVCodecContext *c, return buff; } -void ff_sdp_write_media(char *buff, int size, AVCodecContext *c, const char *dest_addr, const char *dest_type, int port, int ttl) +void ff_sdp_write_media(char *buff, int size, AVCodecContext *c, const char *dest_addr, const char *dest_type, int port, int ttl, AVFormatContext *fmt) { const char *type; int payload_type; @@ -472,7 +472,7 @@ void ff_sdp_write_media(char *buff, int size, AVCodecContext *c, const char *des av_strlcatf(buff, size, "b=AS:%d\r\n", c->bit_rate / 1000); } - sdp_write_media_attributes(buff, size, c, payload_type); + sdp_write_media_attributes(buff, size, c, payload_type, fmt); } int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size) @@ -521,7 +521,8 @@ int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size) for (j = 0; j < ac[i]->nb_streams; j++) { ff_sdp_write_media(buf, size, ac[i]->streams[j]->codec, dst[0] ? dst : NULL, - dst_type, (port > 0) ? port + j * 2 : 0, ttl); + dst_type, (port > 0) ? port + j * 2 : 0, ttl, + ac[i]); if (port <= 0) { av_strlcatf(buf, size, "a=control:streamid=%d\r\n", i + j); @@ -537,7 +538,7 @@ int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size) return AVERROR(ENOSYS); } -void ff_sdp_write_media(char *buff, int size, AVCodecContext *c, const char *dest_addr, const char *dest_type, int port, int ttl) +void ff_sdp_write_media(char *buff, int size, AVCodecContext *c, const char *dest_addr, const char *dest_type, int port, int ttl, AVFormatContext *fmt) { } #endif -- cgit v1.2.3