libgpac
Documentation of the core library of GPAC
download.h File Reference

HTTP(S) Downloader. More...

#include <gpac/tools.h>
#include <gpac/config_file.h>
#include <gpac/cache.h>
+ Include dependency graph for download.h:
+ This graph shows which files directly or indirectly include this file:

Data Structures

struct  GF_URL_Info_Struct
 
struct  GF_NETIO_Parameter
 

Typedefs

typedef struct __gf_download_manager GF_DownloadManager
 
typedef struct __gf_download_session GF_DownloadSession
 
typedef struct __gf_filter_session GF_DownloadFilterSession
 
typedef void(* gf_dm_on_usr_pass) (void *usr_cbk, const char *usr_name, const char *password, Bool store_info)
 callback function for authentication More...
 
typedef Bool(* gf_dm_get_usr_pass) (void *usr_cbk, const char *site_url, char *usr_name, char *password, gf_dm_on_usr_pass async_pass, void *async_udta)
 function for authentication More...
 
typedef void(* gf_dm_user_io) (void *usr_cbk, GF_NETIO_Parameter *parameter)
 callback function for data reception and state signaling More...
 

Enumerations

enum  GF_NetIOStatus {
  GF_NETIO_SETUP = 0, GF_NETIO_CONNECTED, GF_NETIO_GET_METHOD, GF_NETIO_GET_HEADER,
  GF_NETIO_GET_CONTENT, GF_NETIO_WAIT_FOR_REPLY, GF_NETIO_PARSE_HEADER, GF_NETIO_PARSE_REPLY,
  GF_NETIO_DATA_EXCHANGE, GF_NETIO_DATA_TRANSFERED, GF_NETIO_DISCONNECTED, GF_NETIO_STATE_ERROR,
  GF_NETIO_REQUEST_SESSION, GF_NETIO_CANCEL_STREAM
}
 
enum  GF_NetIOFlags {
  GF_NETIO_SESSION_NOT_THREADED = 1, GF_NETIO_SESSION_NOT_CACHED = 1<<1, GF_NETIO_SESSION_NOTIFY_DATA = 1<<2, GF_NETIO_SESSION_PERSISTENT = 1<<3,
  GF_NETIO_SESSION_MEMORY_CACHE = 1<<4, GF_NETIO_SESSION_KEEP_CACHE = 1<<5, GF_NETIO_SESSION_KEEP_FIRST_CACHE = 1<<6
}
 
enum  {
  GF_HTTP_UNKNOWN = 0, GF_HTTP_GET, GF_HTTP_HEAD, GF_HTTP_OPTIONS,
  GF_HTTP_CONNECT, GF_HTTP_TRACE, GF_HTTP_PUT, GF_HTTP_POST,
  GF_HTTP_DELETE
}
 

Functions

GF_Err gf_dm_get_url_info (const char *url, GF_URL_Info *info, const char *baseURL)
 
void gf_dm_url_info_init (GF_URL_Info *info)
 
void gf_dm_url_info_del (GF_URL_Info *info)
 
GF_DownloadManagergf_dm_new (GF_DownloadFilterSession *fsess)
 download manager constructor More...
 
void gf_dm_del (GF_DownloadManager *dm)
 download manager destructor More...
 
void gf_dm_set_auth_callback (GF_DownloadManager *dm, gf_dm_get_usr_pass get_pass, void *usr_cbk)
 password retrieval assignment More...
 
GF_DownloadSessiongf_dm_sess_new (GF_DownloadManager *dm, const char *url, u32 dl_flags, gf_dm_user_io user_io, void *usr_cbk, GF_Err *error)
 download session constructor More...
 
GF_DownloadSessiongf_dm_sess_new_simple (GF_DownloadManager *dm, const char *url, u32 dl_flags, gf_dm_user_io user_io, void *usr_cbk, GF_Err *e)
 download session simple constructor More...
 
void gf_dm_sess_del (GF_DownloadSession *sess)
 downloader session destructor More...
 
