#include "libavutil/avstring.h"#include "avformat.h"#include <unistd.h>#include "internal.h"#include "network.h"#include "http.h"#include "os_support.h"#include "httpauth.h"#include "url.h"#include "libavutil/opt.h"Go to the source code of this file.
Data Structures | |
| struct | HTTPContext |
Defines | |
| #define | BUFFER_SIZE 1024 |
| #define | MAX_REDIRECTS 8 |
| #define | OFFSET(x) offsetof(HTTPContext, x) |
| #define | D AV_OPT_FLAG_DECODING_PARAM |
| #define | E AV_OPT_FLAG_ENCODING_PARAM |
| #define | HTTP_CLASS(flavor) |
Functions | |
| HTTP_CLASS (http) | |
| HTTP_CLASS (https) | |
| static int | http_connect (URLContext *h, const char *path, const char *local_path, const char *hoststr, const char *auth, const char *proxyauth, int *new_location) |
| void | ff_http_init_auth_state (URLContext *dest, const URLContext *src) |
| Initialize the authentication state based on another HTTP URLContext. | |
| static int | http_open_cnx (URLContext *h) |
| static int | http_open (URLContext *h, const char *uri, int flags) |
| static int | http_getc (HTTPContext *s) |
| static int | http_get_line (HTTPContext *s, char *line, int line_size) |
| static int | process_line (URLContext *h, char *line, int line_count, int *new_location) |
| static int | has_header (const char *str, const char *header) |
| static int | http_buf_read (URLContext *h, uint8_t *buf, int size) |
| static int | http_read (URLContext *h, uint8_t *buf, int size) |
| static int | http_write (URLContext *h, const uint8_t *buf, int size) |
| static int | http_close (URLContext *h) |
| static int64_t | http_seek (URLContext *h, int64_t off, int whence) |
| static int | http_get_file_handle (URLContext *h) |
| static int | http_proxy_close (URLContext *h) |
| static int | http_proxy_open (URLContext *h, const char *uri, int flags) |
| static int | http_proxy_write (URLContext *h, const uint8_t *buf, int size) |
Variables | |
| static const AVOption | options [] |
| URLProtocol | ff_http_protocol |
| URLProtocol | ff_https_protocol |
| URLProtocol | ff_httpproxy_protocol |
| #define BUFFER_SIZE 1024 |
Definition at line 37 of file http.c.
Referenced by http_getc().
| #define HTTP_CLASS | ( | flavor | ) |
static const AVClass flavor ## _context_class = {\ .class_name = #flavor,\ .item_name = av_default_item_name,\ .option = options,\ .version = LIBAVUTIL_VERSION_INT,\ }
| #define MAX_REDIRECTS 8 |
Definition at line 38 of file http.c.
Referenced by http_open_cnx().
| #define OFFSET | ( | x | ) | offsetof(HTTPContext, x) |
| void ff_http_init_auth_state | ( | URLContext * | dest, | |
| const URLContext * | src | |||
| ) |
Initialize the authentication state based on another HTTP URLContext.
This can be used to pre-initialize the authentication parameters if they are known beforehand, to avoid having to do an initial failing request just to get the parameters.
| dest | URL context whose authentication state gets updated | |
| src | URL context whose authentication state gets copied |
Definition at line 79 of file http.c.
Referenced by ff_rtsp_connect().
| static int has_header | ( | const char * | str, | |
| const char * | header | |||
| ) | [inline, static] |
Definition at line 313 of file http.c.
Referenced by http_connect().
| static int http_buf_read | ( | URLContext * | h, | |
| uint8_t * | buf, | |||
| int | size | |||
| ) | [static] |
Definition at line 418 of file http.c.
Referenced by http_read().
| HTTP_CLASS | ( | https | ) |
| HTTP_CLASS | ( | http | ) |
| static int http_close | ( | URLContext * | h | ) | [static] |
| static int http_connect | ( | URLContext * | h, | |
| const char * | path, | |||
| const char * | local_path, | |||
| const char * | hoststr, | |||
| const char * | auth, | |||
| const char * | proxyauth, | |||
| int * | new_location | |||
| ) | [static] |
Definition at line 321 of file http.c.
Referenced by http_open_cnx().
| static int http_get_file_handle | ( | URLContext * | h | ) | [static] |
| static int http_get_line | ( | HTTPContext * | s, | |
| char * | line, | |||
| int | line_size | |||
| ) | [static] |
Definition at line 214 of file http.c.
Referenced by http_connect(), http_proxy_open(), and http_read().
| static int http_getc | ( | HTTPContext * | s | ) | [static] |
Definition at line 197 of file http.c.
Referenced by http_get_line().
| static int http_open | ( | URLContext * | h, | |
| const char * | uri, | |||
| int | flags | |||
| ) | [static] |
| static int http_open_cnx | ( | URLContext * | h | ) | [static] |
Definition at line 89 of file http.c.
Referenced by http_open(), and http_seek().
| static int http_proxy_close | ( | URLContext * | h | ) | [static] |
Definition at line 587 of file http.c.
Referenced by http_proxy_open().
| static int http_proxy_open | ( | URLContext * | h, | |
| const char * | uri, | |||
| int | flags | |||
| ) | [static] |
| static int http_proxy_write | ( | URLContext * | h, | |
| const uint8_t * | buf, | |||
| int | size | |||
| ) | [static] |
| static int http_read | ( | URLContext * | h, | |
| uint8_t * | buf, | |||
| int | size | |||
| ) | [static] |
| static int64_t http_seek | ( | URLContext * | h, | |
| int64_t | off, | |||
| int | whence | |||
| ) | [static] |
| static int http_write | ( | URLContext * | h, | |
| const uint8_t * | buf, | |||
| int | size | |||
| ) | [static] |
| static int process_line | ( | URLContext * | h, | |
| char * | line, | |||
| int | line_count, | |||
| int * | new_location | |||
| ) | [static] |
Definition at line 238 of file http.c.
Referenced by http_connect(), and http_proxy_open().
{
.name = "http",
.url_open = http_open,
.url_read = http_read,
.url_write = http_write,
.url_seek = http_seek,
.url_close = http_close,
.url_get_file_handle = http_get_file_handle,
.priv_data_size = sizeof(HTTPContext),
.priv_data_class = &http_context_class,
.flags = URL_PROTOCOL_FLAG_NETWORK,
}
{
.name = "httpproxy",
.url_open = http_proxy_open,
.url_read = http_buf_read,
.url_write = http_proxy_write,
.url_close = http_proxy_close,
.url_get_file_handle = http_get_file_handle,
.priv_data_size = sizeof(HTTPContext),
.flags = URL_PROTOCOL_FLAG_NETWORK,
}
{
.name = "https",
.url_open = http_open,
.url_read = http_read,
.url_write = http_write,
.url_seek = http_seek,
.url_close = http_close,
.url_get_file_handle = http_get_file_handle,
.priv_data_size = sizeof(HTTPContext),
.priv_data_class = &https_context_class,
.flags = URL_PROTOCOL_FLAG_NETWORK,
}