diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2013-07-11 23:05:53 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2013-07-11 23:05:53 +0200 |
commit | 0fff7f039c148a91dde41772d2dc26dd0efb5f89 (patch) | |
tree | dcd5583fde5ad787a598575b34a327316b8b0700 /libavformat/rtsp.c | |
parent | 43d36599fe3330913c6be9da5519dee048263dc9 (diff) | |
download | ffmpeg-0fff7f039c148a91dde41772d2dc26dd0efb5f89.tar.gz |
Supply a User-Agent header when opening rtsp streams.
Some rtsp servers like the IP Cam IcyBox IB-CAM2002 need it.
Fixes ticket #2761.
Reported, analyzed and tested by trac user imavra.
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r-- | libavformat/rtsp.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 6310d79c28..5421bb2a6f 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -62,6 +62,8 @@ #define DEC AV_OPT_FLAG_DECODING_PARAM #define ENC AV_OPT_FLAG_ENCODING_PARAM +#define DEFAULT_USER_AGENT "Lavf/" AV_STRINGIFY(LIBAVFORMAT_VERSION) + #define RTSP_FLAG_OPTS(name, longname) \ { name, longname, OFFSET(rtsp_flags), AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX, DEC, "rtsp_flags" }, \ { "filter_src", "Only receive packets from the negotiated peer IP", 0, AV_OPT_TYPE_CONST, {.i64 = RTSP_FLAG_FILTER_SRC}, 0, 0, DEC, "rtsp_flags" }, \ @@ -91,6 +93,7 @@ const AVOption ff_rtsp_options[] = { { "timeout", "Maximum timeout (in seconds) to wait for incoming connections. -1 is infinite. Implies flag listen", OFFSET(initial_timeout), AV_OPT_TYPE_INT, {.i64 = -1}, INT_MIN, INT_MAX, DEC }, { "stimeout", "timeout (in micro seconds) of socket i/o operations.", OFFSET(stimeout), AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, INT_MAX, DEC }, RTSP_REORDERING_OPTS(), + { "user-agent", "override User-Agent header", OFFSET(user_agent), AV_OPT_TYPE_STRING, {.str = DEFAULT_USER_AGENT}, 0, 0, DEC }, { NULL }, }; |