libgpac
Documentation of the core library of GPAC
filelist.c File Reference
#include <gpac/filters.h>
#include <gpac/constants.h>
#include <gpac/thread.h>
#include <gpac/list.h>
#include <gpac/bitstream.h>
#include <gpac/isomedia.h>
#include <gpac/network.h>
#include <gpac/avparse.h>
+ Include dependency graph for filelist.c:

Data Structures

struct  RawAudioInfo
 
struct  FileListPid
 
struct  FileListEntry
 
struct  GF_FileListCtx
 

Macros

#define SET_SOURCE(_filter, _from)
 
#define OFFS(_n)   #_n, offsetof(GF_FileListCtx, _n)
 

Enumerations

enum  { FLIST_STATE_STOP =0 , FLIST_STATE_PLAY , FLIST_STATE_WAIT_PLAY }
 
enum  {
  FL_SORT_NONE =0 , FL_SORT_NAME , FL_SORT_SIZE , FL_SORT_DATE ,
  FL_SORT_DATEX
}
 
enum  { FL_SPLICE_NONE =0 , FL_SPLICE_BEFORE , FL_SPLICE_ACTIVE , FL_SPLICE_AFTER }
 
enum  { FL_RAW_AV =0 , FL_RAW_AUDIO , FL_RAW_VIDEO , FL_RAW_NO }
 
enum  { FL_SPLICE_DELTA = 1 , FL_SPLICE_FRAME = 1<<1 }
 

Functions

static void filelist_start_ipid (GF_FileListCtx *ctx, FileListPid *iopid, u32 prev_timescale, Bool is_reassign)
 
static Bool filelist_merge_prop (void *cbk, u32 prop_4cc, const char *prop_name, const GF_PropertyValue *src_prop)
 
static void filelist_push_period_id (GF_FileListCtx *ctx, GF_FilterPid *opid)
 
static void filelist_override_caps (GF_Filter *filter, GF_FileListCtx *ctx)
 
static GF_Err filelist_configure_pid (GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)
 
static Bool filelist_process_event (GF_Filter *filter, const GF_FilterEvent *evt)
 
static void filelist_check_implicit_cat (GF_FileListCtx *ctx, char *szURL)
 
static void filelist_parse_splice_time (char *aval, GF_Fraction64 *frac, u32 *flags)
 
static void push_chapter (GF_FileListCtx *ctx, char *chap_name)
 
static Bool filelist_next_url (GF_Filter *filter, GF_FileListCtx *ctx, char szURL[GF_MAX_PATH], Bool is_splice_update)
 
static Bool filelist_on_filter_setup_error (GF_Filter *failed_filter, void *udta, GF_Err err)
 
static GF_Err filelist_load_next (GF_Filter *filter, GF_FileListCtx *ctx)
 
static s64 filelist_translate_splice_cts (FileListPid *iopid, u64 cts)
 
static Bool filelist_check_splice (GF_FileListCtx *ctx)
 
void filelist_copy_raw_audio (FileListPid *iopid, const u8 *src, u32 src_size, u32 offset, u8 *dst, u32 nb_samp, RawAudioInfo *ra)
 
static void filelist_forward_splice_pck (FileListPid *iopid, GF_FilterPacket *pck)
 
static void filelist_purge_slice (GF_FileListCtx *ctx)
 
void filelist_send_packet (GF_FileListCtx *ctx, FileListPid *iopid, GF_FilterPacket *pck, Bool is_splice_forced)
 
static GF_Err filelist_process (GF_Filter *filter)
 
static void filelist_add_entry (GF_FileListCtx *ctx, FileListEntry *fentry)
 
static Bool filelist_enum (void *cbck, char *item_name, char *item_path, GF_FileEnumInfo *file_info)
 
static GF_Err filelist_initialize (GF_Filter *filter)
 
static void filelist_finalize (GF_Filter *filter)
 
static const char * filelist_probe_data (const u8 *data, u32 size, GF_FilterProbeScore *score)
 
const GF_FilterRegister * flist_register (GF_FilterSession *session)
 

Variables

static const GF_FilterCapability FileListCapsSrc []
 
static const GF_FilterCapability FileListCapsSrc_RAW_AV []
 
static const GF_FilterCapability FileListCapsSrc_RAW_A []
 
static const GF_FilterCapability FileListCapsSrc_RAW_V []
 
static const GF_FilterArgs GF_FileListArgs []
 
static const GF_FilterCapability FileListCaps []
 
GF_FilterRegister FileListRegister
 

Data Structure Documentation

◆ RawAudioInfo

