![]() |
libgpac
Documentation of the core library of GPAC
|
#include <gpac/tools.h>
#include <gpac/download.h>
#include <gpac/network.h>
#include <gpac/token.h>
#include <gpac/thread.h>
#include <gpac/list.h>
#include <gpac/base_coding.h>
#include <gpac/filters.h>
#include <gpac/crypt.h>
#include <gpac/revision.h>
Data Structures | |
struct | GF_HTTPHeader |
struct | GF_PartialDownload |
struct | GF_SessTask |
struct | __gf_download_session |
struct | __gf_download_manager |
Macros | |
#define | SIZE_IN_STREAM ( 2 << 29 ) |
#define | SESSION_RETRY_COUNT 10 |
#define | SESSION_RETRY_SSL 8 |
#define | GF_DOWNLOAD_AGENT_NAME "GPAC/"GPAC_VERSION "-rev" GPAC_GIT_REVISION |
#define | GF_DOWNLOAD_BUFFER_SIZE 50000 |
#define | GF_DOWNLOAD_BUFFER_SIZE_LIMIT_RATE GF_DOWNLOAD_BUFFER_SIZE/20 |
#define | GF_NETIO_SESSION_USE_QUIC (1<<28) |
#define | GF_NETIO_SESSION_RETRY_QUIC (1<<29) |
#define | GF_NETIO_SESSION_NO_STORE (1<<30) |
#define | PUSH_HDR(_name, _value) |
#define | SET_LAST_ERR(_e) sess->last_error = _e; |
Enumerations | |
enum | { H3_MODE_NO =0 , H3_MODE_FIRST , H3_MODE_AUTO , H3_MODE_ONLY } |
enum | { GF_DOWNLOAD_SESSION_USE_SSL = 1<<10 , GF_DOWNLOAD_SESSION_THREAD_DEAD = 1<<11 , GF_DOWNLOAD_SESSION_SSL_FORCED = 1<<12 } |
enum | REQUEST_TYPE { GET = 0 , HEAD = 1 , OTHER = 2 } |
enum | HTTPCloseType { HTTP_NO_CLOSE =0 , HTTP_CLOSE , HTTP_RESET_CONN } |
enum | GF_HTTPSessionType { GF_SESS_TYPE_HTTP =0 , GF_SESS_TYPE_HTTP2 , GF_SESS_TYPE_HTTP3 } |
Functions | |
s32 | gf_cache_remove_session_from_cache_entry (DownloadedCacheEntry entry, GF_DownloadSession *sess) |
Bool | gf_cache_set_mime (const DownloadedCacheEntry entry, const char *mime) |
Bool | gf_cache_set_range (const DownloadedCacheEntry entry, u64 size, u64 start_range, u64 end_range) |
Bool | gf_cache_set_content (const DownloadedCacheEntry entry, GF_Blob *blob, Bool copy, GF_Mutex *mx) |
Bool | gf_cache_set_headers (const DownloadedCacheEntry entry, const char *headers) |
void | gf_cache_set_downtime (const DownloadedCacheEntry entry, u32 download_time_ms) |
void | gf_cache_set_max_age (const DownloadedCacheEntry entry, u32 max_age, Bool must_revalidate) |
Bool | gf_cache_entry_persistent (const DownloadedCacheEntry entry) |
void | gf_cache_delete_entry (const DownloadedCacheEntry entry) |
GF_Err | gf_cache_set_etag_on_server (const DownloadedCacheEntry entry, const char *eTag) |
const char * | gf_cache_get_mime_type (const DownloadedCacheEntry entry) |
GF_Err | gf_cache_set_mime_type (const DownloadedCacheEntry entry, const char *mime_type) |
const char * | gf_cache_get_url (const DownloadedCacheEntry entry) |
GF_Err | gf_cache_set_last_modified_on_server (const DownloadedCacheEntry entry, const char *newLastModified) |
const char * | gf_cache_get_cache_filename (const DownloadedCacheEntry entry) |
u32 | gf_cache_get_cache_filesize (const DownloadedCacheEntry entry) |
GF_Err | gf_cache_set_content_length (const DownloadedCacheEntry entry, u32 length) |
u32 | gf_cache_get_content_length (const DownloadedCacheEntry entry) |
GF_Err | gf_cache_get_http_headers (const DownloadedCacheEntry entry, const char **etag, const char **last_modif) |
u64 | gf_cache_cleanup (const char *directory, u32 max_size) |
void | gf_cache_entry_set_delete_files_when_deleted (const DownloadedCacheEntry entry) |
u64 | gf_cache_get_start_range (const DownloadedCacheEntry entry) |
u64 | gf_cache_get_end_range (const DownloadedCacheEntry entry) |
Bool | gf_cache_are_headers_processed (const DownloadedCacheEntry entry) |
GF_Err | gf_cache_set_headers_processed (const DownloadedCacheEntry entry) |
FILE * | gf_cache_open_read (const DownloadedCacheEntry entry) |
Bool | gf_cache_is_mem (const DownloadedCacheEntry entry) |
GF_Err | gf_cache_write_to_cache (const DownloadedCacheEntry entry, const GF_DownloadSession *sess, const char *data, const u32 size, GF_Mutex *mx) |
GF_Err | gf_cache_close_write_cache (const DownloadedCacheEntry entry, const GF_DownloadSession *sess, Bool success) |
GF_Err | gf_cache_open_write_cache (const DownloadedCacheEntry entry, const GF_DownloadSession *sess) |
void | gf_cache_set_end_range (DownloadedCacheEntry entry, u64 range_end) |
Bool | gf_cache_is_in_progress (const DownloadedCacheEntry entry) |
char * | gf_cache_get_forced_headers (const DownloadedCacheEntry entry) |
u32 | gf_cache_get_downtime (const DownloadedCacheEntry entry) |
u32 | gf_cache_is_done (const DownloadedCacheEntry entry) |
Bool | gf_cache_is_deleted (const DownloadedCacheEntry entry) |
const u8 * | gf_cache_get_content (const DownloadedCacheEntry entry, u32 *size, u32 *max_valid_size, Bool *was_modified) |
void | gf_cache_release_content (const DownloadedCacheEntry entry) |
void | gf_cache_remove_entry_from_session (GF_DownloadSession *sess) |
void | gf_dm_data_received (GF_DownloadSession *sess, u8 *payload, u32 payload_size, Bool store_in_init, u32 *rewrite_size, u8 *original_payload) |
GF_Err | gf_dm_read_data (GF_DownloadSession *sess, char *data, u32 data_size, u32 *out_read) |
GF_Err | gf_dm_sess_send (GF_DownloadSession *sess, u8 *data, u32 size) |
GF_Err | gf_dm_sess_flush_async (GF_DownloadSession *sess, Bool no_select) |
GF_Err | gf_dm_sess_flush_close (GF_DownloadSession *sess) |
void | gf_dm_sess_set_header_ex (GF_DownloadSession *sess, const char *name, const char *value, Bool allow_overwrite) |
GF_Err | dm_sess_write (GF_DownloadSession *sess, const u8 *buffer, u32 size) |
GF_Err | gf_ssl_write (GF_DownloadSession *sess, const u8 *buffer, u32 size, u32 *written) |
void | dm_sess_sk_del (GF_DownloadSession *sess) |
void | gf_dm_sess_clear_headers (GF_DownloadSession *sess) |
GF_DownloadSession * | gf_dm_sess_new_internal (GF_DownloadManager *dm, const char *url, u32 dl_flags, gf_dm_user_io user_io, void *usr_cbk, GF_Socket *server, Bool force_server, GF_Err *e) |
void | gf_dm_sess_notify_state (GF_DownloadSession *sess, GF_NetIOStatus dnload_status, GF_Err error) |
void | gf_dm_sess_set_header (GF_DownloadSession *sess, const char *name, const char *value) |
void | gf_dm_sess_reload_cached_headers (GF_DownloadSession *sess) |
GF_Err | gf_dm_sess_send_reply (GF_DownloadSession *sess, u32 reply_code, const char *response_body, u32 body_len, Bool no_body) |
Bool | gf_dm_sess_use_tls (GF_DownloadSession *sess) |
void | gf_dm_disconnect (GF_DownloadSession *sess, HTTPCloseType close_type) |
GF_Err | gf_dm_get_url_info (const char *url, GF_URL_Info *info, const char *baseURL) |
void | http_do_requests (GF_DownloadSession *sess) |
void | gf_dm_configure_cache (GF_DownloadSession *sess) |
GF_DownloadSession * | gf_dm_sess_new_server (GF_DownloadManager *dm, GF_Socket *server, void *ssl_ctx, gf_dm_user_io user_io, void *usr_cbk, Bool async, GF_Err *e) |
GF_DownloadSession * | gf_dm_sess_new_subsession (GF_DownloadSession *sess, s64 stream_id, void *usr_cbk, GF_Err *e) |
u32 | gf_dm_sess_subsession_count (GF_DownloadSession *) |
void | gf_dm_sess_set_timeout (GF_DownloadSession *sess, u32 timeout) |
GF_Socket * | gf_dm_sess_get_socket (GF_DownloadSession *) |
u32 | gf_dm_sess_async_pending (GF_DownloadSession *sess) |
void | gf_dm_sess_server_reset (GF_DownloadSession *sess) |
GF_HTTPSessionType | gf_dm_sess_is_hmux (GF_DownloadSession *sess) |
void | gf_dm_sess_close_hmux (GF_DownloadSession *sess) |
void | gf_dm_sess_set_sock_group (GF_DownloadSession *sess, GF_SockGroup *sg) |
struct GF_HTTPHeader |
struct GF_PartialDownload |
struct GF_SessTask |
#define SIZE_IN_STREAM ( 2 << 29 ) |
#define SESSION_RETRY_COUNT 10 |
#define SESSION_RETRY_SSL 8 |
#define GF_DOWNLOAD_AGENT_NAME "GPAC/"GPAC_VERSION "-rev" GPAC_GIT_REVISION |
#define GF_DOWNLOAD_BUFFER_SIZE 50000 |
#define GF_DOWNLOAD_BUFFER_SIZE_LIMIT_RATE GF_DOWNLOAD_BUFFER_SIZE/20 |
#define GF_NETIO_SESSION_USE_QUIC (1<<28) |
#define GF_NETIO_SESSION_RETRY_QUIC (1<<29) |
#define GF_NETIO_SESSION_NO_STORE (1<<30) |
#define PUSH_HDR | ( | _name, | |
_value | |||
) |
#define SET_LAST_ERR | ( | _e | ) | sess->last_error = _e; |
anonymous enum |
enum REQUEST_TYPE |
enum HTTPCloseType |
enum GF_HTTPSessionType |
s32 gf_cache_remove_session_from_cache_entry | ( | DownloadedCacheEntry | entry, |
GF_DownloadSession * | sess | ||
) |
Bool gf_cache_set_mime | ( | const DownloadedCacheEntry | entry, |
const char * | mime | ||
) |
Bool gf_cache_set_range | ( | const DownloadedCacheEntry | entry, |
u64 | size, | ||
u64 | start_range, | ||
u64 | end_range | ||
) |
Bool gf_cache_set_content | ( | const DownloadedCacheEntry | entry, |
GF_Blob * | blob, | ||
Bool | copy, | ||
GF_Mutex * | mx | ||
) |
Bool gf_cache_set_headers | ( | const DownloadedCacheEntry | entry, |
const char * | headers | ||
) |
void gf_cache_set_downtime | ( | const DownloadedCacheEntry | entry, |
u32 | download_time_ms | ||
) |
Bool gf_cache_entry_persistent | ( | const DownloadedCacheEntry | entry | ) |
void gf_cache_delete_entry | ( | const DownloadedCacheEntry | entry | ) |
Cache should have been close before, abornormal situation
GF_Err gf_cache_set_etag_on_server | ( | const DownloadedCacheEntry | entry, |
const char * | eTag | ||
) |
const char* gf_cache_get_mime_type | ( | const DownloadedCacheEntry | entry | ) |
GF_Err gf_cache_set_mime_type | ( | const DownloadedCacheEntry | entry, |
const char * | mime_type | ||
) |
const char* gf_cache_get_url | ( | const DownloadedCacheEntry | entry | ) |
GF_Err gf_cache_set_last_modified_on_server | ( | const DownloadedCacheEntry | entry, |
const char * | newLastModified | ||
) |
const char* gf_cache_get_cache_filename | ( | const DownloadedCacheEntry | entry | ) |
u32 gf_cache_get_cache_filesize | ( | const DownloadedCacheEntry | entry | ) |
u32 gf_cache_get_content_length | ( | const DownloadedCacheEntry | entry | ) |
GF_Err gf_cache_get_http_headers | ( | const DownloadedCacheEntry | entry, |
const char ** | etag, | ||
const char ** | last_modif | ||
) |
void gf_cache_entry_set_delete_files_when_deleted | ( | const DownloadedCacheEntry | entry | ) |
u64 gf_cache_get_start_range | ( | const DownloadedCacheEntry | entry | ) |
u64 gf_cache_get_end_range | ( | const DownloadedCacheEntry | entry | ) |
Bool gf_cache_are_headers_processed | ( | const DownloadedCacheEntry | entry | ) |
GF_Err gf_cache_set_headers_processed | ( | const DownloadedCacheEntry | entry | ) |
FILE* gf_cache_open_read | ( | const DownloadedCacheEntry | entry | ) |
Bool gf_cache_is_mem | ( | const DownloadedCacheEntry | entry | ) |
GF_Err gf_cache_write_to_cache | ( | const DownloadedCacheEntry | entry, |
const GF_DownloadSession * | sess, | ||
const char * | data, | ||
const u32 | size, | ||
GF_Mutex * | mx | ||
) |
GF_Err gf_cache_close_write_cache | ( | const DownloadedCacheEntry | entry, |
const GF_DownloadSession * | sess, | ||
Bool | success | ||
) |
GF_Err gf_cache_open_write_cache | ( | const DownloadedCacheEntry | entry, |
const GF_DownloadSession * | sess | ||
) |
void gf_cache_set_end_range | ( | DownloadedCacheEntry | entry, |
u64 | range_end | ||
) |
Bool gf_cache_is_in_progress | ( | const DownloadedCacheEntry | entry | ) |
char* gf_cache_get_forced_headers | ( | const DownloadedCacheEntry | entry | ) |
u32 gf_cache_get_downtime | ( | const DownloadedCacheEntry | entry | ) |
u32 gf_cache_is_done | ( | const DownloadedCacheEntry | entry | ) |
Bool gf_cache_is_deleted | ( | const DownloadedCacheEntry | entry | ) |
const u8* gf_cache_get_content | ( | const DownloadedCacheEntry | entry, |
u32 * | size, | ||
u32 * | max_valid_size, | ||
Bool * | was_modified | ||
) |
void gf_cache_release_content | ( | const DownloadedCacheEntry | entry | ) |
void gf_cache_remove_entry_from_session | ( | GF_DownloadSession * | sess | ) |
Removes a cache entry from cache and performs a cleanup if possible. If the cache entry is marked for deletion and has no sessions associated with it, it will be removed (so some modules using a streaming like cache will still work).
void gf_dm_data_received | ( | GF_DownloadSession * | sess, |
u8 * | payload, | ||
u32 | payload_size, | ||
Bool | store_in_init, | ||
u32 * | rewrite_size, | ||
u8 * | original_payload | ||
) |
GF_Err gf_dm_sess_flush_close | ( | GF_DownloadSession * | sess | ) |
void gf_dm_sess_set_header_ex | ( | GF_DownloadSession * | sess, |
const char * | name, | ||
const char * | value, | ||
Bool | allow_overwrite | ||
) |
void dm_sess_sk_del | ( | GF_DownloadSession * | sess | ) |
void gf_dm_sess_clear_headers | ( | GF_DownloadSession * | sess | ) |
GF_DownloadSession* gf_dm_sess_new_internal | ( | GF_DownloadManager * | dm, |
const char * | url, | ||
u32 | dl_flags, | ||
gf_dm_user_io | user_io, | ||
void * | usr_cbk, | ||
GF_Socket * | server, | ||
Bool | force_server, | ||
GF_Err * | e | ||
) |
void gf_dm_sess_notify_state | ( | GF_DownloadSession * | sess, |
GF_NetIOStatus | dnload_status, | ||
GF_Err | error | ||
) |
void gf_dm_sess_set_header | ( | GF_DownloadSession * | sess, |
const char * | name, | ||
const char * | value | ||
) |
void gf_dm_sess_reload_cached_headers | ( | GF_DownloadSession * | sess | ) |
GF_Err gf_dm_sess_send_reply | ( | GF_DownloadSession * | sess, |
u32 | reply_code, | ||
const char * | response_body, | ||
u32 | body_len, | ||
Bool | no_body | ||
) |
Bool gf_dm_sess_use_tls | ( | GF_DownloadSession * | sess | ) |
void gf_dm_disconnect | ( | GF_DownloadSession * | sess, |
HTTPCloseType | close_type | ||
) |
GF_Err gf_dm_get_url_info | ( | const char * | url, |
GF_URL_Info * | info, | ||
const char * | baseURL | ||
) |
void http_do_requests | ( | GF_DownloadSession * | sess | ) |
Default performing behavior
sess | The session |
void gf_dm_configure_cache | ( | GF_DownloadSession * | sess | ) |
indicate we can destroy file upon destruction, except if disabled at session level
GF_DownloadSession* gf_dm_sess_new_server | ( | GF_DownloadManager * | dm, |
GF_Socket * | server, | ||
void * | ssl_ctx, | ||
gf_dm_user_io | user_io, | ||
void * | usr_cbk, | ||
Bool | async, | ||
GF_Err * | e | ||
) |
GF_DownloadSession* gf_dm_sess_new_subsession | ( | GF_DownloadSession * | sess, |
s64 | stream_id, | ||
void * | usr_cbk, | ||
GF_Err * | e | ||
) |
u32 gf_dm_sess_subsession_count | ( | GF_DownloadSession * | sess | ) |
void gf_dm_sess_set_timeout | ( | GF_DownloadSession * | sess, |
u32 | timeout | ||
) |
GF_Socket* gf_dm_sess_get_socket | ( | GF_DownloadSession * | sess | ) |
u32 gf_dm_sess_async_pending | ( | GF_DownloadSession * | sess | ) |
void gf_dm_sess_server_reset | ( | GF_DownloadSession * | sess | ) |
GF_HTTPSessionType gf_dm_sess_is_hmux | ( | GF_DownloadSession * | sess | ) |
void gf_dm_sess_close_hmux | ( | GF_DownloadSession * | sess | ) |
void gf_dm_sess_set_sock_group | ( | GF_DownloadSession * | sess, |
GF_SockGroup * | sg | ||
) |