Go to the documentation of this file.
33 #define writer_w8(wctx_, b_) (wctx_)->writer->writer->writer_w8((wctx_)->writer, b_)
34 #define writer_put_str(wctx_, str_) (wctx_)->writer->writer->writer_put_str((wctx_)->writer, str_)
35 #define writer_printf(wctx_, fmt_, ...) (wctx_)->writer->writer->writer_printf((wctx_)->writer, fmt_, __VA_ARGS__)
37 #define DEFINE_FORMATTER_CLASS(name) \
38 static const char *name##_get_name(void *ctx) \
42 static const AVClass name##_class = { \
43 .class_name = #name, \
44 .item_name = name##_get_name, \
45 .option = name##_options \
65 #define OFFSET(x) offsetof(INIContext, x)
68 {
"hierarchical",
"specify if the section specification should be hierarchical",
OFFSET(hierarchical),
AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
69 {
"h",
"specify if the section specification should be hierarchical",
OFFSET(hierarchical),
AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
80 while (
c =
src[
i++]) {
92 if ((
unsigned char)
c < 32)
111 if (!parent_section) {
159 .priv_class = &ini_class,
static void ini_print_str(AVTextFormatContext *wctx, const char *key, const char *value)
#define AV_BPRINT_SIZE_UNLIMITED
const struct AVTextFormatSection * section[SECTION_MAX_NB_LEVELS]
section per each level
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]
#define writer_printf(wctx_, 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
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.
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
#define writer_put_str(wctx_, str_)
#define writer_w8(wctx_, b_)
int nested_section[SECTION_MAX_NB_LEVELS]
#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.
#define DEFINE_FORMATTER_CLASS(name)
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