FFmpeg
Loading...
Searching...
No Matches
avtextformat.h File Reference
#include <stdint.h>
#include "libavutil/dict.h"
#include "libavformat/avio.h"
#include "libavutil/bprint.h"
#include "libavutil/rational.h"
#include "libavutil/hash.h"
#include "avtextwriters.h"

Go to the source code of this file.

Data Structures

struct  AVTextFormatSectionContext
 
struct  AVTextFormatSection
 
struct  AVTextFormatter
 
struct  AVTextFormatOptions
 
struct  AVTextFormatContext
 

Macros

#define SECTION_MAX_NB_CHILDREN   11
 
#define AV_TEXTFORMAT_SECTION_FLAG_IS_WRAPPER   1
 the section only contains other sections, but has no data at its own level
 
#define AV_TEXTFORMAT_SECTION_FLAG_IS_ARRAY   2
 the section contains an array of elements of the same type
 
#define AV_TEXTFORMAT_SECTION_FLAG_HAS_VARIABLE_FIELDS   4
 the section may contain a variable number of fields with variable keys.
 
#define AV_TEXTFORMAT_SECTION_FLAG_HAS_TYPE   8
 For these sections the element_name field is mandatory.
 
#define AV_TEXTFORMAT_SECTION_FLAG_NUMBERING_BY_TYPE   16
 the items in this array section should be numbered individually by type
 
#define AV_TEXTFORMAT_SECTION_FLAG_IS_SHAPE   32
 ...
 
#define AV_TEXTFORMAT_SECTION_FLAG_HAS_LINKS   64
 ...
 
#define AV_TEXTFORMAT_SECTION_PRINT_TAGS   128
 ...
 
#define AV_TEXTFORMAT_SECTION_FLAG_IS_SUBGRAPH   256
 ...
 
#define AV_TEXTFORMAT_FLAG_SUPPORTS_OPTIONAL_FIELDS   1
 
#define AV_TEXTFORMAT_FLAG_SUPPORTS_MIXED_ARRAY_CONTENT   2
 
#define AV_TEXTFORMAT_FLAG_IS_DIAGRAM_FORMATTER   4
 
#define SECTION_MAX_NB_LEVELS   12
 
#define SECTION_MAX_NB_SECTIONS   100
 
#define AV_TEXTFORMAT_PRINT_STRING_OPTIONAL   1
 
#define AV_TEXTFORMAT_PRINT_STRING_VALIDATE   2
 

Enumerations

enum  StringValidation { AV_TEXTFORMAT_STRING_VALIDATION_FAIL , AV_TEXTFORMAT_STRING_VALIDATION_REPLACE , AV_TEXTFORMAT_STRING_VALIDATION_IGNORE , AV_TEXTFORMAT_STRING_VALIDATION_NB }
 
enum  AVTextFormatLinkType {
  AV_TEXTFORMAT_LINKTYPE_SRCDEST , AV_TEXTFORMAT_LINKTYPE_DESTSRC , AV_TEXTFORMAT_LINKTYPE_BIDIR , AV_TEXTFORMAT_LINKTYPE_NONDIR ,
  AV_TEXTFORMAT_LINKTYPE_HIDDEN , AV_TEXTFORMAT_LINKTYPE_ONETOMANY = AV_TEXTFORMAT_LINKTYPE_SRCDEST , AV_TEXTFORMAT_LINKTYPE_MANYTOONE = AV_TEXTFORMAT_LINKTYPE_DESTSRC , AV_TEXTFORMAT_LINKTYPE_ONETOONE = AV_TEXTFORMAT_LINKTYPE_BIDIR ,
  AV_TEXTFORMAT_LINKTYPE_MANYTOMANY = AV_TEXTFORMAT_LINKTYPE_NONDIR
}
 
enum  AVTextFormatDataDump { AV_TEXTFORMAT_DATADUMP_XXD , AV_TEXTFORMAT_DATADUMP_BASE64 }
 
