FFmpeg
Loading...
Searching...
No Matches
tf_xml.c File Reference
#include <inttypes.h>
#include <stddef.h>
#include "avtextformat.h"
#include "libavutil/bprint.h"
#include "libavutil/error.h"
#include "libavutil/opt.h"
#include "tf_internal.h"

Go to the source code of this file.

Data Structures

struct  XMLContext
 

Macros

#define OFFSET(x)
 
#define CHECK_COMPLIANCE(opt, opt_name)
 
#define XML_INDENT()
 

Functions

 DEFINE_FORMATTER_CLASS (xml)
 
static av_cold int xml_init (AVTextFormatContext *wctx)
 
static void xml_print_section_header (AVTextFormatContext *wctx, const void *data)
 
static void xml_print_section_footer (AVTextFormatContext *wctx)
 
static void xml_print_value (AVTextFormatContext *wctx, const char *key, const char *str, int64_t num, const int is_int)
 
static void xml_print_str (AVTextFormatContext *wctx, const char *key, const char *value)
 
static void xml_print_int (AVTextFormatContext *wctx, const char *key, int64_t value)
 

Variables

static const AVOption xml_options []
 
const AVTextFormatter avtextformatter_xml
 

Macro Definition Documentation

◆ OFFSET

#define OFFSET ( x)
Value:
offsetof(XMLContext, x)

Definition at line 41 of file tf_xml.c.

◆ CHECK_COMPLIANCE

#define CHECK_COMPLIANCE ( opt,
opt_name )
Value:
if (opt) { \
av_log(wctx, AV_LOG_ERROR, \
"XSD-compliant output selected but option '%s' was selected, XML output may be non-compliant.\n" \
"You need to disable such option with '-no%s'\n", opt_name, opt_name); \
return AVERROR(EINVAL); \
}
#define AVERROR(e)
Definition error.h:45
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210

Referenced by xml_init().

◆ XML_INDENT

#define XML_INDENT ( )
Value:
writer_printf(wctx, "%*c", xml->indent_level * 4, ' ')
static void writer_printf(AVTextFormatContext *wctx, const char *fmt,...)
Definition tf_internal.h:73

Definition at line 74 of file tf_xml.c.

Referenced by xml_print_section_footer(), xml_print_section_header(), and xml_print_value().

Function Documentation

◆ DEFINE_FORMATTER_CLASS()

DEFINE_FORMATTER_CLASS ( xml )

◆ xml_init()

static av_cold int xml_init ( AVTextFormatContext * wctx)
static

Definition at line 53 of file tf_xml.c.

◆ xml_print_section_header()

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

Definition at line 76 of file tf_xml.c.

◆ xml_print_section_footer()

static void xml_print_section_footer ( AVTextFormatContext * wctx)
static

Definition at line 126 of file tf_xml.c.

◆ xml_print_value()

static void xml_print_value ( AVTextFormatContext * wctx,
const char * key,
const char * str,
int64_t num,
const int is_int )
static

Definition at line 147 of file tf_xml.c.

Referenced by xml_print_int(), and xml_print_str().

◆ xml_print_str()

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

Definition at line 192 of file tf_xml.c.

◆ xml_print_int()

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

Definition at line 197 of file tf_xml.c.

Variable Documentation

◆ xml_options

const AVOption xml_options[]
static
Initial value:
= {
{ "fully_qualified", "specify if the output should be fully qualified", OFFSET(fully_qualified), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1 },
{ "q", "specify if the output should be fully qualified", OFFSET(fully_qualified), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1 },
{ "xsd_strict", "ensure that the output is XSD compliant", OFFSET(xsd_strict), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1 },
{ "x", "ensure that the output is XSD compliant", OFFSET(xsd_strict), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1 },
{ NULL },
}
#define NULL
Definition coverity.c:32
#define OFFSET(x)
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition opt.h:326

Definition at line 43 of file tf_xml.c.

◆ avtextformatter_xml

const AVTextFormatter avtextformatter_xml
Initial value:
= {
.name = "xml",
.priv_size = sizeof(XMLContext),
.print_section_header = xml_print_section_header,
.print_section_footer = xml_print_section_footer,
.print_integer = xml_print_int,
.print_string = xml_print_str,
.priv_class = &xml_class,
}
#define AV_TEXTFORMAT_FLAG_SUPPORTS_MIXED_ARRAY_CONTENT
#define flags(name, subs,...)
Definition cbs_h264.c:74
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
static void xml_print_str(AVTextFormatContext *wctx, const char *key, const char *value)
Definition tf_xml.c:192
static void xml_print_section_header(AVTextFormatContext *wctx, const void *data)
Definition tf_xml.c:76
static void xml_print_int(AVTextFormatContext *wctx, const char *key, int64_t value)
Definition tf_xml.c:197
static av_cold int xml_init(AVTextFormatContext *wctx)
Definition tf_xml.c:53
static void xml_print_section_footer(AVTextFormatContext *wctx)
Definition tf_xml.c:126

Definition at line 202 of file tf_xml.c.

Referenced by main().