42#define OFFSET(x) offsetof(FlatContext, x)
47 {
"hierarchical",
"specify if the section specification should be hierarchical",
OFFSET(hierarchical),
AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1 },
48 {
"h",
"specify if the section specification should be hierarchical",
OFFSET(hierarchical),
AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1 },
58 if (strlen(
flat->sep_str) != 1) {
59 av_log(wctx,
AV_LOG_ERROR,
"Item separator '%s' specified, but must contain a single character\n",
72 for (p =
src; *p; p++) {
73 if (!((*p >=
'0' && *p <=
'9') ||
74 (*p >=
'a' && *p <=
'z') ||
75 (*p >=
'A' && *p <=
'Z')))
87 for (p =
src; *p; p++) {
118 if (
flat->hierarchical ||
158 .priv_class = &flat_class,
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
#define AV_TEXTFORMAT_FLAG_SUPPORTS_OPTIONAL_FIELDS
#define AV_TEXTFORMAT_SECTION_FLAG_IS_WRAPPER
the section only contains other sections, but has no data at its own level
#define AV_TEXTFORMAT_SECTION_FLAG_IS_ARRAY
the section contains an array of elements of the same type
#define AV_TEXTFORMAT_FLAG_SUPPORTS_MIXED_ARRAY_CONTENT
#define AV_TEXTFORMAT_SECTION_FLAG_NUMBERING_BY_TYPE
the items in this array section should be numbered individually by type
const AVTextFormatter avtextformatter_flat
void av_bprintf(AVBPrint *buf, const char *fmt,...)
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
#define AV_BPRINT_SIZE_UNLIMITED
#define flags(name, subs,...)
int(* init)(AVBSFContext *ctx)
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
void av_bprint_chars(AVBPrint *buf, char c, unsigned n)
Append char c n times to a print buffer.
void av_bprint_clear(AVBPrint *buf)
Reset the string to "" but keep internal allocated data.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Describe the class of an AVClass context structure.
unsigned int nb_item_type[SECTION_MAX_NB_LEVELS][SECTION_MAX_NB_SECTIONS]
void * priv
private data for use by the filter
const AVTextFormatSection * section[SECTION_MAX_NB_LEVELS]
section per each level
int level
current level, starting from 0
unsigned int nb_item[SECTION_MAX_NB_LEVELS]
number of the item printed in the given section, starting from 0
AVBPrint section_pbuf[SECTION_MAX_NB_LEVELS]
generic print buffer dedicated to each section, used by various formatters
int id
unique id identifying a section
static void flat_print_int(AVTextFormatContext *wctx, const char *key, int64_t value)
static const char * flat_escape_value_str(AVBPrint *dst, const char *src)
static void flat_print_str(AVTextFormatContext *wctx, const char *key, const char *value)
static void flat_print_section_header(AVTextFormatContext *wctx, const void *data)
static av_cold int flat_init(AVTextFormatContext *wctx)
static const char * flat_escape_key_str(AVBPrint *dst, const char *src, const char sep)
static const AVOption flat_options[]
Internal utilities for text formatters.
static const AVTextFormatSection * tf_get_section(AVTextFormatContext *tfc, int level)
Safely validate and access a section at a given level.
static const AVTextFormatSection * tf_get_parent_section(AVTextFormatContext *tfc, int level)
Safely access the parent section.
#define DEFINE_FORMATTER_CLASS(name)
static void writer_printf(AVTextFormatContext *wctx, const char *fmt,...)
static void writer_put_str(AVTextFormatContext *wctx, const char *str)