enum  AVTextFormatValueFormat {
  AV_TEXTFORMAT_VALUE_FMT_INT , AV_TEXTFORMAT_VALUE_FMT_BYTE , AV_TEXTFORMAT_VALUE_FMT_DOUBLE = 0x100 , AV_TEXTFORMAT_VALUE_FMT_SECOND ,
  AV_TEXTFORMAT_VALUE_FMT_DECIBEL
}
 

Functions

int avtext_context_open (AVTextFormatContext **ptctx, const AVTextFormatter *formatter, AVTextWriterContext *writer_context, const char *args, const AVTextFormatSection *sections, int nb_sections, AVTextFormatOptions options, char *show_data_hash)
 
int avtext_context_close (AVTextFormatContext **tctx)
 
void avtext_print_section_header (AVTextFormatContext *tctx, const void *data, int section_id)
 
void avtext_print_section_footer (AVTextFormatContext *tctx)
 
void avtext_print_integer (AVTextFormatContext *tctx, const char *key, int64_t val, int flags)
 
int avtext_print_string (AVTextFormatContext *tctx, const char *key, const char *val, int flags)
 
void avtext_print_unit_integer (AVTextFormatContext *tctx, const char *key, int64_t val, AVTextFormatValueFormat fmt, const char *unit)
 
void avtext_print_unit_double (AVTextFormatContext *tctx, const char *key, double val, AVTextFormatValueFormat fmt, const char *unit)
 
void avtext_print_rational (AVTextFormatContext *tctx, const char *key, AVRational q, char sep)
 
void avtext_print_time (AVTextFormatContext *tctx, const char *key, int64_t ts, const AVRational *time_base, int is_duration)
 
void avtext_print_ts (AVTextFormatContext *tctx, const char *key, int64_t ts, int is_duration)
 
void avtext_print_data (AVTextFormatContext *tctx, const char *key, const uint8_t *data, int size)
 
void avtext_print_data_hash (AVTextFormatContext *tctx, const char *key, const uint8_t *data, int size)
 
const AVTextFormatteravtext_get_formatter_by_name (const char *name)
 

Variables

const AVTextFormatter avtextformatter_default
 
const AVTextFormatter avtextformatter_compact
 
const AVTextFormatter avtextformatter_csv
 
const AVTextFormatter avtextformatter_flat
 
const AVTextFormatter avtextformatter_ini
 
const AVTextFormatter avtextformatter_json
 
const AVTextFormatter avtextformatter_xml
 
const AVTextFormatter avtextformatter_mermaid
 
const AVTextFormatter avtextformatter_mermaidhtml
 

Macro Definition Documentation

◆ SECTION_MAX_NB_CHILDREN

#define SECTION_MAX_NB_CHILDREN   11

Definition at line 32 of file avtextformat.h.

◆ AV_TEXTFORMAT_SECTION_FLAG_IS_WRAPPER

#define AV_TEXTFORMAT_SECTION_FLAG_IS_WRAPPER   1

◆ AV_TEXTFORMAT_SECTION_FLAG_IS_ARRAY

◆ AV_TEXTFORMAT_SECTION_FLAG_HAS_VARIABLE_FIELDS

#define AV_TEXTFORMAT_SECTION_FLAG_HAS_VARIABLE_FIELDS   4

the section may contain a variable number of fields with variable keys.

Definition at line 47 of file avtextformat.h.

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

◆ AV_TEXTFORMAT_SECTION_FLAG_HAS_TYPE

#define AV_TEXTFORMAT_SECTION_FLAG_HAS_TYPE   8

For these sections the element_name field is mandatory.

the section contains a type to distinguish multiple nested elements

Definition at line 49 of file avtextformat.h.

Referenced by compact_print_section_header(), print_section(), and xml_print_section_header().

◆ AV_TEXTFORMAT_SECTION_FLAG_NUMBERING_BY_TYPE

#define AV_TEXTFORMAT_SECTION_FLAG_NUMBERING_BY_TYPE   16

the items in this array section should be numbered individually by type

Definition at line 50 of file avtextformat.h.

Referenced by flat_print_section_header(), ini_print_section_header(), json_print_int(), json_print_section_header(), and json_print_str().

◆ AV_TEXTFORMAT_SECTION_FLAG_IS_SHAPE

#define AV_TEXTFORMAT_SECTION_FLAG_IS_SHAPE   32

