FFmpeg
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Data Structures | Macros | Functions | Variables
tf_default.c File Reference
#include <limits.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include "avtextformat.h"
#include "libavutil/bprint.h"
#include "libavutil/opt.h"

Go to the source code of this file.

Data Structures

struct  DefaultContext
 

Macros

#define writer_w8(wctx_, b_)   (wctx_)->writer->writer->writer_w8((wctx_)->writer, b_)
 
#define writer_put_str(wctx_, str_)   (wctx_)->writer->writer->writer_put_str((wctx_)->writer, str_)
 
#define writer_printf(wctx_, fmt_, ...)   (wctx_)->writer->writer->writer_printf((wctx_)->writer, fmt_, __VA_ARGS__)
 
#define DEFINE_FORMATTER_CLASS(name)
 
#define OFFSET(x)   offsetof(DefaultContext, x)
 

Functions

 DEFINE_FORMATTER_CLASS (default)
 
static char * upcase_string (char *dst, size_t dst_size, const char *src)
 
static void default_print_section_header (AVTextFormatContext *wctx, const void *data)
 
static void default_print_section_footer (AVTextFormatContext *wctx)
 
static void default_print_str (AVTextFormatContext *wctx, const char *key, const char *value)
 
static void default_print_int (AVTextFormatContext *wctx, const char *key, int64_t value)
 

Variables

static const AVOption default_options []
 
const AVTextFormatter avtextformatter_default
 

Macro Definition Documentation

◆ writer_w8

#define writer_w8 (   wctx_,
  b_ 
)    (wctx_)->writer->writer->writer_w8((wctx_)->writer, b_)

Definition at line 31 of file tf_default.c.

◆ writer_put_str

#define writer_put_str (   wctx_,
  str_ 
)    (wctx_)->writer->writer->writer_put_str((wctx_)->writer, str_)

Definition at line 32 of file tf_default.c.

◆ writer_printf

#define writer_printf (   wctx_,
  fmt_,
  ... 
)    (wctx_)->writer->writer->writer_printf((wctx_)->writer, fmt_, __VA_ARGS__)

Definition at line 33 of file tf_default.c.

◆ DEFINE_FORMATTER_CLASS

#define DEFINE_FORMATTER_CLASS (   name)
Value:
static const char *name##_get_name(void *ctx) \
{ \
return #name ; \
} \
static const AVClass name##_class = { \
.class_name = #name, \
.item_name = name##_get_name, \
.option = name##_options \
}

Definition at line 35 of file tf_default.c.

◆ OFFSET

#define OFFSET (   x)    offsetof(DefaultContext, x)

Definition at line 56 of file tf_default.c.

Function Documentation

◆ DEFINE_FORMATTER_CLASS()

DEFINE_FORMATTER_CLASS ( default  )

◆ upcase_string()

static char* upcase_string ( char *  dst,
size_t  dst_size,
const char *  src 
)
inlinestatic

Definition at line 69 of file tf_default.c.

Referenced by default_print_section_footer(), and default_print_section_header().

◆ default_print_section_header()

static void default_print_section_header ( AVTextFormatContext wctx,
const void *  data 
)
static

Definition at line 78 of file tf_default.c.

◆ default_print_section_footer()

static void default_print_section_footer ( AVTextFormatContext wctx)
static

Definition at line 103 of file tf_default.c.

◆ default_print_str()

static void default_print_str ( AVTextFormatContext wctx,
const char *  key,
const char *  value 
)
static

Definition at line 116 of file tf_default.c.

◆ default_print_int()

static void default_print_int ( AVTextFormatContext wctx,
const char *  key,
int64_t  value 
)
static

Definition at line 125 of file tf_default.c.

Variable Documentation

◆ default_options

const AVOption default_options[]
static
Initial value:
= {
{ "noprint_wrappers", "do not print headers and footers", OFFSET(noprint_wrappers), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
{ "nw", "do not print headers and footers", OFFSET(noprint_wrappers), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
{ "nokey", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
{ "nk", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
{NULL},
}

Definition at line 58 of file tf_default.c.

◆ avtextformatter_default

const AVTextFormatter avtextformatter_default
Initial value:
= {
.name = "default",
.priv_size = sizeof(DefaultContext),
.print_section_header = default_print_section_header,
.print_section_footer = default_print_section_footer,
.print_integer = default_print_int,
.print_string = default_print_str,
.priv_class = &default_class,
}

Definition at line 134 of file tf_default.c.

Referenced by formatters_register_all().

flags
const SwsFlags flags[]
Definition: swscale.c:61
name
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 minimum maximum flags name is the option name
Definition: writing_filters.txt:88
DefaultContext
Definition: tf_default.c:48
default_print_str
static void default_print_str(AVTextFormatContext *wctx, const char *key, const char *value)
Definition: tf_default.c:116
ctx
AVFormatContext * ctx
Definition: movenc.c:49
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:76
NULL
#define NULL
Definition: coverity.c:32
OFFSET
#define OFFSET(x)
Definition: tf_default.c:56
default_print_section_footer
static void default_print_section_footer(AVTextFormatContext *wctx)
Definition: tf_default.c:103
default_print_int
static void default_print_int(AVTextFormatContext *wctx, const char *key, int64_t value)
Definition: tf_default.c:125
default_print_section_header
static void default_print_section_header(AVTextFormatContext *wctx, const void *data)
Definition: tf_default.c:78
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition: opt.h:327
AV_TEXTFORMAT_FLAG_SUPPORTS_OPTIONAL_FIELDS
#define AV_TEXTFORMAT_FLAG_SUPPORTS_OPTIONAL_FIELDS
Definition: avtextformat.h:59