Go to the documentation of this file.
50 #define OFFSET(x) offsetof(INIContext, x)
53 {
"hierarchical",
"specify if the section specification should be hierarchical",
OFFSET(hierarchical),
AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1 },
54 {
"h",
"specify if the section specification should be hierarchical",
OFFSET(hierarchical),
AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1 },
65 while ((
c =
src[
i++])) {
79 if ((
unsigned char)
c < 32)
100 if (!parent_section) {
148 .priv_class = &ini_class,
static void ini_print_str(AVTextFormatContext *wctx, const char *key, const char *value)
#define AV_BPRINT_SIZE_UNLIMITED
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
unsigned int nb_item_type[SECTION_MAX_NB_LEVELS][SECTION_MAX_NB_SECTIONS]
static void writer_printf(AVTextFormatContext *wctx, const char *fmt,...)
int id
unique id identifying a section
int level
current level, starting from 0
#define AV_TEXTFORMAT_SECTION_FLAG_NUMBERING_BY_TYPE
the items in this array section should be numbered individually by type
DEFINE_FORMATTER_CLASS(ini)
static void ini_print_section_header(AVTextFormatContext *wctx, const void *data)
static const AVOption ini_options[]
void * priv
private data for use by the filter
Describe the class of an AVClass context structure.
const AVTextFormatSection * section[SECTION_MAX_NB_LEVELS]
section per each level
static void writer_w8(AVTextFormatContext *wctx, int b)
static const AVTextFormatSection * tf_get_parent_section(AVTextFormatContext *tfc, int level)
Safely access the parent section.
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
#define SECTION_MAX_NB_LEVELS
static void ini_print_int(AVTextFormatContext *wctx, const char *key, int64_t value)
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
AVBPrint section_pbuf[SECTION_MAX_NB_LEVELS]
generic print buffer dedicated to each section, used by various formatters
int nested_section[SECTION_MAX_NB_LEVELS]
static void writer_put_str(AVTextFormatContext *wctx, const char *str)
#define i(width, name, range_min, range_max)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default value
#define AV_TEXTFORMAT_FLAG_SUPPORTS_MIXED_ARRAY_CONTENT
#define AV_TEXTFORMAT_SECTION_FLAG_IS_WRAPPER
the section only contains other sections, but has no data at its own level
void av_bprintf(AVBPrint *buf, const char *fmt,...)
static char * ini_escape_str(AVBPrint *dst, const char *src)
void av_bprint_clear(AVBPrint *buf)
Reset the string to "" but keep internal allocated data.
unsigned int nb_item[SECTION_MAX_NB_LEVELS]
number of the item printed in the given section, starting from 0
const AVTextFormatter avtextformatter_ini
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
static const AVTextFormatSection * tf_get_section(AVTextFormatContext *tfc, int level)
Safely validate and access a section at a given level.
void av_bprint_chars(AVBPrint *buf, char c, unsigned n)
Append char c n times to a print buffer.
#define AV_TEXTFORMAT_FLAG_SUPPORTS_OPTIONAL_FIELDS
#define AV_TEXTFORMAT_SECTION_FLAG_IS_ARRAY
the section contains an array of elements of the same type