struct RawAudioInfo
Data Fields
Bool is_raw
Bool planar
u32 nb_ch
u32 abps
u32 sample_rate

◆ FileListPid

struct FileListPid
+ Collaboration diagram for FileListPid:
Data Fields
GF_FilterPid * ipid
GF_FilterPid * opid
GF_FilterPid * opid_aux
u32 stream_type
u64 max_cts
u64 max_dts
u32 o_timescale
u32 timescale
u64 cts_o
u64 dts_o
Bool single_frame
Bool is_eos
u64 dts_sub
u64 first_dts_plus_one
u64 prev_max_dts
u64 prev_cts_o
u64 prev_dts_o
Bool skip_dts_init
u32 play_state
Bool send_cue
s32 delay
s32 initial_delay
RawAudioInfo ra_info
RawAudioInfo splice_ra_info
s32 audio_samples_to_keep
GF_FilterPid * splice_ipid
Bool splice_ready
u64 cts_o_splice
u64 dts_o_splice
u64 dts_sub_splice
u32 timescale_splice
s32 splice_delay
Bool wait_rap

◆ FileListEntry

struct FileListEntry
Data Fields
char * file_name
u64 last_mod_time
u64 file_size

◆ GF_FileListCtx

struct GF_FileListCtx
+ Collaboration diagram for GF_FileListCtx:
Data Fields
Bool revert
Bool sigcues
Bool fdel
Bool keepts
Bool flush
u32 raw
s32 floop
u32 fsort
u32 ka
u64 timeout
GF_PropStringList srcs
GF_Fraction fdur
u32 timescale
GF_FilterPid * file_pid
char * file_path
u32 last_url_crc
u32 last_url_lineno
u32 last_splice_crc
u32 last_splice_lineno
Bool load_next
GF_List * filter_srcs
GF_List * io_pids
Bool is_eos
GF_Fraction64 cts_offset
GF_Fraction64 dts_offset
GF_Fraction64 wait_dts_plus_one
GF_Fraction64 dts_sub_plus_one
u32 sync_init_time
GF_Fraction64 prev_cts_offset
GF_Fraction64 prev_dts_offset
u32 nb_repeat
Double start
Double stop
Bool do_cat
Bool do_del
Bool src_error
u64 start_range
u64 end_range
GF_List * file_list
s32 file_list_idx
u64 current_file_dur_us
Bool last_is_isom
u32 wait_update_start
u64 last_file_modif_time
Bool skip_sync
Bool first_loaded
char * frag_url
char * unknown_params
char * pid_props
Bool flushed
GF_Fraction64 splice_start
GF_Fraction64 splice_end
u32 flags_splice_start
u32 flags_splice_end
u32 splice_state
FileListPid * splice_ctrl
u64 splice_end_cts
u64 splice_start_cts
u64 spliced_current_cts
Bool wait_splice_start
Bool wait_splice_end
Bool wait_source
GF_Fraction64 cts_offset_at_splice
GF_Fraction64 dts_offset_at_splice
GF_Fraction64 dts_sub_plus_one_at_splice
GF_List * splice_srcs
char * dyn_period_id
u32 cur_splice_index
u32 splice_nb_repeat
Bool keep_splice
Bool mark_only
Bool was_kept
char * splice_props
char * splice_pid_props
GF_Fraction64 init_splice_start
GF_Fraction64 init_splice_end
u32 init_flags_splice_start
u32 init_flags_splice_end
Double init_start
Double init_stop
Bool force_splice_resume
u32 sigfrag_mode
char * rel_url
char * abs_url
char * init_url
Bool src_has_seen_eos
GF_PropUIntList chap_times
GF_PropStringList chap_names

Macro Definition Documentation

◆ SET_SOURCE

#define SET_SOURCE (   _filter,
  _from 
)
Value:
if (link_idx>0) { \
prev_filter = gf_list_get(filters, (u32) link_idx); \
if (!prev_filter) { \
if (filters) gf_list_del(filters); \
GF_LOG(GF_LOG_ERROR, GF_LOG_MEDIA, ("[FileList] Invalid link directive, filter index %d does not point to a valid filter\n")); \
gf_filter_lock_all(filter, GF_FALSE);\
return GF_SERVICE_ERROR; \
} \
}\
lsep = link_args ? strchr(link_args, ' ') : NULL; \
if (lsep) lsep[0] = 0; \
gf_filter_set_source(_filter, _from, link_args); \
if (lsep) lsep[0] = ' '; \
link_args = NULL;\
link_idx=-1;
@ GF_SERVICE_ERROR
Definition: tools.h:159
attribute JSFilter filter
Definition: jsf.idl:27
void * gf_list_get(GF_List *ptr, u32 position)
gets item
Definition: list.c:668
void gf_list_del(GF_List *ptr)
list destructor
Definition: list.c:633
@ GF_LOG_MEDIA
Definition: tools.h:792
@ GF_LOG_ERROR
Definition: tools.h:741
uint32_t u32
Definition: setup.h:326
@ GF_FALSE
Definition: setup.h:473

