libgpac
Documentation of the core library of GPAC
Loading...
Searching...
No Matches
in_http.c File Reference
#include <gpac/filters.h>
#include <gpac/constants.h>
#include <gpac/download.h>

Data Structures

struct  GF_HTTPInCtx
 

Macros

#define OFFS(_n)   #_n, offsetof(GF_HTTPInCtx, _n)
 

Enumerations

enum  GF_HTTPInStoreMode {
  GF_HTTPIN_STORE_AUTO =0 , GF_HTTPIN_STORE_DISK , GF_HTTPIN_STORE_DISK_KEEP , GF_HTTPIN_STORE_MEM ,
  GF_HTTPIN_STORE_MEM_KEEP , GF_HTTPIN_STORE_NONE , GF_HTTPIN_STORE_NONE_KEEP
}
 
enum  { HTTP_PCK_NONE =0 , HTTP_PCK_OUT =1 , HTTP_PCK_OUT_EOS =2 }
 

Functions

static void httpin_notify_error (GF_Filter *filter, GF_HTTPInCtx *ctx, GF_Err e)
 
static GF_Err httpin_initialize (GF_Filter *filter)
 
static void httpin_set_eos (GF_HTTPInCtx *ctx)
 
void httpin_finalize (GF_Filter *filter)
 
static GF_FilterProbeScore httpin_probe_url (const char *url, const char *mime_type)
 
static void httpin_rel_pck (GF_Filter *filter, GF_FilterPid *pid, GF_FilterPacket *pck)
 
static Bool httpin_process_event (GF_Filter *filter, const GF_FilterEvent *evt)
 
static GF_Err httpin_process (GF_Filter *filter)
 
const GF_FilterRegister * httpin_register (GF_FilterSession *session)
 

Variables

static const GF_FilterArgs HTTPInArgs []
 
static const GF_FilterCapability HTTPInCaps []
 
GF_FilterRegister HTTPInRegister
 

Data Structure Documentation

◆ GF_HTTPInCtx

struct GF_HTTPInCtx
Data Fields
char * src
u32 block_size
GF_HTTPInStoreMode cache
GF_Fraction64 range
char * ext
char * mime
Bool blockio
Bool initial_ack_done
GF_DownloadManager * dm
GF_FilterPid * pid
GF_DownloadSession * sess
char * block
u32 pck_out
Bool is_end
u64 nb_read
u64 file_size
FILE * cached
u32 blob_size
Bool do_reconfigure
Bool full_file_only
GF_Err last_state
Bool is_source_switch
Bool prev_was_init_segment

Macro Definition Documentation

◆ OFFS

#define OFFS (   _n)    #_n, offsetof(GF_HTTPInCtx, _n)

Enumeration Type Documentation

◆ GF_HTTPInStoreMode

Enumerator
GF_HTTPIN_STORE_AUTO 
GF_HTTPIN_STORE_DISK 
GF_HTTPIN_STORE_DISK_KEEP 
GF_HTTPIN_STORE_MEM 
GF_HTTPIN_STORE_MEM_KEEP 
GF_HTTPIN_STORE_NONE 
GF_HTTPIN_STORE_NONE_KEEP 

◆ anonymous enum

anonymous enum
Enumerator
HTTP_PCK_NONE 
HTTP_PCK_OUT 
HTTP_PCK_OUT_EOS 

Function Documentation

◆ httpin_notify_error()

static void httpin_notify_error ( GF_Filter *  filter,
GF_HTTPInCtx ctx,
GF_Err  e 
)
static

◆ httpin_initialize()

static GF_Err httpin_initialize ( GF_Filter *  filter)
static

◆ httpin_set_eos()

static void httpin_set_eos ( GF_HTTPInCtx ctx)
static

◆ httpin_finalize()

void httpin_finalize ( GF_Filter *  filter)

◆ httpin_probe_url()

static GF_FilterProbeScore httpin_probe_url ( const char *  url,
const char *  mime_type 
)
static

◆ httpin_rel_pck()

static void httpin_rel_pck ( GF_Filter *  filter,
GF_FilterPid *  pid,
GF_FilterPacket *  pck 
)
static

◆ httpin_process_event()

static Bool httpin_process_event ( GF_Filter *  filter,
const GF_FilterEvent *  evt 
)
static

