libgpac
Documentation of the core library of GPAC
Main tools
+ Collaboration diagram for Main tools:

Data Structures

struct  GF_GPACArg
 

Macros

#define GF_MAIN_FUNC(__fun)
 
#define GF_GPAC_ARG_BASE
 
#define GF_ARG_HINT_ADVANCED   (1<<1)
 
#define GF_ARG_HINT_EXPERT   (1<<2)
 
#define GF_ARG_HINT_HIDE   (1<<3)
 
#define GF_ARG_HINT_EXPERIMENTAL   (1<<4)
 
#define GF_ARG_SUBSYS_CORE   (1<<5)
 
#define GF_ARG_SUBSYS_LOG   (1<<6)
 
#define GF_ARG_SUBSYS_FILTERS   (1<<7)
 
#define GF_ARG_SUBSYS_HTTP   (1<<8)
 
#define GF_ARG_SUBSYS_VIDEO   (1<<9)
 
#define GF_ARG_SUBSYS_AUDIO   (1<<10)
 
#define GF_ARG_SUBSYS_TEXT   (1<<11)
 
#define GF_ARG_SUBSYS_RMT   (1<<12)
 
#define GF_ARG_SUBSYS_HACKS   (1<<13)
 
#define GF_ARG_BOOL   0
 
#define GF_ARG_INT   1
 
#define GF_ARG_DOUBLE   2
 
#define GF_ARG_STRING   3
 
#define GF_ARG_STRINGS   4
 
#define GF_ARG_4CC   5
 
#define GF_ARG_4CCS   6
 
#define GF_ARG_CUSTOM   7
 
#define GF_DEF_ARG(_a, _b, _c, _d, _e, _f, _g)   {_a, _b, _c, _d, _e, _f, _g}
 

Enumerations

enum  GF_SysArgMode { GF_ARGMODE_BASE =0 , GF_ARGMODE_ADVANCED , GF_ARGMODE_EXPERT , GF_ARGMODE_ALL }
 
enum  GF_SysPrintArgFlags {
  GF_PRINTARG_HIGHLIGHT_FIRST = 1 , GF_PRINTARG_NL_TO_BR = 1<<1 , GF_PRINTARG_OPT_DESC = 1<<2 , GF_PRINTARG_IS_APP = 1<<3 ,
  GF_PRINTARG_ADD_DASH = 1<<4 , GF_PRINTARG_NO_DASH = 1<<5 , GF_PRINTARG_COLON = 1<<6 , GF_PRINTARG_MD = 1<<16 ,
  GF_PRINTARG_MAN = 1<<17 , GF_PRINTARG_ESCAPE_XML = 1<<18 , GF_PRINTARG_ESCAPE_PIPE = 1<<19
}
 

Functions

const GF_GPACArggf_sys_get_options ()
 
u32 gf_sys_is_gpac_arg (const char *arg_name)
 
Bool gf_sys_set_cfg_option (const char *opt_string)
 
void gf_sys_print_arg (FILE *helpout, GF_SysPrintArgFlags flags, const GF_GPACArg *arg, const char *arg_subsystem)
 
void gf_sys_print_core_help (FILE *helpout, GF_SysPrintArgFlags flags, GF_SysArgMode mode, u32 subsystem_flags)
 
const char * gf_sys_localized (const char *sec_name, const char *str_name, const char *def_val)
 
void gf_sys_format_help (FILE *output, GF_SysPrintArgFlags flags, const char *fmt,...)
 
Bool gf_sys_word_match (const char *orig, const char *dst)
 

Detailed Description

Thiis section decribes functions useful when developing an application using libgpac such as:


Data Structure Documentation

◆ GF_GPACArg

struct GF_GPACArg

structure holding a libgpac arg (not a filter arg)

Macro Definition Documentation

◆ GF_MAIN_FUNC

#define GF_MAIN_FUNC (   __fun)
Value:
int main(int argc, char **argv) {\
return __fun( argc, argv ); \
}

macro for main() with wide to char conversion on windows platforms

◆ GF_GPAC_ARG_BASE

#define GF_GPAC_ARG_BASE
Value:
\
const char *name; \ \
const char *altname; \ \
const char *description; \ \
const char *val; \ \
const char *values; \ \
u16 type; \ \
u16 flags; \

macro defining fields of a libgpac arg (not a filter arg)

◆ GF_ARG_HINT_ADVANCED

#define GF_ARG_HINT_ADVANCED   (1<<1)

argument is of advanced type

◆ GF_ARG_HINT_EXPERT

#define GF_ARG_HINT_EXPERT   (1<<2)

argument is of expert type

◆ GF_ARG_HINT_HIDE

#define GF_ARG_HINT_HIDE   (1<<3)

argument should not be presented in UIs

◆ GF_ARG_HINT_EXPERIMENTAL

#define GF_ARG_HINT_EXPERIMENTAL   (1<<4)

argument is highly experimental

◆ GF_ARG_SUBSYS_CORE

#define GF_ARG_SUBSYS_CORE   (1<<5)

argument applies to the libgpac core subsystem

◆ GF_ARG_SUBSYS_LOG

#define GF_ARG_SUBSYS_LOG   (1<<6)

argument applies to the log subsystem

◆ GF_ARG_SUBSYS_FILTERS

#define GF_ARG_SUBSYS_FILTERS   (1<<7)

argument applies to the filter subsystem

◆ GF_ARG_SUBSYS_HTTP

#define GF_ARG_SUBSYS_HTTP   (1<<8)

argument applies to the HTTP subsystem

◆ GF_ARG_SUBSYS_VIDEO

#define GF_ARG_SUBSYS_VIDEO   (1<<9)

argument applies to the video subsystem

