diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-15 16:05:00 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-15 16:05:34 +0100 |
commit | b52925d2cde98b2a3ffaf451248191c8627d356a (patch) | |
tree | b5bc13efa1c4f0151fb47fecf295935000c71dc7 /libavformat/rtsp.c | |
parent | e7e0186eeb0a0aa1e2ca805b97eb60cbd14e0567 (diff) | |
parent | 2f3bada63e57345329c4f9b48e9b81b5cfc03d05 (diff) | |
download | ffmpeg-b52925d2cde98b2a3ffaf451248191c8627d356a.tar.gz |
Merge commit '2f3bada63e57345329c4f9b48e9b81b5cfc03d05'
* commit '2f3bada63e57345329c4f9b48e9b81b5cfc03d05':
lavf: Add a protocol for SRTP encryption/decryption
rtsp: Support decryption of SRTP signalled via RFC 4568 (SDES)
Conflicts:
libavformat/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r-- | libavformat/rtsp.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 0582a00f8c..23ce65c0bf 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -480,6 +480,14 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1, s->nb_streams > 0) { st = s->streams[s->nb_streams - 1]; st->codec->sample_rate = atoi(p); + } else if (av_strstart(p, "crypto:", &p) && s->nb_streams > 0) { + // RFC 4568 + rtsp_st = rt->rtsp_streams[rt->nb_rtsp_streams - 1]; + get_word(buf1, sizeof(buf1), &p); // ignore tag + get_word(rtsp_st->crypto_suite, sizeof(rtsp_st->crypto_suite), &p); + p += strspn(p, SPACE_CHARS); + if (av_strstart(p, "inline:", &p)) + get_word(rtsp_st->crypto_params, sizeof(rtsp_st->crypto_params), &p); } else { if (rt->server_type == RTSP_SERVER_WMS) ff_wms_parse_sdp_a_line(s, p); @@ -653,6 +661,10 @@ int ff_rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st) rtsp_st->dynamic_protocol_context, rtsp_st->dynamic_handler); } + if (rtsp_st->crypto_suite[0]) + ff_rtp_parse_set_crypto(rtsp_st->transport_priv, + rtsp_st->crypto_suite, + rtsp_st->crypto_params); } return 0; |