◆ OFFS

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

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
FLIST_STATE_STOP 
FLIST_STATE_PLAY 
FLIST_STATE_WAIT_PLAY 

◆ anonymous enum

anonymous enum
Enumerator
FL_SORT_NONE 
FL_SORT_NAME 
FL_SORT_SIZE 
FL_SORT_DATE 
FL_SORT_DATEX 

◆ anonymous enum

anonymous enum
Enumerator
FL_SPLICE_NONE 
FL_SPLICE_BEFORE 
FL_SPLICE_ACTIVE 
FL_SPLICE_AFTER 

◆ anonymous enum

anonymous enum
Enumerator
FL_RAW_AV 
FL_RAW_AUDIO 
FL_RAW_VIDEO 
FL_RAW_NO 

◆ anonymous enum

anonymous enum
Enumerator
FL_SPLICE_DELTA 
FL_SPLICE_FRAME 

Function Documentation

◆ filelist_start_ipid()

static void filelist_start_ipid ( GF_FileListCtx ctx,
FileListPid iopid,
u32  prev_timescale,
Bool  is_reassign 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filelist_merge_prop()

static Bool filelist_merge_prop ( void *  cbk,
u32  prop_4cc,
const char *  prop_name,
const GF_PropertyValue *  src_prop 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filelist_push_period_id()

static void filelist_push_period_id ( GF_FileListCtx ctx,
GF_FilterPid *  opid 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filelist_override_caps()

static void filelist_override_caps ( GF_Filter *  filter,
GF_FileListCtx ctx 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filelist_configure_pid()

static GF_Err filelist_configure_pid ( GF_Filter *  filter,
GF_FilterPid *  pid,
Bool  is_remove 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filelist_process_event()

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

◆ filelist_check_implicit_cat()

static void filelist_check_implicit_cat ( GF_FileListCtx ctx,
char *  szURL 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filelist_parse_splice_time()

static void filelist_parse_splice_time ( char *  aval,
GF_Fraction64 frac,
u32 flags 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ push_chapter()

static void push_chapter ( GF_FileListCtx ctx,
char *  chap_name 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filelist_next_url()

static Bool filelist_next_url ( GF_Filter *  filter,
GF_FileListCtx ctx,
char  szURL[GF_MAX_PATH],
Bool  is_splice_update 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filelist_on_filter_setup_error()

static Bool filelist_on_filter_setup_error ( GF_Filter *  failed_filter,
void *  udta,
GF_Err  err 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filelist_load_next()

static GF_Err filelist_load_next ( GF_Filter *  filter,
GF_FileListCtx ctx 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filelist_translate_splice_cts()

static s64 filelist_translate_splice_cts ( FileListPid iopid,
u64  cts 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filelist_check_splice()

static Bool filelist_check_splice ( GF_FileListCtx ctx)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filelist_copy_raw_audio()

void filelist_copy_raw_audio ( FileListPid iopid,
const u8 src,
u32  src_size,
u32  offset,
u8 dst,
u32  nb_samp,
RawAudioInfo ra 
)
+ Here is the caller graph for this function:

◆ filelist_forward_splice_pck()

static void filelist_forward_splice_pck ( FileListPid iopid,
GF_FilterPacket *  pck 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filelist_purge_slice()

static void filelist_purge_slice ( GF_FileListCtx ctx)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filelist_send_packet()

void filelist_send_packet ( GF_FileListCtx ctx,
FileListPid iopid,
GF_FilterPacket *  pck,
Bool  is_splice_forced 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filelist_process()

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

◆ filelist_add_entry()

static void filelist_add_entry ( GF_FileListCtx ctx,
FileListEntry fentry 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filelist_enum()

static Bool filelist_enum ( void *  cbck,
char *  item_name,
char *  item_path,
GF_FileEnumInfo file_info 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filelist_initialize()

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

◆ filelist_finalize()

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

◆ filelist_probe_data()

static const char* filelist_probe_data ( const u8 data,
u32  size,
GF_FilterProbeScore score 
)
static
+ Here is the call graph for this function:

◆ flist_register()

const GF_FilterRegister* flist_register ( GF_FilterSession *  session)

Variable Documentation

◆ FileListCapsSrc

const GF_FilterCapability FileListCapsSrc[]
static
Initial value:
=
{
}
@ GF_CODECID_NONE
Definition: constants.h:383
@ GF_STREAM_FILE
Definition: constants.h:104
#define CAP_UINT(_f, _a, _b)
Definition: filters.h:2172
#define GF_CAPS_INPUT_EXCLUDED
Definition: filters.h:2228
#define CAP_BOOL(_f, _a, _b)
Definition: filters.h:2180
@ GF_PROP_PID_CODECID
Definition: filters.h:1116
@ GF_PROP_PID_STREAM_TYPE
Definition: filters.h:1112
@ GF_PROP_PID_UNFRAMED
Definition: filters.h:1118
@ GF_TRUE
Definition: setup.h:474

◆ FileListCapsSrc_RAW_AV

◆ FileListCapsSrc_RAW_A

◆ FileListCapsSrc_RAW_V

◆ GF_FileListArgs

const GF_FilterArgs GF_FileListArgs[]
static
Initial value:
=
{
{ OFFS(floop), "loop playlist/list of files, `0` for one time, `n` for n+1 times, `-1` for indefinitely", GF_PROP_SINT, "0", NULL, 0},
{ OFFS(srcs), "list of files to play", GF_PROP_STRING_LIST, NULL, NULL, 0},
{ OFFS(fdur), "frame duration for source files with a single frame (0/NaN fraction means reuse source timing which is usually not set!)", GF_PROP_FRACTION, "1/25", NULL, 0},
{ OFFS(revert), "revert list of files ([-srcs](), not playlist)", GF_PROP_BOOL, "false", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(timescale), "force output timescale on all PIDs (0 uses the timescale of the first PID found)", GF_PROP_UINT, "0", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(ka), "keep playlist alive (disable loop), waiting for a new input to be added or `#end` directive to end playlist. The value specifies the refresh rate in ms", GF_PROP_UINT, "0", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(timeout), "timeout in ms after which the playlist is considered dead (`-1` means indefinitely)", GF_PROP_LUINT, "-1", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(fsort), "sort list of files\n"
"- no: no sorting, use default directory enumeration of OS\n"
"- name: sort by alphabetical name\n"
"- size: sort by increasing size\n"
"- date: sort by increasing modification time\n"
"- datex: sort by increasing modification time"
, GF_PROP_UINT, "no", "no|name|size|date|datex", 0},
{ OFFS(sigcues), "inject `CueStart` property at each source begin (new or repeated) for DASHing", GF_PROP_BOOL, "false", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(fdel), "delete source files after processing in playlist mode (does not delete the playlist)", GF_PROP_BOOL, "false", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(keepts), "keep initial timestamps unmodified (no reset to 0)", GF_PROP_BOOL, "false", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(raw), "force input AV streams to be in raw format\n"
"- no: do not force decoding of inputs\n"
"- av: force decoding of audio and video inputs\n"
"- a: force decoding of audio inputs\n"
"- v: force decoding of video inputs", GF_PROP_UINT, "no", "av|a|v|no", GF_FS_ARG_HINT_NORMAL},
{ OFFS(flush), "send a flush signal once playlist is done before entering keepalive", GF_PROP_BOOL, "false", NULL, 0},
{0}
}
#define OFFS(_n)
Definition: filelist.c:3016
@ GF_FS_ARG_HINT_NORMAL
Definition: filters.h:2100
@ GF_FS_ARG_HINT_ADVANCED
Definition: filters.h:2102
@ GF_PROP_BOOL
Definition: filters.h:858
@ GF_PROP_SINT
Definition: filters.h:850
@ GF_PROP_LUINT
Definition: filters.h:856
@ GF_PROP_STRING_LIST
Definition: filters.h:895
@ GF_PROP_UINT
Definition: filters.h:852
@ GF_PROP_FRACTION
Definition: filters.h:860
u32 timescale
Definition: mp4box.c:234

◆ FileListCaps

const GF_FilterCapability FileListCaps[]
static
Initial value:
=
{
CAP_STRING(GF_CAPS_INPUT, GF_PROP_PID_MIME, "application/x-gpac-playlist"),
}
#define CAP_STRING(_f, _a, _b)
Definition: filters.h:2194
#define GF_CAPS_OUTPUT_EXCLUDED
Definition: filters.h:2236
#define GF_CAPS_INPUT
Definition: filters.h:2220
@ GF_PROP_PID_FILE_EXT
Definition: filters.h:1190
@ GF_PROP_PID_MIME
Definition: filters.h:1189

◆ FileListRegister

GF_FilterRegister FileListRegister