◆ GF_ARG_SUBSYS_AUDIO

#define GF_ARG_SUBSYS_AUDIO   (1<<10)

argument applies to the audio subsystem

◆ GF_ARG_SUBSYS_TEXT

#define GF_ARG_SUBSYS_TEXT   (1<<11)

argument applies to the font and text subsystem

◆ GF_ARG_SUBSYS_RMT

#define GF_ARG_SUBSYS_RMT   (1<<12)

argument applies to the remotery subsystem

◆ GF_ARG_SUBSYS_HACKS

#define GF_ARG_SUBSYS_HACKS   (1<<13)

argument belongs to hack tools, usually never used

◆ GF_ARG_BOOL

#define GF_ARG_BOOL   0

argument is a boolean

◆ GF_ARG_INT

#define GF_ARG_INT   1

argument is a 32 bit integer

◆ GF_ARG_DOUBLE

#define GF_ARG_DOUBLE   2

argument is a double

◆ GF_ARG_STRING

#define GF_ARG_STRING   3

argument is a string

◆ GF_ARG_STRINGS

#define GF_ARG_STRINGS   4

argument is a camma-separated list of strings

◆ GF_ARG_4CC

#define GF_ARG_4CC   5

argument is a custom arg, default value contains the syntax of the argument

◆ GF_ARG_4CCS

#define GF_ARG_4CCS   6

argument is a custom arg, default value contains the syntax of the argument

◆ GF_ARG_CUSTOM

#define GF_ARG_CUSTOM   7

argument is a custom arg, default value contains the syntax of the argument

◆ GF_DEF_ARG

#define GF_DEF_ARG (   _a,
  _b,
  _c,
  _d,
  _e,
  _f,
  _g 
)    {_a, _b, _c, _d, _e, _f, _g}

macros for defining a GF_GPACArg argument

Enumeration Type Documentation

◆ GF_SysArgMode

argument dump hint options

Enumerator
GF_ARGMODE_BASE 

only dumps simple arguments

GF_ARGMODE_ADVANCED 

only dumps advanced arguments

GF_ARGMODE_EXPERT 

only dumps expert arguments

GF_ARGMODE_ALL 

dumps all arguments

◆ GF_SysPrintArgFlags

flags for help formatting

Enumerator
GF_PRINTARG_HIGHLIGHT_FIRST 

first word in format string should be highlighted

GF_PRINTARG_NL_TO_BR 

prints
instead of new line

GF_PRINTARG_OPT_DESC 

first word in format string is an option descripttor

GF_PRINTARG_IS_APP 

the format string is an application string, not a gpac core one

GF_PRINTARG_ADD_DASH 

insert an extra '-' at the beginning

GF_PRINTARG_NO_DASH 

do not insert '-' before arg name

GF_PRINTARG_COLON 

insert '-: before arg name

GF_PRINTARG_MD 

the generation is for markdown

GF_PRINTARG_MAN 

the generation is for man pages

GF_PRINTARG_ESCAPE_XML 

XML < and > should be escaped (for markdown generation only)

GF_PRINTARG_ESCAPE_PIPE 

'|' should be escaped (for markdown generation only)

Function Documentation

◆ gf_sys_get_options()

const GF_GPACArg* gf_sys_get_options ( )

gets the options defined for libgpac

Returns
array of options

◆ gf_sys_is_gpac_arg()

u32 gf_sys_is_gpac_arg ( const char *  arg_name)

check if the given option is a libgpac argument

Parameters
arg_namename of the argument
Returns
0 if not a libgpac core option, 1 if option not consuming an argument, 2 if option consuming an argument

◆ gf_sys_set_cfg_option()

Bool gf_sys_set_cfg_option ( const char *  opt_string)

parses config string and update config accordingly

Parameters
opt_stringsection/key/val formatted as Section:Key (discard key), Section:Key=null (discard key), Section:Key=Val (set key) or Section=null (discard section)
Returns
GF_TRUE if update is OK, GF_FALSE otherwise

◆ gf_sys_print_arg()

void gf_sys_print_arg ( FILE *  helpout,
GF_SysPrintArgFlags  flags,
const GF_GPACArg arg,
const char *  arg_subsystem 
)

prints a argument

Parameters
helpoutdestination file - if NULL, uses stderr
flagsdump flags
argargument to print
arg_subsystemname of subsystem of argument (core, gpac, filter name) for localization)

◆ gf_sys_print_core_help()

void gf_sys_print_core_help ( FILE *  helpout,
GF_SysPrintArgFlags  flags,
GF_SysArgMode  mode,
u32  subsystem_flags 
)

prints libgpac help for builton core options to stderr

Parameters
helpoutdestination file - if NULL, uses stderr
flagsdump flags
modefiltering mode based on argument type
subsystem_flagsfiltering mode based on argument subsytem flags

◆ gf_sys_localized()

const char* gf_sys_localized ( const char *  sec_name,
const char *  str_name,
const char *  def_val 
)

gets localized version of string identified by module name and identifier.

Parameters
sec_namename of the module to query, such as "gpac", "core", or filter name
str_namename of string to query, such as acore/app option or a filter argument
def_valdefault value to return if no locaization exists
Returns
localized version of the string

◆ gf_sys_format_help()

void gf_sys_format_help ( FILE *  output,
GF_SysPrintArgFlags  flags,
const char *  fmt,
  ... 
)

formats help to output

Parameters
outputoutput file to dump to
flagshelp formatting flags
fmtarguments of the format

◆ gf_sys_word_match()

Bool gf_sys_word_match ( const char *  orig,
const char *  dst 
)

very basic word match, check the number of source characters in order in dest

Parameters
origword to test
dstword to compare to
Returns
GF_TRUE if words are similar, GF_FALSE otherwise