diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2012-11-11 23:44:28 +0400 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2012-11-14 23:38:51 +0400 |
commit | 8034130e06b03859af9ce64f7ee653cd14df328d (patch) | |
tree | ac5d06c32f27347f96c147599f2e6129178c6e1e /libavformat/rtpenc_chain.c | |
parent | 3b4296f41473a5b39e84d7a49d480624c9c60040 (diff) |
rtp: set the payload type as stream id
Support multiple video/audio streams with different format in the
same session.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavformat/rtpenc_chain.c')
-rw-r--r-- | libavformat/rtpenc_chain.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libavformat/rtpenc_chain.c b/libavformat/rtpenc_chain.c index 3742099314..adc432aa00 100644 --- a/libavformat/rtpenc_chain.c +++ b/libavformat/rtpenc_chain.c @@ -23,13 +23,15 @@ #include "avio_internal.h" #include "rtpenc_chain.h" #include "avio_internal.h" +#include "rtp.h" #include "libavutil/opt.h" int ff_rtp_chain_mux_open(AVFormatContext **out, AVFormatContext *s, - AVStream *st, URLContext *handle, int packet_size) + AVStream *st, URLContext *handle, int packet_size, + int idx) { AVFormatContext *rtpctx = NULL; - int ret; + int ret, pt; AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL); uint8_t *rtpflags; AVDictionary *opts = NULL; @@ -57,6 +59,12 @@ int ff_rtp_chain_mux_open(AVFormatContext **out, AVFormatContext *s, rtpctx->max_delay = s->max_delay; /* Copy other stream parameters. */ rtpctx->streams[0]->sample_aspect_ratio = st->sample_aspect_ratio; + /* Get the payload type from the codec */ + if (st->id < RTP_PT_PRIVATE) + rtpctx->streams[0]->id = + ff_rtp_get_payload_type(rtpctx, st->codec, idx); + else + rtpctx->streams[0]->id = st->id; if (av_opt_get(s, "rtpflags", AV_OPT_SEARCH_CHILDREN, &rtpflags) >= 0) av_dict_set(&opts, "rtpflags", rtpflags, AV_DICT_DONT_STRDUP_VAL); |