[FFmpeg-cvslog] http: Add an option for forcing basic authentication

Martin Storsjö git at videolan.org
Mon Oct 14 00:36:19 CEST 2013


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Wed Oct  9 12:14:02 2013 +0300| [eb8b05a3824a9fa85e20d603595ac8a3b83505d4] | committer: Martin Storsjö

http: Add an option for forcing basic authentication

The default is to autodetect the auth method. This does require one
extra request (and also closing and reopening the http connection).
For some cases such as HTTP POST, the autodetection is not handled
properly (yet).

No option is added for digest, since this method requires getting
nonce parameters from the server first and can't be used straight
away like Basic.

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=eb8b05a3824a9fa85e20d603595ac8a3b83505d4
---

 libavformat/http.c    |    3 +++
 libavformat/version.h |    2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/http.c b/libavformat/http.c
index 57b9569..890150b 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -78,6 +78,9 @@ static const AVOption options[] = {
 {"headers", "custom HTTP headers, can override built in default headers", OFFSET(headers), AV_OPT_TYPE_STRING, { 0 }, 0, 0, D|E },
 {"multiple_requests", "use persistent connections", OFFSET(multiple_requests), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, D|E },
 {"post_data", "custom HTTP post data", OFFSET(post_data), AV_OPT_TYPE_BINARY, .flags = D|E },
+{"auth_type", "HTTP authentication type", OFFSET(auth_state.auth_type), AV_OPT_TYPE_INT, {.i64 = HTTP_AUTH_NONE}, HTTP_AUTH_NONE, HTTP_AUTH_BASIC, D|E, "auth_type" },
+{"none", "No auth method set, autodetect", 0, AV_OPT_TYPE_CONST, {.i64 = HTTP_AUTH_NONE}, 0, 0, D|E, "auth_type" },
+{"basic", "HTTP basic authentication", 0, AV_OPT_TYPE_CONST, {.i64 = HTTP_AUTH_BASIC}, 0, 0, D|E, "auth_type" },
 {NULL}
 };
 #define HTTP_CLASS(flavor)\
diff --git a/libavformat/version.h b/libavformat/version.h
index 7a01f06..a705492 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -31,7 +31,7 @@
 
 #define LIBAVFORMAT_VERSION_MAJOR 55
 #define LIBAVFORMAT_VERSION_MINOR  6
-#define LIBAVFORMAT_VERSION_MICRO  0
+#define LIBAVFORMAT_VERSION_MICRO  1
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
                                                LIBAVFORMAT_VERSION_MINOR, \



More information about the ffmpeg-cvslog mailing list