FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
avtextformat.h File Reference
#include <stddef.h>
#include <stdint.h>
#include "libavutil/attributes.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  AVTextFormatSection
 
struct  AVTextFormatter
 
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 More...
 
#define AV_TEXTFORMAT_SECTION_FLAG_IS_ARRAY   2
 the section contains an array of elements of the same type More...
 
#define AV_TEXTFORMAT_SECTION_FLAG_HAS_VARIABLE_FIELDS   4
 the section may contain a variable number of fields with variable keys. More...
 
#define AV_TEXTFORMAT_SECTION_FLAG_HAS_TYPE   8
 For these sections the element_name field is mandatory. More...
 
#define AV_TEXTFORMAT_SECTION_FLAG_NUMBERING_BY_TYPE   16
 the items in this array section should be numbered individually by type More...
 
#define AV_TEXTFORMAT_FLAG_SUPPORTS_OPTIONAL_FIELDS   1
 
#define AV_TEXTFORMAT_FLAG_SUPPORTS_MIXED_ARRAY_CONTENT   2
 
#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 }
 

Functions

int avtext_context_open (AVTextFormatContext **ptctx, const AVTextFormatter *formatter, AVTextWriterContext *writer_context, const char *args, const struct AVTextFormatSection *sections, int nb_sections, int show_value_unit, int use_value_prefix, int use_byte_value_binary_prefix, int use_value_sexagesimal_format, int show_optional_fields, 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 avtext_print_string (AVTextFormatContext *tctx, const char *key, const char *val, int flags)
 
void avtext_print_unit_int (AVTextFormatContext *tctx, const char *key, int value, 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 *name, const uint8_t *data, int size)
 
void avtext_print_data_hash (AVTextFormatContext *tctx, const char *name, const uint8_t *data, int size)
 
void avtext_print_integers (AVTextFormatContext *tctx, const char *name, uint8_t *data, int size, const char *format, int columns, int bytes, int offset_add)
 
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
 

Macro Definition Documentation

◆ SECTION_MAX_NB_CHILDREN

#define SECTION_MAX_NB_CHILDREN   11

Definition at line 34 of file avtextformat.h.

◆ AV_TEXTFORMAT_SECTION_FLAG_IS_WRAPPER

#define AV_TEXTFORMAT_SECTION_FLAG_IS_WRAPPER   1

the section only contains other sections, but has no data at its own level

Definition at line 41 of file avtextformat.h.

◆ AV_TEXTFORMAT_SECTION_FLAG_IS_ARRAY

#define AV_TEXTFORMAT_SECTION_FLAG_IS_ARRAY   2

the section contains an array of elements of the same type

Definition at line 42 of file avtextformat.h.

◆ 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 43 of file avtextformat.h.

◆ 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 45 of file avtextformat.h.

◆ 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 46 of file avtextformat.h.

◆ AV_TEXTFORMAT_FLAG_SUPPORTS_OPTIONAL_FIELDS

#define AV_TEXTFORMAT_FLAG_SUPPORTS_OPTIONAL_FIELDS   1

Definition at line 59 of file avtextformat.h.

◆ AV_TEXTFORMAT_FLAG_SUPPORTS_MIXED_ARRAY_CONTENT

#define AV_TEXTFORMAT_FLAG_SUPPORTS_MIXED_ARRAY_CONTENT   2

Definition at line 60 of file avtextformat.h.

◆ SECTION_MAX_NB_LEVELS

#define SECTION_MAX_NB_LEVELS   12

Definition at line 85 of file avtextformat.h.

◆ SECTION_MAX_NB_SECTIONS

#define SECTION_MAX_NB_SECTIONS   100

Definition at line 86 of file avtextformat.h.

◆ AV_TEXTFORMAT_PRINT_STRING_OPTIONAL

#define AV_TEXTFORMAT_PRINT_STRING_OPTIONAL   1

Definition at line 123 of file avtextformat.h.

◆ AV_TEXTFORMAT_PRINT_STRING_VALIDATE

#define AV_TEXTFORMAT_PRINT_STRING_VALIDATE   2

Definition at line 124 of file avtextformat.h.

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 62 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 struct AVTextFormatSection sections,
int  nb_sections,
int  show_value_unit,
int  use_value_prefix,
int  use_byte_value_binary_prefix,
int  use_value_sexagesimal_format,
int  show_optional_fields,
char *  show_data_hash 
)

Definition at line 128 of file avtextformat.c.

Referenced by main().

◆ avtext_context_close()

int avtext_context_close ( AVTextFormatContext **  tctx)

Definition at line 102 of file avtextformat.c.

Referenced by avtext_context_open(), and main().

◆ avtext_print_section_header()

void avtext_print_section_header ( AVTextFormatContext tctx,
const void *  data,
int  section_id 
)

◆ avtext_print_section_footer()

void avtext_print_section_footer ( AVTextFormatContext tctx)

◆ avtext_print_integer()

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

Definition at line 288 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_int()

void avtext_print_unit_int ( AVTextFormatContext tctx,
const char *  key,
int  value,
const char *  unit 
)

Definition at line 413 of file avtextformat.c.

◆ avtext_print_rational()

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

Definition at line 460 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 469 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 486 of file avtextformat.c.

◆ avtext_print_data()

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

Definition at line 495 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 *  name,
const uint8_t *  data,
int  size 
)

Definition at line 523 of file avtextformat.c.

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

◆ avtext_print_integers()

void avtext_print_integers ( AVTextFormatContext tctx,
const char *  name,
uint8_t *  data,
int  size,
const char *  format,
int  columns,
int  bytes,
int  offset_add 
)

Definition at line 538 of file avtextformat.c.

Referenced by print_frame_side_data(), and print_pkt_side_data().

◆ avtext_get_formatter_by_name()

const AVTextFormatter* avtext_get_formatter_by_name ( const char *  name)

Definition at line 663 of file avtextformat.c.

Referenced by main().

Variable Documentation

◆ avtextformatter_default

const AVTextFormatter avtextformatter_default

Definition at line 136 of file tf_default.c.

Referenced by formatters_register_all().

◆ avtextformatter_compact

const AVTextFormatter avtextformatter_compact

Definition at line 241 of file tf_compact.c.

Referenced by formatters_register_all().

◆ avtextformatter_csv

const AVTextFormatter avtextformatter_csv

Definition at line 272 of file tf_compact.c.

Referenced by formatters_register_all().

◆ avtextformatter_flat

const AVTextFormatter avtextformatter_flat

Definition at line 165 of file tf_flat.c.

Referenced by formatters_register_all().

◆ avtextformatter_ini

const AVTextFormatter avtextformatter_ini

Definition at line 152 of file tf_ini.c.

Referenced by formatters_register_all().

◆ avtextformatter_json

const AVTextFormatter avtextformatter_json

Definition at line 204 of file tf_json.c.

Referenced by formatters_register_all().

◆ avtextformatter_xml

const AVTextFormatter avtextformatter_xml

Definition at line 210 of file tf_xml.c.

Referenced by formatters_register_all(), and main().