Go to the documentation of this file.
27 #ifndef AVUTIL_BPRINT_H
28 #define AVUTIL_BPRINT_H
48 #define FF_PAD_STRUCTURE(name, size, ...) \
49 struct ff_pad_helper_##name { __VA_ARGS__ }; \
50 typedef struct name { \
52 char reserved_padding[size - sizeof(struct ff_pad_helper_##name)]; \
98 char reserved_internal_buffer[1];
118 #define AV_BPRINT_SIZE_AUTOMATIC 1
125 #define AV_BPRINT_SIZE_COUNT_ONLY 0
165 void av_vbprintf(AVBPrint *buf, const
char *fmt, va_list vl_arg);
205 unsigned char **mem,
unsigned *actual_size);
220 return buf->len < buf->size;
#define AV_BPRINT_SIZE_UNLIMITED
static int av_bprint_is_complete(const AVBPrint *buf)
Test if the print buffer is complete (not truncated).
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
void av_bprint_init_for_buffer(AVBPrint *buf, char *buffer, unsigned size)
Init a print buffer using a pre-existing buffer.
unsigned unsigned size_max
void av_bprint_escape(AVBPrint *dstbuf, const char *src, const char *special_chars, enum AVEscapeMode mode, int flags)
Escape the content in src and append it to dstbuf.
#define av_printf_format(fmtpos, attrpos)
#define FF_PAD_STRUCTURE(name, size,...)
Define a structure with extra padding to a fixed size This helps ensuring binary compatibility with f...
void av_bprint_strftime(AVBPrint *buf, const char *fmt, const struct tm *tm)
Append a formatted date and time to a print buffer.
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
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
void av_bprintf(AVBPrint *buf, const char *fmt,...) av_printf_format(2
Append a formatted string to a print buffer.
void av_bprint_get_buffer(AVBPrint *buf, unsigned size, unsigned char **mem, unsigned *actual_size)
Allocate bytes in the buffer for external use.
static const char * ret_str(int v)
the frame and frame reference mechanism is intended to as much as expensive copies of that data while still allowing the filters to produce correct results The data is stored in buffers represented by AVFrame structures Several references can point to the same frame buffer
void void av_vbprintf(AVBPrint *buf, const char *fmt, va_list vl_arg)
Append a formatted string to a print buffer.
void av_bprint_clear(AVBPrint *buf)
Reset the string to "" but keep internal allocated data.
#define flags(name, subs,...)
void av_bprint_chars(AVBPrint *buf, char c, unsigned n)
Append char c n times to a print buffer.
void av_bprint_append_data(AVBPrint *buf, const char *data, unsigned size)
Append data to a print buffer.