1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

http: use different classes for http and https.

This commit is contained in:
Anton Khirnov 2011-11-05 12:54:01 +01:00
parent 8ef79f42ca
commit 3b384502f2

View File

@ -57,13 +57,17 @@ static const AVOption options[] = {
{"headers", "custom HTTP headers, can override built in default headers", OFFSET(headers), AV_OPT_TYPE_STRING }, {"headers", "custom HTTP headers, can override built in default headers", OFFSET(headers), AV_OPT_TYPE_STRING },
{NULL} {NULL}
}; };
static const AVClass httpcontext_class = { #define HTTP_CLASS(flavor)\
.class_name = "HTTP", static const AVClass flavor ## _context_class = {\
.item_name = av_default_item_name, .class_name = #flavor,\
.option = options, .item_name = av_default_item_name,\
.version = LIBAVUTIL_VERSION_INT, .option = options,\
.version = LIBAVUTIL_VERSION_INT,\
}; };
HTTP_CLASS(http);
HTTP_CLASS(https);
static int http_connect(URLContext *h, const char *path, const char *hoststr, static int http_connect(URLContext *h, const char *path, const char *hoststr,
const char *auth, int *new_location); const char *auth, int *new_location);
@ -518,7 +522,7 @@ URLProtocol ff_http_protocol = {
.url_close = http_close, .url_close = http_close,
.url_get_file_handle = http_get_file_handle, .url_get_file_handle = http_get_file_handle,
.priv_data_size = sizeof(HTTPContext), .priv_data_size = sizeof(HTTPContext),
.priv_data_class = &httpcontext_class, .priv_data_class = &http_context_class,
}; };
#endif #endif
#if CONFIG_HTTPS_PROTOCOL #if CONFIG_HTTPS_PROTOCOL
@ -531,6 +535,6 @@ URLProtocol ff_https_protocol = {
.url_close = http_close, .url_close = http_close,
.url_get_file_handle = http_get_file_handle, .url_get_file_handle = http_get_file_handle,
.priv_data_size = sizeof(HTTPContext), .priv_data_size = sizeof(HTTPContext),
.priv_data_class = &httpcontext_class, .priv_data_class = &https_context_class,
}; };
#endif #endif