49 #define BUFFER_SIZE (MAX_URL_SIZE + HTTP_HEADERS_SIZE) 50 #define MAX_REDIRECTS 8 54 #define WHITESPACES " \n\t\r" 81 #if FF_API_HTTP_USER_AGENT 82 char *user_agent_deprecated;
113 z_stream inflate_stream;
134 #define OFFSET(x) offsetof(HTTPContext, x) 135 #define D AV_OPT_FLAG_DECODING_PARAM 136 #define E AV_OPT_FLAG_ENCODING_PARAM 137 #define DEFAULT_USER_AGENT "Lavf/" AV_STRINGIFY(LIBAVFORMAT_VERSION) 147 #if FF_API_HTTP_USER_AGENT 154 {
"cookies",
"set cookies to be sent in applicable future requests, use newline delimited Set-Cookie HTTP field value syntax",
OFFSET(
cookies),
AV_OPT_TYPE_STRING, { .str =
NULL }, 0, 0, D },
160 {
"none",
"No auth method set, autodetect", 0,
AV_OPT_TYPE_CONST, { .i64 =
HTTP_AUTH_NONE }, 0, 0, D |
E,
"auth_type"},
180 const char *hoststr,
const char *auth,
181 const char *proxyauth,
int *new_location);
197 const char *path, *proxy_path, *lower_proto =
"tcp", *local_path;
199 char hostname[1024], hoststr[1024], proto[10];
200 char auth[1024], proxyauth[1024] =
"";
203 int port, use_proxy, err, location_changed = 0;
207 hostname,
sizeof(hostname), &port,
215 if (!strcmp(proto,
"https")) {
224 hashmark = strchr(path1,
'#');
228 if (path1[0] ==
'\0') {
230 }
else if (path1[0] ==
'?') {
231 snprintf(sanitized_path,
sizeof(sanitized_path),
"/%s", path1);
232 path = sanitized_path;
244 hostname,
sizeof(hostname), &port,
NULL, 0, proxy_path);
258 auth, proxyauth, &location_changed);
262 return location_changed;
267 const char *status_group;
276 status_group =
"4xx";
280 status_group =
"5xx";
303 int location_changed, attempts = 0, redirects = 0;
304 int reconnect_delay = 0;
315 if (location_changed < 0) {
320 av_log(h,
AV_LOG_WARNING,
"Will reconnect at %"PRIu64
" in %d second(s).\n", off, reconnect_delay);
322 if (location_changed !=
AVERROR(ETIMEDOUT))
324 reconnect_delay = 1 + 2 * reconnect_delay;
352 location_changed == 1) {
361 location_changed = 0;
369 if (location_changed < 0)
370 return location_changed;
398 char hostname1[1024], hostname2[1024], proto1[10], proto2[10];
407 hostname1,
sizeof(hostname1), &port1,
410 hostname2,
sizeof(hostname2), &port2,
412 if (port1 != port2 || strncmp(hostname1, hostname2,
sizeof(hostname2)) != 0) {
413 av_log(h,
AV_LOG_ERROR,
"Cannot reuse HTTP connection for different host: %s:%d != %s:%d\n",
449 switch (status_code) {
456 if (status_code >= 400 && status_code <= 499)
458 else if (status_code >= 500)
461 return default_averror;
470 content_type =
"text/plain";
474 switch (status_code) {
478 reply_text =
"Bad Request";
483 reply_text =
"Forbidden";
488 reply_text =
"Not Found";
498 reply_text =
"Internal server error";
505 message_len =
snprintf(message,
sizeof(message),
506 "HTTP/1.1 %03d %s\r\n" 507 "Content-Type: %s\r\n" 515 strlen(reply_text) + 6,
521 message_len =
snprintf(message,
sizeof(message),
522 "HTTP/1.1 %03d %s\r\n" 523 "Content-Type: %s\r\n" 524 "Transfer-Encoding: chunked\r\n" 546 int ret, err, new_location;
584 char hostname[1024], proto[10];
586 const char *lower_proto =
"tcp";
588 av_url_split(proto,
sizeof(proto),
NULL, 0, hostname,
sizeof(hostname), &port,
590 if (!strcmp(proto,
"https"))
592 ff_url_join(lower_url,
sizeof(lower_url), lower_proto,
NULL, hostname, port,
631 if (len < 2 || strcmp(
"\r\n", s->
headers + len - 2)) {
633 "No trailing CRLF found in HTTP header. Adding it.\n");
664 cc = (*c)->priv_data;
684 }
else if (len == 0) {
706 if (q > line && q[-1] ==
'\r')
712 if ((q - line) < line_size - 1)
723 if (http_code >= 400 && http_code < 600 &&
738 new_loc =
av_strdup(redirected_location);
752 if (!strncmp(p,
"bytes ", 6)) {
754 s->
off = strtoull(p,
NULL, 10);
755 if ((slash = strchr(p,
'/')) && strlen(slash) > 0)
770 inflateEnd(&s->inflate_stream);
771 if (inflateInit2(&s->inflate_stream, 32 + 15) != Z_OK) {
773 s->inflate_stream.msg);
776 if (zlibCompileFlags() & (1 << 17)) {
778 "Your zlib was compiled without gzip support.\n");
783 "Compressed (%s) content, need zlib with gzip support\n", p);
798 int len = 4 + strlen(p) + strlen(tag);
825 for (i = 0, j = 0; exp_str[
i] !=
'\0' && j < exp_buf_len; i++) {
826 if ((exp_str[i] >=
'0' && exp_str[i] <=
'9') ||
827 (exp_str[i] >=
'A' && exp_str[i] <=
'Z') ||
828 (exp_str[i] >=
'a' && exp_str[i] <=
'z')) {
829 exp_buf[j] = exp_str[
i];
837 while ((*expiry < '0' || *expiry >
'9') && *expiry !=
'\0')
845 char *param, *next_param, *cstr, *back;
846 char *saveptr =
NULL;
855 back = &cstr[strlen(cstr)-1];
864 while ((param =
av_strtok(next_param,
";", &saveptr))) {
868 if ((name =
av_strtok(param,
"=", &value))) {
892 if (!cookie_entry || !cookie_entry->
value) {
899 struct tm new_tm = {0};
911 if (e2 && e2->
value) {
915 if (e2 && e2->
value) {
916 struct tm old_tm = {0};
933 if (!(eql = strchr(p,
'=')))
return AVERROR(EINVAL);
949 len += strlen(e->
key) + strlen(e->
value) + 1;
953 if (*cookies)
av_free(*cookies);
955 if (!*cookies)
return AVERROR(ENOMEM);
974 if (line[0] ==
'\0') {
980 if (line_count == 0) {
990 av_log(h,
AV_LOG_ERROR,
"Received and expected HTTP method do not match. (%s expected, %s received)\n",
999 "(%s autodetected %s received)\n", auto_method, method);
1032 while (*p !=
'/' && *p !=
'\0')
1050 while (*p !=
'\0' && *p !=
':')
1070 !strncmp(p,
"bytes", 5) &&
1084 if (!strcmp(p,
"close"))
1125 char *cookie, *set_cookies, *next;
1126 char *saveptr =
NULL;
1139 while ((cookie =
av_strtok(next,
"\n", &saveptr)) && !ret) {
1154 if (!cookie_entry || !cookie_entry->
value)
1159 struct tm tm_buf = {0};
1169 int domain_offset = strlen(domain) - strlen(e->
value);
1170 if (domain_offset < 0)
1252 #define NEEDS_ESCAPE(ch) \ 1253 ((ch) <= ' ' || (ch) >= '\x7f' || \ 1254 (ch) == '"' || (ch) == '%' || (ch) == '<' || (ch) == '>' || (ch) == '\\' || \ 1255 (ch) == '^' || (ch) == '`' || (ch) == '{' || (ch) == '}' || (ch) == '|') 1259 while (*path && q - buf <
sizeof(buf) - 4) {
1275 const char *hoststr,
const char *auth,
1276 const char *proxyauth,
int *new_location)
1281 char *authstr =
NULL, *proxyauthstr =
NULL;
1301 method = post ?
"POST" :
"GET";
1304 local_path, method);
1306 local_path, method);
1312 send_expect_100 = 0;
1317 if (auth && *auth &&
1320 send_expect_100 = 1;
1324 #if FF_API_HTTP_USER_AGENT 1335 av_bprintf(&request,
"Transfer-Encoding: chunked\r\n");
1356 av_bprintf(&request,
"Expect: 100-continue\r\n");
1362 av_bprintf(&request,
"Host: %s\r\n", hoststr);
1370 if (!
get_cookies(s, &cookies, path, hoststr) && cookies) {
1371 av_bprintf(&request,
"Cookie: %s\r\n", cookies);
1385 av_bprintf(&request,
"Proxy-%s", proxyauthstr);
1396 if ((err =
ffurl_write(s->
hd, request.str, request.len)) < 0)
1416 if (post && !s->
post_data && !send_expect_100) {
1433 err = (off == s->
off) ? 0 : -1;
1461 "Chunked encoding data size: %"PRIu64
"\n",
1498 "Stream ends prematurely at %"PRIu64
", should be %"PRIu64
"\n",
1515 #define DECOMPRESS_BUF_SIZE (256 * 1024) 1521 if (!s->inflate_buffer) {
1522 s->inflate_buffer =
av_malloc(DECOMPRESS_BUF_SIZE);
1523 if (!s->inflate_buffer)
1527 if (s->inflate_stream.avail_in == 0) {
1528 int read =
http_buf_read(h, s->inflate_buffer, DECOMPRESS_BUF_SIZE);
1531 s->inflate_stream.next_in = s->inflate_buffer;
1532 s->inflate_stream.avail_in = read;
1535 s->inflate_stream.avail_out =
size;
1536 s->inflate_stream.next_out = buf;
1538 ret =
inflate(&s->inflate_stream, Z_SYNC_FLUSH);
1539 if (ret != Z_OK && ret != Z_STREAM_END)
1541 ret, s->inflate_stream.msg);
1543 return size - s->inflate_stream.avail_out;
1552 int err, new_location, read_ret;
1554 int reconnect_delay = 0;
1567 return http_buf_read_compressed(h, buf, size);
1570 while (read_ret < 0) {
1588 if (err !=
AVERROR(ETIMEDOUT))
1590 reconnect_delay = 1 + 2*reconnect_delay;
1592 if (seek_ret >= 0 && seek_ret != target) {
1608 while (pos < size) {
1627 val = strstr(key,
"='");
1630 end = strstr(val,
"';");
1665 char data[255 * 16 + 1];
1672 if ((ret =
av_opt_set(s,
"icy_metadata_packet", data, 0)) < 0)
1680 return FFMIN(size, remaining);
1704 char crlf[] =
"\r\n";
1716 snprintf(temp,
sizeof(temp),
"%x\r\n", size);
1729 char footer[] =
"0\r\n\r\n";
1736 ret = ret > 0 ? 0 :
ret;
1738 if (!(flags & AVIO_FLAG_READ)) {
1744 if (read_ret < 0 && read_ret !=
AVERROR(EAGAIN)) {
1761 inflateEnd(&s->inflate_stream);
1779 uint64_t old_off = s->
off;
1781 int old_buf_size,
ret;
1786 else if (!force_reconnect &&
1787 ((whence == SEEK_CUR && off == 0) ||
1788 (whence == SEEK_SET && off == s->
off)))
1790 else if ((s->
filesize == UINT64_MAX && whence == SEEK_END))
1793 if (whence == SEEK_CUR)
1795 else if (whence == SEEK_END)
1797 else if (whence != SEEK_SET)
1809 if (s->
off >= end_pos)
1815 memcpy(old_buf, s->
buf_ptr, old_buf_size);
1821 memcpy(s->
buffer, old_buf, old_buf_size);
1850 #define HTTP_CLASS(flavor) \ 1851 static const AVClass flavor ## _context_class = { \ 1852 .class_name = # flavor, \ 1853 .item_name = av_default_item_name, \ 1854 .option = options, \ 1855 .version = LIBAVUTIL_VERSION_INT, \ 1858 #if CONFIG_HTTP_PROTOCOL 1874 .priv_data_class = &http_context_class,
1876 .default_whitelist =
"http,https,tls,rtp,tcp,udp,crypto,httpproxy,data" 1880 #if CONFIG_HTTPS_PROTOCOL 1894 .priv_data_class = &https_context_class,
1896 .default_whitelist =
"http,https,tls,rtp,tcp,udp,crypto,httpproxy" 1900 #if CONFIG_HTTPPROXY_PROTOCOL 1912 char hostname[1024], hoststr[1024];
1913 char auth[1024], pathbuf[1024], *path;
1914 char lower_url[100];
1915 int port,
ret = 0, attempts = 0;
1925 av_url_split(
NULL, 0, auth,
sizeof(auth), hostname,
sizeof(hostname), &port,
1926 pathbuf,
sizeof(pathbuf), uri);
1932 ff_url_join(lower_url,
sizeof(lower_url),
"tcp",
NULL, hostname, port,
1944 "CONNECT %s HTTP/1.1\r\n" 1946 "Connection: close\r\n" 1951 authstr ?
"Proxy-" :
"", authstr ? authstr :
"");
1989 http_proxy_close(h);
2000 .
name =
"httpproxy",
2001 .url_open = http_proxy_open,
2003 .url_write = http_proxy_write,
2004 .url_close = http_proxy_close,
static int http_get_line(HTTPContext *s, char *line, int line_size)
time_t av_timegm(struct tm *tm)
Convert the decomposed UTC time in tm to a time_t value.
void av_url_split(char *proto, int proto_size, char *authorization, int authorization_size, char *hostname, int hostname_size, int *port_ptr, char *path, int path_size, const char *url)
Split a URL string into components.
static void update_metadata(URLContext *h, char *data)
static void parse_content_range(URLContext *h, const char *p)
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)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
void av_bprintf(AVBPrint *buf, const char *fmt,...)
int ffurl_open_whitelist(URLContext **puc, const char *filename, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options, const char *whitelist, const char *blacklist, URLContext *parent)
Create an URLContext for accessing to the resource indicated by url, and open it. ...
#define URL_PROTOCOL_FLAG_NETWORK
ptrdiff_t const GLvoid * data
#define AV_OPT_FLAG_EXPORT
The option is intended for exporting values to the caller.
#define AV_OPT_FLAG_DEPRECATED
set if option is deprecated, users should refer to AVOption.help text for more information ...
HTTPAuthType
Authentication types, ordered from weakest to strongest.
#define AV_LOG_WARNING
Something somehow does not look correct.
static int http_close(URLContext *h)
int ffurl_write(URLContext *h, const unsigned char *buf, int size)
Write size bytes from buf to the resource accessed by h.
char * av_stristr(const char *s1, const char *s2)
Locate the first case-independent occurrence in the string haystack of the string needle...
int is_streamed
true if streamed (no seek possible), default = false
AVIOInterruptCB interrupt_callback
HTTPAuthState proxy_auth_state
#define AVIO_FLAG_READ
read-only
char * icy_metadata_headers
static av_const int av_isspace(int c)
Locale-independent conversion of ASCII isspace.
const URLProtocol ff_http_protocol
#define AVIO_FLAG_WRITE
write-only
int av_strncasecmp(const char *a, const char *b, size_t n)
Locale-independent case-insensitive compare.
#define AVERROR_HTTP_NOT_FOUND
int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
Copy entries from one AVDictionary struct into another.
static int http_listen(URLContext *h, const char *uri, int flags, AVDictionary **options)
static void error(const char *err)
static int http_getc(HTTPContext *s)
HTTP Authentication state structure.
int auth_type
The currently chosen auth type.
#define AV_DICT_DONT_STRDUP_KEY
Take ownership of a key that's been allocated with av_malloc() or another memory allocation function...
int reconnect_on_network_error
static int parse_cookie(HTTPContext *s, const char *p, AVDictionary **cookies)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int av_stristart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str independent of case.
static int http_get_file_handle(URLContext *h)
static int http_buf_read(URLContext *h, uint8_t *buf, int size)
char * reconnect_on_http_error
int ff_http_averror(int status_code, int default_averror)
miscellaneous OS support macros and functions.
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
static int http_read_header(URLContext *h, int *new_location)
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
GLsizei GLboolean const GLfloat * value
static int http_open_cnx(URLContext *h, AVDictionary **options)
char * av_small_strptime(const char *p, const char *fmt, struct tm *dt)
Simplified version of strptime.
static int http_should_reconnect(HTTPContext *s, int err)
void av_bprint_append_data(AVBPrint *buf, const char *data, unsigned size)
Append data to a print buffer.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
void av_bprint_init_for_buffer(AVBPrint *buf, char *buffer, unsigned size)
Init a print buffer using a pre-existing buffer.
#define DEFAULT_USER_AGENT
#define AVERROR_EOF
End of file.
void ff_http_init_auth_state(URLContext *dest, const URLContext *src)
Initialize the authentication state based on another HTTP URLContext.
#define AV_LOG_VERBOSE
Detailed information.
HTTP 1.0 Basic auth from RFC 1945 (also in RFC 2617)
static const uint8_t header[24]
static int http_open_cnx_internal(URLContext *h, AVDictionary **options)
int ff_http_do_new_request2(URLContext *h, const char *uri, AVDictionary **opts)
Send a new HTTP request, reusing the old connection.
static void body(uint32_t ABCD[4], const uint8_t *src, int nblocks)
int ff_http_get_shutdown_status(URLContext *h)
Get the HTTP shutdown response status, be used after http_shutdown.
static int64_t http_seek_internal(URLContext *h, int64_t off, int whence, int force_reconnect)
s EdgeDetect Foobar g libavfilter vf_edgedetect c libavfilter vf_foobar c edit libavfilter and add an entry for foobar following the pattern of the other filters edit libavfilter allfilters and add an entry for foobar following the pattern of the other filters configure make j< whatever > ffmpeg ffmpeg i you should get a foobar png with Lena edge detected That s your new playground is ready Some little details about what s going which in turn will define variables for the build system and the and we are assuming vf_foobar is as well We are also assuming vf_foobar is not an edge detector so you can update the boilerplate with your credits Doxy Next chunk is the Doxygen about the file See https
int ffurl_alloc(URLContext **puc, const char *filename, int flags, const AVIOInterruptCB *int_cb)
Create a URLContext for accessing to the resource indicated by url, but do not initiate the connectio...
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const char * protocol_whitelist
static int http_write(URLContext *h, const uint8_t *buf, int size)
int av_match_list(const char *name, const char *list, char separator)
Check if a name is in a list.
static const AVOption options[]
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values. ...
static int http_handshake(URLContext *c)
simple assert() macros that are a bit more flexible than ISO C assert().
AVDictionary * chained_options
#define AVERROR_HTTP_SERVER_ERROR
static void bprint_escaped_path(AVBPrint *bp, const char *path)
Escape unsafe characters in path in order to pass them safely to the HTTP request.
char * av_asprintf(const char *fmt,...)
static int store_icy(URLContext *h, int size)
#define AVERROR_HTTP_UNAUTHORIZED
char * icy_metadata_packet
int ffurl_get_short_seek(URLContext *h)
Return the current short seek threshold value for this URL.
static int http_get_short_seek(URLContext *h)
const URLProtocol ff_httpproxy_protocol
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
int ff_network_sleep_interruptible(int64_t timeout, AVIOInterruptCB *int_cb)
Waits for up to 'timeout' microseconds.
int ffurl_handshake(URLContext *c)
Perform one step of the protocol handshake to accept a new client.
int ff_http_match_no_proxy(const char *no_proxy, const char *hostname)
int ff_make_absolute_url(char *buf, int size, const char *base, const char *rel)
Convert a relative url into an absolute url, given a base url.
static int av_bprint_is_complete(const AVBPrint *buf)
Test if the print buffer is complete (not truncated).
int ffurl_get_file_handle(URLContext *h)
Return the file descriptor associated with this URL.
int ffurl_accept(URLContext *s, URLContext **c)
Accept an URLContext c on an URLContext s.
#define AVERROR_EXIT
Immediate exit was requested; the called function should not be restarted.
AVDictionary * cookie_dict
int stale
Auth ok, but needs to be resent with a new nonce.
offset must point to a pointer immediately followed by an int for the length
int ffurl_closep(URLContext **hh)
Close the resource accessed by the URLContext h, and free the memory used by it.
int64_t av_gettime(void)
Get the current time in microseconds.
int ff_url_join(char *str, int size, const char *proto, const char *authorization, const char *hostname, int port, const char *fmt,...)
static int http_read(URLContext *h, uint8_t *buf, int size)
#define AV_LOG_INFO
Standard information.
int av_reallocp(void *ptr, size_t size)
Allocate, reallocate, or free a block of memory through a pointer to a pointer.
char * av_strdup(const char *s)
Duplicate a string.
const char * protocol_blacklist
s EdgeDetect Foobar g libavfilter vf_edgedetect c libavfilter vf_foobar c edit libavfilter and add an entry for foobar following the pattern of the other filters edit libavfilter allfilters and add an entry for foobar following the pattern of the other filters configure make j< whatever > ffmpeg ffmpeg i http
int av_opt_set_dict(void *obj, AVDictionary **options)
Set all the options from a given dictionary on an object.
HandshakeState handshake_step
#define AVIO_FLAG_NONBLOCK
Use non-blocking mode.
int seekable
Control seekability, 0 = disable, 1 = enable, -1 = probe.
#define AVIO_FLAG_READ_WRITE
read-write pseudo flag
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
unsigned char buffer[BUFFER_SIZE]
Describe the class of an AVClass context structure.
static void inflate(uint8_t *dst, const uint8_t *p1, int width, int threshold, const uint8_t *coordinates[], int coord, int maxc)
#define AVERROR_HTTP_OTHER_4XX
size_t av_strlcatf(char *dst, size_t size, const char *fmt,...)
static av_const int av_isxdigit(int c)
Locale-independent conversion of ASCII isxdigit.
char * ff_http_auth_create_response(HTTPAuthState *state, const char *auth, const char *path, const char *method)
static int has_header(const char *str, const char *header)
#define flags(name, subs,...)
#define AVERROR_HTTP_FORBIDDEN
int ffurl_close(URLContext *h)
static int process_line(URLContext *h, char *line, int line_count, int *new_location)
int ff_http_do_new_request(URLContext *h, const char *uri)
Send a new HTTP request, reusing the old connection.
char * av_strtok(char *s, const char *delim, char **saveptr)
Split the string into several tokens which can be accessed by successive calls to av_strtok()...
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str.
The official guide to swscale for confused that consecutive non overlapping rectangles of slice_bottom special converter These generally are unscaled converters of common like for each output line the vertical scaler pulls lines from a ring buffer When the ring buffer does not contain the wanted line
char * cookies
holds newline ( ) delimited Set-Cookie header field values (without the "Set-Cookie: " field name) ...
static int parse_content_encoding(URLContext *h, const char *p)
const struct URLProtocol * prot
int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int flags)
Convenience wrapper for av_dict_set that converts the value to a string and stores it...
static int get_cookies(HTTPContext *s, char **cookies, const char *path, const char *domain)
Create a string containing cookie values for use as a HTTP cookie header field value for a particular...
char * filename
specified URL
static int http_open(URLContext *h, const char *uri, int flags, AVDictionary **options)
#define AVSEEK_SIZE
ORing this as the "whence" parameter to a seek function causes it to return the filesize without seek...
void ff_http_auth_handle_header(HTTPAuthState *state, const char *key, const char *value)
static int cookie_string(AVDictionary *dict, char **cookies)
const URLProtocol ff_https_protocol
static int parse_location(HTTPContext *s, const char *p)
static int http_shutdown(URLContext *h, int flags)
static int http_write_reply(URLContext *h, int status_code)
#define AV_OPT_FLAG_READONLY
The option may not be set through the AVOptions API, only read.
#define AVERROR_HTTP_BAD_REQUEST
static int parse_icy(HTTPContext *s, const char *tag, const char *p)
static int parse_set_cookie_expiry_time(const char *exp_str, struct tm *buf)
static int http_read_stream(URLContext *h, uint8_t *buf, int size)
static int http_read_stream_all(URLContext *h, uint8_t *buf, int size)
#define AV_DICT_IGNORE_SUFFIX
Return first entry in a dictionary whose first part corresponds to the search key, ignoring the suffix of the found key string.
unbuffered private I/O API
static void handle_http_errors(URLContext *h, int error)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later.That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another.Frame references ownership and permissions
static int parse_set_cookie(const char *set_cookie, AVDictionary **dict)
static int64_t http_seek(URLContext *h, int64_t off, int whence)
static double val(void *priv, double ch)
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
int ffurl_read(URLContext *h, unsigned char *buf, int size)
Read up to size bytes from the resource accessed by h, and store the read bytes in buf...
char * av_strndup(const char *s, size_t len)
Duplicate a substring of a string.
static int http_accept(URLContext *s, URLContext **c)
#define HTTP_CLASS(flavor)
No authentication specified.
static int check_http_code(URLContext *h, int http_code, const char *end)