|
FFmpeg
|
#include "config_components.h"#include <curl/curl.h>#include <errno.h>#include <inttypes.h>#include <limits.h>#include <stdlib.h>#include <string.h>#include "libavutil/avstring.h"#include "libavutil/bprint.h"#include "libavutil/dict.h"#include "libavutil/error.h"#include "libavutil/fifo.h"#include "libavutil/log.h"#include "libavutil/macros.h"#include "libavutil/mem.h"#include "libavutil/opt.h"#include "libavutil/thread.h"#include "libavutil/time.h"#include "avformat.h"#include "http.h"#include "internal.h"#include "network.h"#include "url.h"#include "version.h"Go to the source code of this file.
Data Structures | |
| struct | CurlCmd |
| struct | CurlLoop |
| struct | CurlContext |
Macros | |
| #define | DEFAULT_USER_AGENT "Lavf/" AV_STRINGIFY(LIBAVFORMAT_VERSION) |
| #define | CURL_DEFAULT_BUFFER_SIZE (4 << 20) |
| #define | CURL_WAIT_US 100000 |
| #define | ICY_MAX_HEADERS 65536 |
| #define | ICY_MAX_BLOCK (255 * 16) |
| #define | CURL_RETRY_BASE_US 1000000 |
| #define | CURL_RETRY_MAX_US 60000000 |
| #define | CURL_SETOPT(opt, val) |
| #define | OFFSET(x) |
| #define | D AV_OPT_FLAG_DECODING_PARAM |
| #define | E AV_OPT_FLAG_ENCODING_PARAM |
Enumerations | |
| enum | cmd_kind { CMD_ADD , CMD_REMOVE , CMD_UNPAUSE , CMD_SEEK } |
Functions | |
| static int | curlcode_to_averror (CURLcode code) |
| static int | curl_setopt_checked (CurlContext *c, const char *name, CURLcode code) |
| static int | curlmcode_to_averror (CURLMcode code) |
| static int | curlmcode_to_curlcode (CURLMcode code) |
| static int | is_recoverable (CURLcode code) |
| static void | update_status_locked (CurlContext *c, int status, CURLcode code) |
| static size_t | write_callback (char *ptr, size_t size, size_t nmemb, void *userdata) |
| static int | parse_offset (const char *str, int64_t *out, const char **ptr) |
| static void | parse_content_range (CurlContext *c, const char *v) |
| static int64_t | parse_metaint (const char *p, size_t len) |
| static void | store_icy_header (AVDictionary **dict, const char *ptr, size_t len) |
| static void | commit_icy_headers (CurlContext *c) |
| static int | verify_content_range (CurlContext *c, int64_t start, int64_t end, int64_t total) |
| static size_t | header_callback (char *ptr, size_t size, size_t nitems, void *userdata) |
| static int | xferinfo_callback (void *userdata, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow) |
| static void | start_request (CurlContext *c) |
| static void | update_statistics (CurlContext *c) |
| static void | on_done (CurlContext *c, CURLcode code) |
| static int | test_short_seek (CurlContext *c) |
| static void | execute_command (CurlLoop *loop, CurlCmd *cmd) |
| static void * | curl_worker (void *arg) |
| static int | curl_dispatch (CurlLoop *loop, enum cmd_kind kind, CurlContext *c, int64_t pos, int sync) |
| static void | share_lock_callback (CURL *handle, curl_lock_data data, curl_lock_access access, void *userdata) |
| static void | share_unlock_callback (CURL *handle, curl_lock_data data, void *userdata) |
| static CurlLoop * | curl_loop_create (AVFormatContext *avfc) |
| static void | print_statistics (CurlLoop *loop) |
| static void | curl_loop_destroy (CurlLoop *loop) |
| static int | curl_loop_attach (CurlContext *c, AVFormatContext *avfc) |
| void | ff_curl_loop_free (struct CurlLoop **loop) |
| Release a libcurl event loop and set *loop to NULL. | |
| static int | libcurl_close (URLContext *h) |
| static int | debug_callback (CURL *easy, curl_infotype type, char *data, size_t size, void *userdata) |
| static int | slist_append (struct curl_slist **list, const char *str) |
| static int | build_headers (CurlContext *c) |
| static int | setup_protocols (CurlContext *c) |
| static int | setup_curl (CurlContext *c) |
| static void | curl_cond_wait (CurlContext *c) |
| static int | wait_for_probe (CurlContext *c) |
| static int64_t | retry_delay (CurlContext *c) |
| static int | retry_request_locked (URLContext *h, int nonblock) |
| static int | libcurl_open (URLContext *h, const char *url, int flags, AVDictionary **options) |
| static int | update_icy_metadata (CurlContext *c) |
| static int | drain_icy_block (CurlContext *c) |
| static int | libcurl_read (URLContext *h, unsigned char *buf, int size) |
| static int64_t | libcurl_seek (URLContext *h, int64_t pos, int whence) |
| static int | libcurl_get_short_seek (URLContext *h) |
Variables | |
| static AVMutex | curl_loop_lock = AV_MUTEX_INITIALIZER |
| static const AVOption | options [] |
| static const AVClass | libcurl_context_class |
| const URLProtocol | ff_libcurl_protocol |
| #define DEFAULT_USER_AGENT "Lavf/" AV_STRINGIFY(LIBAVFORMAT_VERSION) |
| #define CURL_WAIT_US 100000 |
Definition at line 55 of file libcurl.c.
Referenced by curl_cond_wait(), and retry_request_locked().
| #define ICY_MAX_HEADERS 65536 |
Definition at line 58 of file libcurl.c.
Referenced by commit_icy_headers().
| #define CURL_RETRY_BASE_US 1000000 |
Definition at line 66 of file libcurl.c.
Referenced by retry_delay().
| #define CURL_RETRY_MAX_US 60000000 |
Definition at line 67 of file libcurl.c.
Referenced by retry_delay().
| #define CURL_SETOPT | ( | opt, | |
| val ) |
Definition at line 1206 of file libcurl.c.
Referenced by setup_curl().
| #define OFFSET | ( | x | ) |
| #define D AV_OPT_FLAG_DECODING_PARAM |
| #define E AV_OPT_FLAG_ENCODING_PARAM |
| enum cmd_kind |
|
static |
Definition at line 194 of file libcurl.c.
Referenced by curl_setopt_checked(), and on_done().
|
static |
Definition at line 216 of file libcurl.c.
Referenced by setup_curl(), setup_protocols(), and start_request().
|
static |
Definition at line 226 of file libcurl.c.
Referenced by start_request().
|
static |
Definition at line 236 of file libcurl.c.
Referenced by start_request().
|
static |
Definition at line 270 of file libcurl.c.
Referenced by header_callback(), on_done(), and start_request().
|
static |
Definition at line 279 of file libcurl.c.
Referenced by setup_curl().
|
static |
Definition at line 328 of file libcurl.c.
Referenced by parse_content_range().
|
static |
Definition at line 345 of file libcurl.c.
Referenced by header_callback().
|
static |
Definition at line 380 of file libcurl.c.
Referenced by header_callback().
|
static |
Definition at line 407 of file libcurl.c.
Referenced by header_callback().
|
static |
Definition at line 436 of file libcurl.c.
Referenced by header_callback().
|
static |
Definition at line 454 of file libcurl.c.
Referenced by header_callback().
|
static |
Definition at line 490 of file libcurl.c.
Referenced by setup_curl().
|
static |
Definition at line 635 of file libcurl.c.
Referenced by setup_curl().
|
static |
Definition at line 648 of file libcurl.c.
Referenced by execute_command(), and on_done().
|
static |
Definition at line 699 of file libcurl.c.
Referenced by execute_command(), and on_done().
|
static |
Definition at line 724 of file libcurl.c.
Referenced by curl_worker().
|
static |
Definition at line 799 of file libcurl.c.
Referenced by execute_command().
Definition at line 812 of file libcurl.c.
Referenced by curl_worker().
|
static |
Definition at line 858 of file libcurl.c.
Referenced by curl_loop_create().
|
static |
Definition at line 917 of file libcurl.c.
Referenced by libcurl_close(), libcurl_open(), libcurl_read(), libcurl_seek(), and retry_request_locked().
|
static |
Definition at line 947 of file libcurl.c.
Referenced by curl_loop_create().
|
static |
Definition at line 954 of file libcurl.c.
Referenced by curl_loop_create().
|
static |
Definition at line 961 of file libcurl.c.
Referenced by curl_loop_attach().
|
static |
Definition at line 1009 of file libcurl.c.
Referenced by curl_loop_destroy().
|
static |
Definition at line 1029 of file libcurl.c.
Referenced by ff_curl_loop_free(), and libcurl_close().
|
static |
Definition at line 1053 of file libcurl.c.
Referenced by libcurl_open().
| void ff_curl_loop_free | ( | struct CurlLoop ** | loop | ) |
Release a libcurl event loop and set *loop to NULL.
No-op when loop or *loop is NULL.
Definition at line 1072 of file libcurl.c.
Referenced by avformat_free_context().
|
static |
Definition at line 1644 of file libcurl.c.
Referenced by libcurl_open().
|
static |
Definition at line 1086 of file libcurl.c.
Referenced by setup_curl().
|
static |
Definition at line 1113 of file libcurl.c.
Referenced by build_headers(), and setup_curl().
|
static |
Definition at line 1123 of file libcurl.c.
Referenced by setup_curl().
|
static |
Definition at line 1158 of file libcurl.c.
Referenced by libcurl_open().
|
static |
Definition at line 1214 of file libcurl.c.
Referenced by libcurl_open().
|
static |
Definition at line 1323 of file libcurl.c.
Referenced by libcurl_read(), and wait_for_probe().
|
static |
Definition at line 1333 of file libcurl.c.
Referenced by libcurl_open().
|
static |
Definition at line 1357 of file libcurl.c.
Referenced by retry_request_locked().
|
static |
Definition at line 1365 of file libcurl.c.
Referenced by libcurl_read().
|
static |
|
static |
Definition at line 1487 of file libcurl.c.
Referenced by libcurl_read().
|
static |
Definition at line 1500 of file libcurl.c.
Referenced by libcurl_read().
|
static |
|
static |
|
static |
|
static |
Definition at line 192 of file libcurl.c.
Referenced by curl_loop_attach().
|
static |
| const URLProtocol ff_libcurl_protocol |
Definition at line 1730 of file libcurl.c.
Referenced by url_open_whitelist().