◆ AV_TEXTFORMAT_SECTION_FLAG_HAS_LINKS

#define AV_TEXTFORMAT_SECTION_FLAG_HAS_LINKS   64

◆ AV_TEXTFORMAT_SECTION_PRINT_TAGS

#define AV_TEXTFORMAT_SECTION_PRINT_TAGS   128

◆ AV_TEXTFORMAT_SECTION_FLAG_IS_SUBGRAPH

#define AV_TEXTFORMAT_SECTION_FLAG_IS_SUBGRAPH   256

◆ AV_TEXTFORMAT_FLAG_SUPPORTS_OPTIONAL_FIELDS

#define AV_TEXTFORMAT_FLAG_SUPPORTS_OPTIONAL_FIELDS   1

Definition at line 69 of file avtextformat.h.

Referenced by avtext_print_integer(), and avtext_print_string().

◆ AV_TEXTFORMAT_FLAG_SUPPORTS_MIXED_ARRAY_CONTENT

#define AV_TEXTFORMAT_FLAG_SUPPORTS_MIXED_ARRAY_CONTENT   2

Definition at line 70 of file avtextformat.h.

Referenced by probe_file().

◆ AV_TEXTFORMAT_FLAG_IS_DIAGRAM_FORMATTER

#define AV_TEXTFORMAT_FLAG_IS_DIAGRAM_FORMATTER   4

Definition at line 71 of file avtextformat.h.

Referenced by init_graphprint().

◆ SECTION_MAX_NB_LEVELS

◆ SECTION_MAX_NB_SECTIONS

#define SECTION_MAX_NB_SECTIONS   100

Definition at line 113 of file avtextformat.h.

Referenced by avtext_context_open().

◆ AV_TEXTFORMAT_PRINT_STRING_OPTIONAL

#define AV_TEXTFORMAT_PRINT_STRING_OPTIONAL   1

◆ AV_TEXTFORMAT_PRINT_STRING_VALIDATE

#define AV_TEXTFORMAT_PRINT_STRING_VALIDATE   2

Definition at line 173 of file avtextformat.h.

Referenced by avtext_print_string().

Enumeration Type Documentation

◆ StringValidation

Enumerator
AV_TEXTFORMAT_STRING_VALIDATION_FAIL 
AV_TEXTFORMAT_STRING_VALIDATION_REPLACE 
AV_TEXTFORMAT_STRING_VALIDATION_IGNORE 
AV_TEXTFORMAT_STRING_VALIDATION_NB 

Definition at line 73 of file avtextformat.h.

◆ AVTextFormatLinkType

Enumerator
AV_TEXTFORMAT_LINKTYPE_SRCDEST 
AV_TEXTFORMAT_LINKTYPE_DESTSRC 
AV_TEXTFORMAT_LINKTYPE_BIDIR 
AV_TEXTFORMAT_LINKTYPE_NONDIR 
AV_TEXTFORMAT_LINKTYPE_HIDDEN 
AV_TEXTFORMAT_LINKTYPE_ONETOMANY 
AV_TEXTFORMAT_LINKTYPE_MANYTOONE 
AV_TEXTFORMAT_LINKTYPE_ONETOONE 
AV_TEXTFORMAT_LINKTYPE_MANYTOMANY 

Definition at line 80 of file avtextformat.h.

◆ AVTextFormatDataDump

Enumerator
AV_TEXTFORMAT_DATADUMP_XXD 
AV_TEXTFORMAT_DATADUMP_BASE64 

Definition at line 92 of file avtextformat.h.

◆ AVTextFormatValueFormat

Enumerator
AV_TEXTFORMAT_VALUE_FMT_INT 
AV_TEXTFORMAT_VALUE_FMT_BYTE 
AV_TEXTFORMAT_VALUE_FMT_DOUBLE 
AV_TEXTFORMAT_VALUE_FMT_SECOND 
AV_TEXTFORMAT_VALUE_FMT_DECIBEL 

Definition at line 164 of file avtextformat.h.

Function Documentation

◆ avtext_context_open()

