21#ifndef FFTOOLS_TEXTFORMAT_AVTEXTFORMAT_H
22#define FFTOOLS_TEXTFORMAT_AVTEXTFORMAT_H
32#define SECTION_MAX_NB_CHILDREN 11
45#define AV_TEXTFORMAT_SECTION_FLAG_IS_WRAPPER 1
46#define AV_TEXTFORMAT_SECTION_FLAG_IS_ARRAY 2
47#define AV_TEXTFORMAT_SECTION_FLAG_HAS_VARIABLE_FIELDS 4
49#define AV_TEXTFORMAT_SECTION_FLAG_HAS_TYPE 8
50#define AV_TEXTFORMAT_SECTION_FLAG_NUMBERING_BY_TYPE 16
51#define AV_TEXTFORMAT_SECTION_FLAG_IS_SHAPE 32
52#define AV_TEXTFORMAT_SECTION_FLAG_HAS_LINKS 64
53#define AV_TEXTFORMAT_SECTION_PRINT_TAGS 128
54#define AV_TEXTFORMAT_SECTION_FLAG_IS_SUBGRAPH 256
60 const char *(*get_type)(
const void *
data);
69#define AV_TEXTFORMAT_FLAG_SUPPORTS_OPTIONAL_FIELDS 1
70#define AV_TEXTFORMAT_FLAG_SUPPORTS_MIXED_ARRAY_CONTENT 2
71#define AV_TEXTFORMAT_FLAG_IS_DIAGRAM_FORMATTER 4
112#define SECTION_MAX_NB_LEVELS 12
113#define SECTION_MAX_NB_SECTIONS 100
172#define AV_TEXTFORMAT_PRINT_STRING_OPTIONAL 1
173#define AV_TEXTFORMAT_PRINT_STRING_VALIDATE 2
static double val(void *priv, double ch)
const AVTextFormatter avtextformatter_compact
void avtext_print_integer(AVTextFormatContext *tctx, const char *key, int64_t val, int flags)
@ AV_TEXTFORMAT_DATADUMP_BASE64
@ AV_TEXTFORMAT_DATADUMP_XXD
#define SECTION_MAX_NB_LEVELS
#define SECTION_MAX_NB_CHILDREN
const AVTextFormatter avtextformatter_ini
const AVTextFormatter avtextformatter_csv
#define SECTION_MAX_NB_SECTIONS
void avtext_print_unit_integer(AVTextFormatContext *tctx, const char *key, int64_t val, AVTextFormatValueFormat fmt, const char *unit)
int avtext_context_close(AVTextFormatContext **tctx)
@ AV_TEXTFORMAT_VALUE_FMT_INT
@ AV_TEXTFORMAT_VALUE_FMT_DOUBLE
@ AV_TEXTFORMAT_VALUE_FMT_DECIBEL
@ AV_TEXTFORMAT_VALUE_FMT_SECOND
@ AV_TEXTFORMAT_VALUE_FMT_BYTE
const AVTextFormatter avtextformatter_default
void avtext_print_unit_double(AVTextFormatContext *tctx, const char *key, double val, AVTextFormatValueFormat fmt, const char *unit)
int avtext_context_open(AVTextFormatContext **ptctx, const AVTextFormatter *formatter, AVTextWriterContext *writer_context, const char *args, const AVTextFormatSection *sections, int nb_sections, AVTextFormatOptions options, char *show_data_hash)
void avtext_print_data(AVTextFormatContext *tctx, const char *key, const uint8_t *data, int size)
int avtext_print_string(AVTextFormatContext *tctx, const char *key, const char *val, int flags)
@ AV_TEXTFORMAT_STRING_VALIDATION_NB
@ AV_TEXTFORMAT_STRING_VALIDATION_FAIL
@ AV_TEXTFORMAT_STRING_VALIDATION_IGNORE
@ AV_TEXTFORMAT_STRING_VALIDATION_REPLACE
@ AV_TEXTFORMAT_LINKTYPE_MANYTOONE
@ AV_TEXTFORMAT_LINKTYPE_ONETOMANY
@ AV_TEXTFORMAT_LINKTYPE_MANYTOMANY
@ AV_TEXTFORMAT_LINKTYPE_BIDIR
@ AV_TEXTFORMAT_LINKTYPE_NONDIR
@ AV_TEXTFORMAT_LINKTYPE_DESTSRC
@ AV_TEXTFORMAT_LINKTYPE_ONETOONE
@ AV_TEXTFORMAT_LINKTYPE_HIDDEN
@ AV_TEXTFORMAT_LINKTYPE_SRCDEST
const AVTextFormatter avtextformatter_mermaid
const AVTextFormatter avtextformatter_json
void avtext_print_time(AVTextFormatContext *tctx, const char *key, int64_t ts, const AVRational *time_base, int is_duration)
void avtext_print_ts(AVTextFormatContext *tctx, const char *key, int64_t ts, int is_duration)
const AVTextFormatter avtextformatter_flat
const AVTextFormatter avtextformatter_mermaidhtml
void avtext_print_data_hash(AVTextFormatContext *tctx, const char *key, const uint8_t *data, int size)
void avtext_print_rational(AVTextFormatContext *tctx, const char *key, AVRational q, char sep)
void avtext_print_section_header(AVTextFormatContext *tctx, const void *data, int section_id)
void avtext_print_section_footer(AVTextFormatContext *tctx)
const AVTextFormatter * avtext_get_formatter_by_name(const char *name)
const AVTextFormatter avtextformatter_xml
#define flags(name, subs,...)
static char * show_data_hash
static const AVTextFormatSection sections[]
Utilities for rational number calculation.
Describe the class of an AVClass context structure.
Rational number (pair of numerator and denominator).
unsigned int nb_item_type[SECTION_MAX_NB_LEVELS][SECTION_MAX_NB_SECTIONS]
struct AVHashContext * hash
void * priv
private data for use by the filter
const AVTextFormatSection * section[SECTION_MAX_NB_LEVELS]
section per each level
char * name
name of this formatter instance
char * string_validation_replacement
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
unsigned int string_validation_utf8_flags
AVTextWriterContext * writer
the AVTextWriterContext
AVBPrint section_pbuf[SECTION_MAX_NB_LEVELS]
generic print buffer dedicated to each section, used by various formatters
const AVTextFormatSection * sections
array containing all sections
const AVTextFormatter * formatter
the AVTextFormatter of which this is an instance
int nb_sections
number of sections
int(* is_key_selected)(struct AVTextFormatContext *tctx, const char *key)
Callback to discard certain elements based upon the key used.
int use_byte_value_binary_prefix
int use_value_sexagesimal_format
AVTextFormatDataDump data_dump_format
const char * context_type
const char * id_key
name of the key to be used as the id
const char * linktype_key
name of the key to be used as the link type for diagram connections (AVTextFormatLinkType)
const char * src_id_key
name of the key to be used as the source id for diagram connections
const char * element_name
name of the contained element, if provided
const char * dest_id_key
name of the key to be used as the target id for diagram connections
const int children_ids[SECTION_MAX_NB_CHILDREN+1]
list of children section IDS, terminated by -1
const char * unique_name
unique section name, in case the name is ambiguous
int id
unique id identifying a section
int(* uninit)(AVTextFormatContext *tctx)
int priv_size
private size for the formatter context
int flags
a combination or AV_TEXTFORMAT__FLAG_*
void(* print_string)(AVTextFormatContext *tctx, const char *, const char *)
void(* print_section_header)(AVTextFormatContext *tctx, const void *data)
const AVClass * priv_class
private class of the formatter, if any
void(* print_integer)(AVTextFormatContext *tctx, const char *, int64_t)
void(* print_section_footer)(AVTextFormatContext *tctx)
int(* init)(AVTextFormatContext *tctx)