diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2009-03-20 01:11:08 +0000 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2009-03-20 01:11:08 +0000 |
commit | e9fce261a65dabea2a8d67039c3ae093e0f288c8 (patch) | |
tree | bde1ad6fab128bb25ef2e776ca7c690896a7c069 /libavformat/rtp_asf.c | |
parent | 20f93c3ccf03f258a5bb658565665a68b61f4996 (diff) | |
download | ffmpeg-e9fce261a65dabea2a8d67039c3ae093e0f288c8.tar.gz |
Assign the x-pf-asf payload string to be decoded by rtp_asf.c, and add a
SDP line handler that parses the streamID in the SDP so that ASF stream
data can be matched to their respective streams in the RTSP demuxer. See
"[PATCH] RTSP-MS 12/15: ASF payload support" thread on mailinglist.
Originally committed as revision 18061 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtp_asf.c')
-rw-r--r-- | libavformat/rtp_asf.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/libavformat/rtp_asf.c b/libavformat/rtp_asf.c index 9876356648..b64f4707f8 100644 --- a/libavformat/rtp_asf.c +++ b/libavformat/rtp_asf.c @@ -27,6 +27,7 @@ #include <libavutil/base64.h> #include <libavutil/avstring.h> +#include "rtp.h" #include "rtp_asf.h" #include "rtsp.h" #include "asf.h" @@ -50,3 +51,41 @@ void ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p) rt->asf_ctx->pb = NULL; } } + +static int +asfrtp_parse_sdp_line (AVFormatContext *s, int stream_index, + PayloadContext *asf, const char *line) +{ + if (av_strstart(line, "stream:", &line)) { + RTSPState *rt = s->priv_data; + + s->streams[stream_index]->id = strtol(line, NULL, 10); + + if (rt->asf_ctx) { + int i; + + for (i = 0; i < rt->asf_ctx->nb_streams; i++) { + if (s->streams[stream_index]->id == rt->asf_ctx->streams[i]->id) { + *s->streams[stream_index]->codec = + *rt->asf_ctx->streams[i]->codec; + rt->asf_ctx->streams[i]->codec->extradata_size = 0; + rt->asf_ctx->streams[i]->codec->extradata = NULL; + av_set_pts_info(s->streams[stream_index], 32, 1, 1000); + } + } + } + } + + return 0; +} + +#define RTP_ASF_HANDLER(n, s, t) \ +RTPDynamicProtocolHandler ff_ms_rtp_ ## n ## _handler = { \ + s, \ + t, \ + CODEC_ID_NONE, \ + asfrtp_parse_sdp_line, \ +}; + +RTP_ASF_HANDLER(asf_pfv, "x-asf-pf", CODEC_TYPE_VIDEO); +RTP_ASF_HANDLER(asf_pfa, "x-asf-pf", CODEC_TYPE_AUDIO); |