FFmpeg
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Data Structures | Macros | Functions | Variables
tf_xml.c File Reference
#include <stdint.h>
#include <string.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)   offsetof(XMLContext, x)
 
#define CHECK_COMPLIANCE(opt, opt_name)
 
#define XML_INDENT()   writer_printf(wctx, "%*c", xml->indent_level * 4, ' ')
 

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)    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); \
}

◆ XML_INDENT

#define XML_INDENT ( )    writer_printf(wctx, "%*c", xml->indent_level * 4, ' ')

Definition at line 74 of file tf_xml.c.

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 },
}

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,
}

Definition at line 202 of file tf_xml.c.

Referenced by formatters_register_all(), and main().

flags
const SwsFlags flags[]
Definition: swscale.c:61
AVERROR
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
xml_print_section_header
static void xml_print_section_header(AVTextFormatContext *wctx, const void *data)
Definition: tf_xml.c:76
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:210
NULL
#define NULL
Definition: coverity.c:32
xml_print_int
static void xml_print_int(AVTextFormatContext *wctx, const char *key, int64_t value)
Definition: tf_xml.c:197
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
xml_init
static av_cold int xml_init(AVTextFormatContext *wctx)
Definition: tf_xml.c:53
xml_print_str
static void xml_print_str(AVTextFormatContext *wctx, const char *key, const char *value)
Definition: tf_xml.c:192
xml_print_section_footer
static void xml_print_section_footer(AVTextFormatContext *wctx)
Definition: tf_xml.c:126
AV_TEXTFORMAT_FLAG_SUPPORTS_MIXED_ARRAY_CONTENT
#define AV_TEXTFORMAT_FLAG_SUPPORTS_MIXED_ARRAY_CONTENT
Definition: avtextformat.h:72
XMLContext
Definition: tf_xml.c:32
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition: opt.h:327
OFFSET
#define OFFSET(x)
Definition: tf_xml.c:41