void gf_dm_sess_abort (GF_DownloadSession *sess)
 aborts downloading More...
 
GF_Err gf_dm_sess_last_error (GF_DownloadSession *sess)
 gets last session error More...
 
GF_Err gf_dm_sess_fetch_data (GF_DownloadSession *sess, char *buffer, u32 buffer_size, u32 *read_size)
 fetches data on session More...
 
const char * gf_dm_sess_mime_type (GF_DownloadSession *sess)
 get mime type as lower case More...
 
GF_Err gf_dm_sess_set_range (GF_DownloadSession *sess, u64 start_range, u64 end_range, Bool discontinue_cache)
 sets session range More...
 
const char * gf_dm_sess_get_cache_name (GF_DownloadSession *sess)
 get cache file name More...
 
void gf_dm_delete_cached_file_entry (const GF_DownloadManager *dm, const char *url)
 Marks the cache file to be deleted once the file is not used anymore by any session. More...
 
void gf_dm_delete_cached_file_entry_session (const GF_DownloadSession *sess, const char *url)
 
GF_Err gf_dm_sess_get_stats (GF_DownloadSession *sess, const char **server, const char **path, u64 *total_size, u64 *bytes_done, u32 *bytes_per_sec, GF_NetIOStatus *net_status)
 get statistics More...
 
u64 gf_dm_sess_get_utc_start (GF_DownloadSession *sess)
 get start time More...
 
GF_Err gf_dm_sess_process (GF_DownloadSession *sess)
 fetch session object More...
 
GF_Err gf_dm_sess_process_headers (GF_DownloadSession *sess)
 fetch session object headers More...
 
const char * gf_dm_sess_get_resource_name (GF_DownloadSession *sess)
 Get session resource url. More...
 
GF_Err gf_dm_wget_with_cache (GF_DownloadManager *dm, const char *url, const char *filename, u64 start_range, u64 end_range, char **redirected_url)
 
GF_Err gf_dm_wget (const char *url, const char *filename, u64 start_range, u64 end_range, char **redirected_url)
 Same as gf_dm_wget_with_cache, but initializes the GF_DownloadManager by itself. More...
 
GF_Err gf_dm_sess_setup_from_url (GF_DownloadSession *sess, const char *url, Bool allow_direct_reuse)
 
const char * gf_dm_sess_get_header (GF_DownloadSession *sess, const char *name)
 retrieves the HTTP header value for the given name More...
 
GF_Err gf_dm_sess_enum_headers (GF_DownloadSession *sess, u32 *idx, const char **hdr_name, const char **hdr_val)
 enumerates the HTTP headers for a session More...
 
void gf_dm_set_data_rate (GF_DownloadManager *dm, u32 rate_in_bits_per_sec)
 sets download manager max rate per session More...
 
u32 gf_dm_get_data_rate (GF_DownloadManager *dm)
 gets download manager max rate per session More...
 
u32 gf_dm_get_global_rate (GF_DownloadManager *dm)
 gets cumultaed download rate for all sessions More...
 
GF_Err gf_dm_sess_get_header_sizes_and_times (GF_DownloadSession *sess, u32 *req_hdr_size, u32 *rsp_hdr_size, u32 *connect_time, u32 *reply_time, u32 *download_time)
 Get header sizes and times stats for the session. More...
 
void gf_dm_sess_force_memory_mode (GF_DownloadSession *sess, u32 force_cache_type)
 Forces session to use memory storage. More...
 
GF_Err gf_dm_set_localcache_provider (GF_DownloadManager *dm, Bool(*local_cache_url_provider_cbk)(void *udta, char *url, Bool is_cache_destroy), void *lc_udta)
 
DownloadedCacheEntry gf_dm_add_cache_entry (GF_DownloadManager *dm, const char *szURL, GF_Blob *blob, u64 start_range, u64 end_range, const char *mime, Bool clone_memory, u32 download_time_ms)
 
GF_Err gf_dm_force_headers (GF_DownloadManager *dm, const DownloadedCacheEntry entry, const char *headers)
 

Detailed Description

>