int avtext_context_open ( AVTextFormatContext ** ptctx,
const AVTextFormatter * formatter,
AVTextWriterContext * writer_context,
const char * args,
const AVTextFormatSection * sections,
int nb_sections,
AVTextFormatOptions options,
char * show_data_hash )

Definition at line 129 of file avtextformat.c.

Referenced by init_graphprint(), and main().

◆ avtext_context_close()

int avtext_context_close ( AVTextFormatContext ** tctx)

Definition at line 104 of file avtextformat.c.

Referenced by avtext_context_open(), init_graphprint(), main(), and uninit_graphprint().

◆ avtext_print_section_header()

◆ avtext_print_section_footer()

◆ avtext_print_integer()

void avtext_print_integer ( AVTextFormatContext * tctx,
const char * key,
int64_t val,
int flags )

Definition at line 284 of file avtextformat.c.

Referenced by avtext_print_ts().

◆ avtext_print_string()

int avtext_print_string ( AVTextFormatContext * tctx,
const char * key,
const char * val,
int flags )

◆ avtext_print_unit_integer()

void avtext_print_unit_integer ( AVTextFormatContext * tctx,
const char * key,
int64_t val,
AVTextFormatValueFormat fmt,
const char * unit )

Definition at line 432 of file avtextformat.c.

◆ avtext_print_unit_double()

void avtext_print_unit_double ( AVTextFormatContext * tctx,
const char * key,
double val,
AVTextFormatValueFormat fmt,
const char * unit )

Definition at line 446 of file avtextformat.c.

◆ avtext_print_rational()

void avtext_print_rational ( AVTextFormatContext * tctx,
const char * key,
AVRational q,
char sep )

Definition at line 501 of file avtextformat.c.

◆ avtext_print_time()

void avtext_print_time ( AVTextFormatContext * tctx,
const char * key,
int64_t ts,
const AVRational * time_base,
int is_duration )

Definition at line 508 of file avtextformat.c.

◆ avtext_print_ts()

void avtext_print_ts ( AVTextFormatContext * tctx,
const char * key,
int64_t ts,
int is_duration )

Definition at line 525 of file avtextformat.c.

◆ avtext_print_data()

void avtext_print_data ( AVTextFormatContext * tctx,
const char * key,
const uint8_t * data,
int size )

Definition at line 570 of file avtextformat.c.

Referenced by print_pkt_side_data(), show_packet(), and show_stream().

◆ avtext_print_data_hash()

void avtext_print_data_hash ( AVTextFormatContext * tctx,
const char * key,
const uint8_t * data,
int size )

Definition at line 589 of file avtextformat.c.

Referenced by print_pkt_side_data(), show_packet(), and show_stream().

◆ avtext_get_formatter_by_name()

const AVTextFormatter * avtext_get_formatter_by_name ( const char * name)

Definition at line 705 of file avtextformat.c.

Referenced by init_graphprint(), and main().

Variable Documentation

◆ avtextformatter_default

const AVTextFormatter avtextformatter_default
extern

Definition at line 128 of file tf_default.c.

◆ avtextformatter_compact

const AVTextFormatter avtextformatter_compact
extern

Definition at line 239 of file tf_compact.c.

◆ avtextformatter_csv

const AVTextFormatter avtextformatter_csv
extern

Definition at line 270 of file tf_compact.c.

◆ avtextformatter_flat

const AVTextFormatter avtextformatter_flat
extern

Definition at line 150 of file tf_flat.c.

◆ avtextformatter_ini

const AVTextFormatter avtextformatter_ini
extern

Definition at line 140 of file tf_ini.c.

◆ avtextformatter_json

const AVTextFormatter avtextformatter_json
extern

Definition at line 202 of file tf_json.c.

◆ avtextformatter_xml

const AVTextFormatter avtextformatter_xml
extern

Definition at line 202 of file tf_xml.c.

Referenced by main().

◆ avtextformatter_mermaid

const AVTextFormatter avtextformatter_mermaid
extern

Definition at line 650 of file tf_mermaid.c.

◆ avtextformatter_mermaidhtml

const AVTextFormatter avtextformatter_mermaidhtml
extern

Definition at line 664 of file tf_mermaid.c.