Go to the documentation of this file.
36 #define writer_w8(wctx_, b_) (wctx_)->writer->writer->writer_w8((wctx_)->writer, b_)
37 #define writer_put_str(wctx_, str_) (wctx_)->writer->writer->writer_put_str((wctx_)->writer, str_)
38 #define writer_printf(wctx_, fmt_, ...) (wctx_)->writer->writer->writer_printf((wctx_)->writer, fmt_, __VA_ARGS__)
41 #define DEFINE_FORMATTER_CLASS(name) \
42 static const char *name##_get_name(void *ctx) \
46 static const AVClass name##_class = { \
47 .class_name = #name, \
48 .item_name = name##_get_name, \
49 .option = name##_options \
62 for (p =
src; *p; p++) {
83 char meta_chars[] = { sep,
'"',
'\n',
'\r',
'\0' };
84 int needs_quoting = !!
src[strcspn(
src, meta_chars)];
111 const char * (*escape_str)(AVBPrint *
dst,
const char *
src,
const char sep,
void *log_ctx);
118 #define OFFSET(x) offsetof(CompactContext, x)
139 av_log(wctx,
AV_LOG_ERROR,
"Item separator '%s' specified, but must contain a single character\n",
166 if (parent_section &&
187 for (
const char *p = section->
get_type(
data); *p; p++) {
189 (*p >=
'0' && *p <=
'9') ||
190 (*p >=
'a' && *p <=
'z') ||
191 (*p >=
'A' && *p <=
'Z') ?
av_tolower(*p) :
'_';
250 .priv_class = &compact_class,
256 #define OFFSET(x) offsetof(CompactContext, x)
281 .priv_class = &csv_class,
static const AVOption csv_options[]
#define AV_BPRINT_SIZE_UNLIMITED
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
const struct AVTextFormatSection * section[SECTION_MAX_NB_LEVELS]
section per each level
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
static void compact_print_str(AVTextFormatContext *wctx, const char *key, const char *value)
static void print_section(SectionID id, int level)
const AVTextFormatter avtextformatter_compact
static void compact_print_section_header(AVTextFormatContext *wctx, const void *data)
int level
current level, starting from 0
#define DEFINE_FORMATTER_CLASS(name)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const char * element_name
name of the contained element, if provided
void * priv
private data for use by the filter
int nested_section[SECTION_MAX_NB_LEVELS]
#define AV_TEXTFORMAT_SECTION_FLAG_HAS_TYPE
For these sections the element_name field is mandatory.
Describe the class of an AVClass context structure.
static const AVOption compact_options[]
static void compact_print_section_footer(AVTextFormatContext *wctx)
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
#define writer_w8(wctx_, b_)
static const char * c_escape_str(AVBPrint *dst, const char *src, const char sep, void *log_ctx)
Apply C-language-like string escaping.
int(* init)(AVBSFContext *ctx)
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
const char *(* get_type)(const void *data)
function returning a type if defined, must be defined when SECTION_FLAG_HAS_TYPE is defined
static av_cold int compact_init(AVTextFormatContext *wctx)
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
const char *(* escape_str)(AVBPrint *dst, const char *src, const char sep, void *log_ctx)
#define writer_put_str(wctx_, str_)
static const char * none_escape_str(AVBPrint *dst, const char *src, const char sep, void *log_ctx)
#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,...)
void av_bprint_clear(AVBPrint *buf)
Reset the string to "" but keep internal allocated data.
static const char * csv_escape_str(AVBPrint *dst, const char *src, const char sep, void *log_ctx)
Quote fields containing special characters, check RFC4180.
unsigned int nb_item[SECTION_MAX_NB_LEVELS]
number of the item printed in the given section, starting from 0
int has_nested_elems[SECTION_MAX_NB_LEVELS]
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
static void compact_print_int(AVTextFormatContext *wctx, const char *key, int64_t value)
#define writer_printf(wctx_, fmt_,...)
void av_bprint_chars(AVBPrint *buf, char c, unsigned n)
Append char c n times to a print buffer.
const AVTextFormatter avtextformatter_csv
#define AV_TEXTFORMAT_FLAG_SUPPORTS_OPTIONAL_FIELDS
@ 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...
#define AV_TEXTFORMAT_SECTION_FLAG_IS_ARRAY
the section contains an array of elements of the same type
static av_const int av_tolower(int c)
Locale-independent conversion of ASCII characters to lowercase.
int terminate_line[SECTION_MAX_NB_LEVELS]
static void * av_x_if_null(const void *p, const void *x)
Return x default pointer in case p is NULL.