libgpac
Documentation of the core library of GPAC
in_file.c File Reference
#include <gpac/filters.h>
#include <gpac/constants.h>
+ Include dependency graph for in_file.c:

Data Structures

struct  GF_FileInCtx
 

Macros

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

Enumerations

enum  {
  FILE_RAND_NONE =0 , FILE_RAND_ANY , FILE_RAND_SC_ANY , FILE_RAND_SC_AVC ,
  FILE_RAND_SC_HEVC , FILE_RAND_SC_AV1
}
 

Functions

static GF_Err filein_initialize_ex (GF_Filter *filter)
 
static GF_Err filein_initialize (GF_Filter *filter)
 
static void filein_finalize (GF_Filter *filter)
 
static GF_FilterProbeScore filein_probe_url (const char *url, const char *mime_type)
 
static Bool filein_process_event (GF_Filter *filter, const GF_FilterEvent *evt)
 
static void filein_pck_destructor (GF_Filter *filter, GF_FilterPid *pid, GF_FilterPacket *pck)
 
static GF_Err filein_process (GF_Filter *filter)
 
const GF_FilterRegister * fin_register (GF_FilterSession *session)
 

Variables

static const GF_FilterArgs FileInArgs []
 
static const GF_FilterCapability FileInCaps []
 
GF_FilterRegister FileInRegister
 

Data Structure Documentation

◆ GF_FileInCtx

struct GF_FileInCtx
+ Collaboration diagram for GF_FileInCtx:
Data Fields
char * src
char * ext
char * mime
u32 block_size
GF_PropData pck
GF_Fraction64 range
GF_Fraction ptime
GF_FilterPid * pid
FILE * file
int fd
u64 file_size
u64 file_pos
u64 end_pos
Bool is_end
Bool pck_out
Bool is_null
Bool full_file_only
Bool do_reconfigure
char * block
u32 is_random
Bool cached_set
Bool no_failure

Macro Definition Documentation

◆ OFFS

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

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
FILE_RAND_NONE 
FILE_RAND_ANY 
FILE_RAND_SC_ANY 
FILE_RAND_SC_AVC 
FILE_RAND_SC_HEVC 
FILE_RAND_SC_AV1 

Function Documentation

◆ filein_initialize_ex()

static GF_Err filein_initialize_ex ( GF_Filter *  filter)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filein_initialize()

static GF_Err filein_initialize ( GF_Filter *  filter)
static
+ Here is the call graph for this function:

◆ filein_finalize()

static void filein_finalize ( GF_Filter *  filter)
static
+ Here is the call graph for this function:

◆ filein_probe_url()

static GF_FilterProbeScore filein_probe_url ( const char *  url,
const char *  mime_type 
)
static
+ Here is the call graph for this function:

◆ filein_process_event()

static Bool filein_process_event ( GF_Filter *  filter,
const GF_FilterEvent *  evt 
)
static
+ Here is the call graph for this function:

◆ filein_pck_destructor()

static void filein_pck_destructor ( GF_Filter *  filter,
GF_FilterPid *  pid,
GF_FilterPacket *  pck 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filein_process()

static GF_Err filein_process ( GF_Filter *  filter)
static
+ Here is the call graph for this function:

◆ fin_register()

const GF_FilterRegister* fin_register ( GF_FilterSession *  session)
+ Here is the call graph for this function:

Variable Documentation

◆ FileInArgs

const GF_FilterArgs FileInArgs[]
static
Initial value:
=
{
{ OFFS(src), "location of source file", GF_PROP_NAME, NULL, NULL, 0},
{ OFFS(block_size), "block size used to read file. 0 means 5000 if file less than 500m, 1M otherwise", GF_PROP_UINT, "0", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(range), "byte range", 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(pck), "data to use instead of file", GF_PROP_DATA, NULL, NULL, 0},
{ OFFS(ptime), "timing for data packet, ignored if den is 0", GF_PROP_FRACTION, "0/0", NULL, 0},
{0}
}
@ GF_FS_ARG_HINT_ADVANCED
Definition: filters.h:2102
@ GF_PROP_DATA
Definition: filters.h:882
@ GF_PROP_NAME
Definition: filters.h:884
@ GF_PROP_UINT
Definition: filters.h:852
@ GF_PROP_FRACTION
Definition: filters.h:860
@ GF_PROP_FRACTION64
Definition: filters.h:862
#define OFFS(_n)
Definition: in_file.c:715

◆ FileInCaps

const GF_FilterCapability FileInCaps[]
static
Initial value:
=
{
}
@ GF_STREAM_FILE
Definition: constants.h:104
#define GF_CAPS_OUTPUT
Definition: filters.h:2232
#define CAP_UINT(_f, _a, _b)
Definition: filters.h:2172
@ GF_PROP_PID_STREAM_TYPE
Definition: filters.h:1112

◆ FileInRegister

GF_FilterRegister FileInRegister
Initial value:
= {
.name = "fin",
GF_FS_SET_HELP("This filter dispatch raw blocks from input file into a filter chain.\n"
"Block size can be adjusted using [-block_size]().\n"
"Content format can be forced through [-mime]() and file extension can be changed through [-ext]().\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.\n"
"The special file name `null` is used for creating a file with no data, needed by some filters such as [dasher](dasher).\n"
"The special file name `rand` is used to generate random data.\n"
"The special file name `randsc` is used to generate random data with `0x000001` start-code prefix.\n"
"\n"
"The filter handles both files and GF_FileIO objects as input URL.\n"
"\n"
"## Packet Injecting\n"
"The filter can be used to inject a single packet instead of a file using (-pck)[] option.\n"
"No specific properties are attached, except a timescale if (-ptime)[] is set.\n"
"EX gpac fin:pck=str@\"My Sample Text\":ptime=2500/100:#CodecID=stxt:#StreamType=text\n"
"This will declare the PID as WebVTT and send a single packet with payload `My Sample Text` and a timestamp value of 25 second.\n"
)
.private_size = sizeof(GF_FileInCtx),
.initialize = filein_initialize,
.finalize = filein_finalize,
.process = filein_process,
.process_event = filein_process_event,
.probe_url = filein_probe_url,
.hint_class_type = GF_FS_CLASS_NETWORK_IO
}
#define GF_FS_SET_HELP(_help)
Definition: filters.h:2372
#define SETCAPS(__struct)
Definition: filters.h:2364
@ GF_FS_REG_FORCE_REMUX
Definition: filters.h:2418
@ GF_FS_REG_USE_SYNC_READ
Definition: filters.h:2424
@ GF_FS_CLASS_NETWORK_IO
Definition: filters.h:2449
attribute Array args
Definition: jsf.idl:24
static const GF_FilterArgs FileInArgs[]
Definition: in_file.c:717
static GF_FilterProbeScore filein_probe_url(const char *url, const char *mime_type)
Definition: in_file.c:275
static GF_Err filein_process(GF_Filter *filter)
Definition: in_file.c:424
static GF_Err filein_initialize(GF_Filter *filter)
Definition: in_file.c:255
static Bool filein_process_event(GF_Filter *filter, const GF_FilterEvent *evt)
Definition: in_file.c:317
static void filein_finalize(GF_Filter *filter)
Definition: in_file.c:264
static const GF_FilterCapability FileInCaps[]
Definition: in_file.c:729
Definition: in_file.c:43