FFmpeg
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Data Structures | Macros | Functions | Variables
tf_flat.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/error.h"
#include "libavutil/opt.h"

Go to the source code of this file.

Data Structures

struct  FlatContext
 

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(FlatContext, x)
 

Functions

 DEFINE_FORMATTER_CLASS (flat)
 
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 char * flat_escape_value_str (AVBPrint *dst, const char *src)
 
static void flat_print_section_header (AVTextFormatContext *wctx, const void *data)
 
static void flat_print_int (AVTextFormatContext *wctx, const char *key, int64_t value)
 
static void flat_print_str (AVTextFormatContext *wctx, const char *key, const char *value)
 

Variables

static const AVOption flat_options []
 
const AVTextFormatter avtextformatter_flat
 

Macro Definition Documentation

◆ writer_w8

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

Definition at line 32 of file tf_flat.c.

◆ writer_put_str

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

Definition at line 33 of file tf_flat.c.

◆ writer_printf

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

Definition at line 34 of file tf_flat.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 36 of file tf_flat.c.

◆ OFFSET

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

Definition at line 58 of file tf_flat.c.

Function Documentation

◆ DEFINE_FORMATTER_CLASS()

DEFINE_FORMATTER_CLASS ( flat  )

◆ flat_init()

static av_cold int flat_init ( AVTextFormatContext wctx)
static

Definition at line 70 of file tf_flat.c.

◆ flat_escape_key_str()

static const char* flat_escape_key_str ( AVBPrint *  dst,
const char *  src,
const char  sep 
)
static

Definition at line 84 of file tf_flat.c.

Referenced by flat_print_str().

◆ flat_escape_value_str()

static const char* flat_escape_value_str ( AVBPrint *  dst,
const char *  src 
)
static

Definition at line 99 of file tf_flat.c.

Referenced by flat_print_str().

◆ flat_print_section_header()

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

Definition at line 117 of file tf_flat.c.

◆ flat_print_int()

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

Definition at line 144 of file tf_flat.c.

◆ flat_print_str()

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

Definition at line 149 of file tf_flat.c.

Variable Documentation

◆ flat_options

const AVOption flat_options[]
static
Initial value:
= {
{"sep_char", "set separator", OFFSET(sep_str), AV_OPT_TYPE_STRING, {.str="."}, 0, 0 },
{"s", "set separator", OFFSET(sep_str), AV_OPT_TYPE_STRING, {.str="."}, 0, 0 },
{"hierarchical", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
{"h", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
{NULL},
}

Definition at line 60 of file tf_flat.c.

◆ avtextformatter_flat

const AVTextFormatter avtextformatter_flat
Initial value:
= {
.name = "flat",
.priv_size = sizeof(FlatContext),
.print_section_header = flat_print_section_header,
.print_integer = flat_print_int,
.print_string = flat_print_str,
.priv_class = &flat_class,
}

Definition at line 162 of file tf_flat.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
flat_print_str
static void flat_print_str(AVTextFormatContext *wctx, const char *key, const char *value)
Definition: tf_flat.c:149
flat_print_int
static void flat_print_int(AVTextFormatContext *wctx, const char *key, int64_t value)
Definition: tf_flat.c:144
OFFSET
#define OFFSET(x)
Definition: tf_flat.c:58
FlatContext
Definition: tf_flat.c:50
ctx
AVFormatContext * ctx
Definition: movenc.c:49
flat_init
static av_cold int flat_init(AVTextFormatContext *wctx)
Definition: tf_flat.c:70
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:76
NULL
#define NULL
Definition: coverity.c:32
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
flat_print_section_header
static void flat_print_section_header(AVTextFormatContext *wctx, const void *data)
Definition: tf_flat.c:117
AV_TEXTFORMAT_FLAG_SUPPORTS_MIXED_ARRAY_CONTENT
#define AV_TEXTFORMAT_FLAG_SUPPORTS_MIXED_ARRAY_CONTENT
Definition: avtextformat.h:60
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
AV_OPT_TYPE_STRING
@ 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...
Definition: opt.h:276