◆ httpin_process()

static GF_Err httpin_process ( GF_Filter *  filter)
static

◆ httpin_register()

const GF_FilterRegister * httpin_register ( GF_FilterSession *  session)

Variable Documentation

◆ HTTPInArgs

const GF_FilterArgs HTTPInArgs[]
static
Initial value:
=
{
{ OFFS(src), "URL of source content", GF_PROP_NAME, NULL, NULL, 0},
{ OFFS(block_size), "block size used to read file", GF_PROP_UINT, "100000", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(cache), "set cache mode\n"
"- auto: cache to disk if content length is known, no cache otherwise\n"
"- disk: cache to disk, discard once session is no longer used\n"
"- keep: cache to disk and keep\n"
"- mem: stores to memory, discard once session is no longer used\n"
"- mem_keep: stores to memory, keep after session is reassigned but move to `mem` after first download\n"
"- none: no cache\n"
"- none_keep: stores to memory, keep after session is reassigned but move to `none` after first download"
, GF_PROP_UINT, "disk", "auto|disk|keep|mem|mem_keep|none|none_keep", GF_FS_ARG_HINT_ADVANCED},
{ OFFS(range), "set byte range, as fraction", GF_PROP_FRACTION64, "0-0", NULL, 0},
{ OFFS(ext), "override file extension", GF_PROP_NAME, NULL, NULL, 0},
{ OFFS(mime), "set file mime type", GF_PROP_NAME, NULL, NULL, 0},
{ OFFS(blockio), "use blocking IO", GF_PROP_BOOL, "false", NULL, GF_FS_ARG_HINT_EXPERT},
{0}
}
@ GF_FS_ARG_HINT_EXPERT
Definition filters.h:1889
@ GF_FS_ARG_HINT_ADVANCED
Definition filters.h:1887
@ GF_PROP_BOOL
Definition filters.h:767
@ GF_PROP_NAME
Definition filters.h:793
@ GF_PROP_UINT
Definition filters.h:761
@ GF_PROP_FRACTION64
Definition filters.h:771
#define OFFS(_n)
Definition in_http.c:605

◆ HTTPInCaps

const GF_FilterCapability HTTPInCaps[]
static
Initial value:
=
{
}
@ GF_STREAM_FILE
Definition constants.h:104
#define GF_CAPS_OUTPUT
Definition filters.h:2013
#define CAP_UINT(_f, _a, _b)
Definition filters.h:1955
@ GF_PROP_PID_STREAM_TYPE
Definition filters.h:1016

◆ HTTPInRegister

GF_FilterRegister HTTPInRegister
Initial value:
= {
.name = "httpin",
GF_FS_SET_HELP("This filter dispatch raw blocks from a remote HTTP resource into a filter chain.\n"
"Block size can be adjusted using [-block_size](), and disk caching policies can be adjusted.\n"
"Content format can be forced through [-mime]() and file extension can be changed through [-ext]().\n"
"\n"
"The filter supports both http and https schemes, and will attempt reconnecting as TLS if TCP connection fails.\n"
"\n"
"Note: Unless disabled at session level (see [-no-probe](CORE) ), file extensions are usually ignored and format probing is done on the first data block.")
.private_size = sizeof(GF_HTTPInCtx),
.initialize = httpin_initialize,
.finalize = httpin_finalize,
.process = httpin_process,
.process_event = httpin_process_event,
.probe_url = httpin_probe_url
}
#define GF_FS_SET_HELP(_help)
Definition filters.h:2152
#define SETCAPS(__struct)
Definition filters.h:2144
attribute Array args
Definition jsf.idl:24
static Bool httpin_process_event(GF_Filter *filter, const GF_FilterEvent *evt)
Definition in_http.c:199
static const GF_FilterCapability HTTPInCaps[]
Definition in_http.c:627
static const GF_FilterArgs HTTPInArgs[]
Definition in_http.c:607
static GF_Err httpin_process(GF_Filter *filter)
Definition in_http.c:358
static GF_FilterProbeScore httpin_probe_url(const char *url, const char *mime_type)
Definition in_http.c:179
void httpin_finalize(GF_Filter *filter)
Definition in_http.c:169
static GF_Err httpin_initialize(GF_Filter *filter)
Definition in_http.c:97
Definition in_http.c:50