FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
graphprint.c File Reference
#include <string.h>
#include <stdatomic.h>
#include "graphprint.h"
#include "fftools/ffmpeg.h"
#include "fftools/ffmpeg_mux.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/pixdesc.h"
#include "libavutil/dict.h"
#include "libavutil/common.h"
#include "libavfilter/avfilter.h"
#include "libavutil/buffer.h"
#include "libavutil/hwcontext.h"
#include "fftools/textformat/avtextformat.h"
#include "fftools/textformat/tf_mermaid.h"
#include "fftools/resources/resman.h"

Go to the source code of this file.

Data Structures

struct  GraphPrintContext
 

Macros

#define print_id(k, v)   print_sanizied_id(gpc, k, v, 0)
 
#define print_id_noprefix(k, v)   print_sanizied_id(gpc, k, v, 1)
 
#define print_int(k, v)   avtext_print_integer(tfc, k, v, 0)
 
#define print_int_opt(k, v)   avtext_print_integer(tfc, k, v, gpc->opt_flags)
 
#define print_q(k, v, s)   avtext_print_rational(tfc, k, v, s)
 
#define print_str(k, v)   avtext_print_string(tfc, k, v, 0)
 
#define print_str_opt(k, v)   avtext_print_string(tfc, k, v, gpc->opt_flags)
 
#define print_val(k, v, u)   avtext_print_unit_integer(tfc, k, v, u)
 
#define print_fmt(k, f, ...)
 
#define print_fmt_opt(k, f, ...)
 

Enumerations

enum  SectionID {
  SECTION_ID_CHAPTER, SECTION_ID_CHAPTER_TAGS, SECTION_ID_CHAPTERS, SECTION_ID_ERROR,
  SECTION_ID_FORMAT, SECTION_ID_FORMAT_TAGS, SECTION_ID_FRAME, SECTION_ID_FRAMES,
  SECTION_ID_FRAME_TAGS, SECTION_ID_FRAME_SIDE_DATA_LIST, SECTION_ID_FRAME_SIDE_DATA, SECTION_ID_FRAME_SIDE_DATA_TIMECODE_LIST,
  SECTION_ID_FRAME_SIDE_DATA_TIMECODE, SECTION_ID_FRAME_SIDE_DATA_COMPONENT_LIST, SECTION_ID_FRAME_SIDE_DATA_COMPONENT, SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST,
  SECTION_ID_FRAME_SIDE_DATA_PIECE, SECTION_ID_FRAME_LOG, SECTION_ID_FRAME_LOGS, SECTION_ID_LIBRARY_VERSION,
  SECTION_ID_LIBRARY_VERSIONS, SECTION_ID_PACKET, SECTION_ID_PACKET_TAGS, SECTION_ID_PACKETS,
  SECTION_ID_PACKETS_AND_FRAMES, SECTION_ID_PACKET_SIDE_DATA_LIST, SECTION_ID_PACKET_SIDE_DATA, SECTION_ID_PIXEL_FORMAT,
  SECTION_ID_PIXEL_FORMAT_FLAGS, SECTION_ID_PIXEL_FORMAT_COMPONENT, SECTION_ID_PIXEL_FORMAT_COMPONENTS, SECTION_ID_PIXEL_FORMATS,
  SECTION_ID_PROGRAM_STREAM_DISPOSITION, SECTION_ID_PROGRAM_STREAM_TAGS, SECTION_ID_PROGRAM, SECTION_ID_PROGRAM_STREAMS,
  SECTION_ID_PROGRAM_STREAM, SECTION_ID_PROGRAM_TAGS, SECTION_ID_PROGRAM_VERSION, SECTION_ID_PROGRAMS,
  SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION, SECTION_ID_STREAM_GROUP_STREAM_TAGS, SECTION_ID_STREAM_GROUP, SECTION_ID_STREAM_GROUP_COMPONENTS,
  SECTION_ID_STREAM_GROUP_COMPONENT, SECTION_ID_STREAM_GROUP_SUBCOMPONENTS, SECTION_ID_STREAM_GROUP_SUBCOMPONENT, SECTION_ID_STREAM_GROUP_PIECES,
  SECTION_ID_STREAM_GROUP_PIECE, SECTION_ID_STREAM_GROUP_SUBPIECES, SECTION_ID_STREAM_GROUP_SUBPIECE, SECTION_ID_STREAM_GROUP_BLOCKS,
  SECTION_ID_STREAM_GROUP_BLOCK, SECTION_ID_STREAM_GROUP_STREAMS, SECTION_ID_STREAM_GROUP_STREAM, SECTION_ID_STREAM_GROUP_DISPOSITION,
  SECTION_ID_STREAM_GROUP_TAGS, SECTION_ID_STREAM_GROUPS, SECTION_ID_ROOT, SECTION_ID_STREAM,
  SECTION_ID_STREAM_DISPOSITION, SECTION_ID_STREAMS, SECTION_ID_STREAM_TAGS, SECTION_ID_STREAM_SIDE_DATA_LIST,
  SECTION_ID_STREAM_SIDE_DATA, SECTION_ID_SUBTITLE, SECTION_ID_ROOT, SECTION_ID_FILTERGRAPHS,
  SECTION_ID_FILTERGRAPH, SECTION_ID_GRAPH_INPUTS, SECTION_ID_GRAPH_INPUT, SECTION_ID_GRAPH_OUTPUTS,
  SECTION_ID_GRAPH_OUTPUT, SECTION_ID_FILTERS, SECTION_ID_FILTER, SECTION_ID_FILTER_INPUTS,
  SECTION_ID_FILTER_INPUT, SECTION_ID_FILTER_OUTPUTS, SECTION_ID_FILTER_OUTPUT, SECTION_ID_HWFRAMESCONTEXT,
  SECTION_ID_INPUTFILES, SECTION_ID_INPUTFILE, SECTION_ID_INPUTSTREAMS, SECTION_ID_INPUTSTREAM,
  SECTION_ID_OUTPUTFILES, SECTION_ID_OUTPUTFILE, SECTION_ID_OUTPUTSTREAMS, SECTION_ID_OUTPUTSTREAM,
  SECTION_ID_STREAMLINKS, SECTION_ID_STREAMLINK, SECTION_ID_DECODERS, SECTION_ID_DECODER,
  SECTION_ID_ENCODERS, SECTION_ID_ENCODER
}
 

Functions

static char * upcase_string (char *dst, size_t dst_size, const char *src)
 
static char * get_extension (const char *url)
 
static void print_hwdevicecontext (const GraphPrintContext *gpc, const AVHWDeviceContext *hw_device_context)
 
static void print_hwframescontext (const GraphPrintContext *gpc, const AVHWFramesContext *hw_frames_context)
 
static void print_link (GraphPrintContext *gpc, AVFilterLink *link)
 
static char sanitize_char (const char c)
 
static void print_sanizied_id (const GraphPrintContext *gpc, const char *key, const char *id_str, int skip_prefix)
 
static void print_section_header_id (const GraphPrintContext *gpc, int section_id, const char *id_str, int skip_prefix)
 
static const char * get_filterpad_name (const AVFilterPad *pad)
 
static void print_filter (GraphPrintContext *gpc, const AVFilterContext *filter, AVDictionary *input_map, AVDictionary *output_map)
 
static void init_sections (void)
 
static void print_filtergraph_single (GraphPrintContext *gpc, FilterGraph *fg, AVFilterGraph *graph)
 
static int print_streams (GraphPrintContext *gpc, InputFile **ifiles, int nb_ifiles, OutputFile **ofiles, int nb_ofiles)
 
static void uninit_graphprint (GraphPrintContext *gpc)
 
static int init_graphprint (GraphPrintContext **pgpc, AVBPrint *target_buf)
 
int print_filtergraph (FilterGraph *fg, AVFilterGraph *graph)
 
static int print_filtergraphs_priv (FilterGraph **graphs, int nb_graphs, InputFile **ifiles, int nb_ifiles, OutputFile **ofiles, int nb_ofiles)
 
int print_filtergraphs (FilterGraph **graphs, int nb_graphs, InputFile **ifiles, int nb_ifiles, OutputFile **ofiles, int nb_ofiles)
 

Variables

static struct AVTextFormatSection sections []
 
static atomic_int prefix_num = 0
 

Detailed Description

output writers for filtergraph details

Definition in file graphprint.c.

Macro Definition Documentation

◆ print_id

#define print_id (   k,
 
)    print_sanizied_id(gpc, k, v, 0)

Definition at line 136 of file graphprint.c.

◆ print_id_noprefix

#define print_id_noprefix (   k,
 
)    print_sanizied_id(gpc, k, v, 1)

Definition at line 137 of file graphprint.c.

◆ print_int

#define print_int (   k,
 
)    avtext_print_integer(tfc, k, v, 0)

Definition at line 138 of file graphprint.c.

◆ print_int_opt

#define print_int_opt (   k,
 
)    avtext_print_integer(tfc, k, v, gpc->opt_flags)

Definition at line 139 of file graphprint.c.

◆ print_q

#define print_q (   k,
  v,
  s 
)    avtext_print_rational(tfc, k, v, s)

Definition at line 140 of file graphprint.c.

◆ print_str

#define print_str (   k,
 
)    avtext_print_string(tfc, k, v, 0)

Definition at line 141 of file graphprint.c.

◆ print_str_opt

#define print_str_opt (   k,
 
)    avtext_print_string(tfc, k, v, gpc->opt_flags)

Definition at line 142 of file graphprint.c.

◆ print_val

#define print_val (   k,
  v,
  u 
)    avtext_print_unit_integer(tfc, k, v, u)

Definition at line 143 of file graphprint.c.

◆ print_fmt

#define print_fmt (   k,
  f,
  ... 
)
Value:
do { \
av_bprint_clear(&gpc->pbuf); \
av_bprintf(&gpc->pbuf, f, __VA_ARGS__); \
avtext_print_string(tfc, k, gpc->pbuf.str, 0); \
} while (0)

Definition at line 145 of file graphprint.c.

◆ print_fmt_opt

#define print_fmt_opt (   k,
  f,
  ... 
)
Value:
do { \
av_bprint_clear(&gpc->pbuf); \
av_bprintf(&gpc->pbuf, f, __VA_ARGS__); \
avtext_print_string(tfc, k, gpc->pbuf.str, gpc->opt_flags); \
} while (0)

Definition at line 151 of file graphprint.c.

Enumeration Type Documentation

◆ SectionID

enum SectionID
Enumerator
SECTION_ID_CHAPTER 
SECTION_ID_CHAPTER_TAGS 
SECTION_ID_CHAPTERS 
SECTION_ID_ERROR 
SECTION_ID_FORMAT 
SECTION_ID_FORMAT_TAGS 
SECTION_ID_FRAME 
SECTION_ID_FRAMES 
SECTION_ID_FRAME_TAGS 
SECTION_ID_FRAME_SIDE_DATA_LIST 
SECTION_ID_FRAME_SIDE_DATA 
SECTION_ID_FRAME_SIDE_DATA_TIMECODE_LIST 
SECTION_ID_FRAME_SIDE_DATA_TIMECODE 
SECTION_ID_FRAME_SIDE_DATA_COMPONENT_LIST 
SECTION_ID_FRAME_SIDE_DATA_COMPONENT 
SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST 
SECTION_ID_FRAME_SIDE_DATA_PIECE 
SECTION_ID_FRAME_LOG 
SECTION_ID_FRAME_LOGS 
SECTION_ID_LIBRARY_VERSION 
SECTION_ID_LIBRARY_VERSIONS 
SECTION_ID_PACKET 
SECTION_ID_PACKET_TAGS 
SECTION_ID_PACKETS 
SECTION_ID_PACKETS_AND_FRAMES 
SECTION_ID_PACKET_SIDE_DATA_LIST 
SECTION_ID_PACKET_SIDE_DATA 
SECTION_ID_PIXEL_FORMAT 
SECTION_ID_PIXEL_FORMAT_FLAGS 
SECTION_ID_PIXEL_FORMAT_COMPONENT 
SECTION_ID_PIXEL_FORMAT_COMPONENTS 
SECTION_ID_PIXEL_FORMATS 
SECTION_ID_PROGRAM_STREAM_DISPOSITION 
SECTION_ID_PROGRAM_STREAM_TAGS 
SECTION_ID_PROGRAM 
SECTION_ID_PROGRAM_STREAMS 
SECTION_ID_PROGRAM_STREAM 
SECTION_ID_PROGRAM_TAGS 
SECTION_ID_PROGRAM_VERSION 
SECTION_ID_PROGRAMS 
SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION 
SECTION_ID_STREAM_GROUP_STREAM_TAGS 
SECTION_ID_STREAM_GROUP 
SECTION_ID_STREAM_GROUP_COMPONENTS 
SECTION_ID_STREAM_GROUP_COMPONENT 
SECTION_ID_STREAM_GROUP_SUBCOMPONENTS 
SECTION_ID_STREAM_GROUP_SUBCOMPONENT 
SECTION_ID_STREAM_GROUP_PIECES 
SECTION_ID_STREAM_GROUP_PIECE 
SECTION_ID_STREAM_GROUP_SUBPIECES 
SECTION_ID_STREAM_GROUP_SUBPIECE 
SECTION_ID_STREAM_GROUP_BLOCKS 
SECTION_ID_STREAM_GROUP_BLOCK 
SECTION_ID_STREAM_GROUP_STREAMS 
SECTION_ID_STREAM_GROUP_STREAM 
SECTION_ID_STREAM_GROUP_DISPOSITION 
SECTION_ID_STREAM_GROUP_TAGS 
SECTION_ID_STREAM_GROUPS 
SECTION_ID_ROOT 
SECTION_ID_STREAM 
SECTION_ID_STREAM_DISPOSITION 
SECTION_ID_STREAMS 
SECTION_ID_STREAM_TAGS 
SECTION_ID_STREAM_SIDE_DATA_LIST 
SECTION_ID_STREAM_SIDE_DATA 
SECTION_ID_SUBTITLE 
SECTION_ID_ROOT 
SECTION_ID_FILTERGRAPHS 
SECTION_ID_FILTERGRAPH 
SECTION_ID_GRAPH_INPUTS 
SECTION_ID_GRAPH_INPUT 
SECTION_ID_GRAPH_OUTPUTS 
SECTION_ID_GRAPH_OUTPUT 
SECTION_ID_FILTERS 
SECTION_ID_FILTER 
SECTION_ID_FILTER_INPUTS 
SECTION_ID_FILTER_INPUT 
SECTION_ID_FILTER_OUTPUTS 
SECTION_ID_FILTER_OUTPUT 
SECTION_ID_HWFRAMESCONTEXT 
SECTION_ID_INPUTFILES 
SECTION_ID_INPUTFILE 
SECTION_ID_INPUTSTREAMS 
SECTION_ID_INPUTSTREAM 
SECTION_ID_OUTPUTFILES 
SECTION_ID_OUTPUTFILE 
SECTION_ID_OUTPUTSTREAMS 
SECTION_ID_OUTPUTSTREAM 
SECTION_ID_STREAMLINKS 
SECTION_ID_STREAMLINK 
SECTION_ID_DECODERS 
SECTION_ID_DECODER 
SECTION_ID_ENCODERS 
SECTION_ID_ENCODER 

Definition at line 46 of file graphprint.c.

Function Documentation

◆ upcase_string()

static char* upcase_string ( char *  dst,
size_t  dst_size,
const char *  src 
)
inlinestatic

Definition at line 160 of file graphprint.c.

Referenced by print_streams().

◆ get_extension()

static char* get_extension ( const char *  url)
static

Definition at line 169 of file graphprint.c.

Referenced by print_streams().

◆ print_hwdevicecontext()

static void print_hwdevicecontext ( const GraphPrintContext gpc,
const AVHWDeviceContext hw_device_context 
)
static

Definition at line 201 of file graphprint.c.

Referenced by print_filter().

◆ print_hwframescontext()

static void print_hwframescontext ( const GraphPrintContext gpc,
const AVHWFramesContext hw_frames_context 
)
static

Definition at line 212 of file graphprint.c.

Referenced by print_link().

◆ print_link()

static void print_link ( GraphPrintContext gpc,
AVFilterLink link 
)
static

Definition at line 247 of file graphprint.c.

Referenced by print_filter().

◆ sanitize_char()

static char sanitize_char ( const char  c)
static

Definition at line 324 of file graphprint.c.

Referenced by print_sanizied_id(), and print_section_header_id().

◆ print_sanizied_id()

static void print_sanizied_id ( const GraphPrintContext gpc,
const char *  key,
const char *  id_str,
int  skip_prefix 
)
static

Definition at line 331 of file graphprint.c.

◆ print_section_header_id()

static void print_section_header_id ( const GraphPrintContext gpc,
int  section_id,
const char *  id_str,
int  skip_prefix 
)
static

Definition at line 353 of file graphprint.c.

Referenced by print_filter(), print_filtergraph_single(), and print_streams().

◆ get_filterpad_name()

static const char* get_filterpad_name ( const AVFilterPad pad)
static

Definition at line 378 of file graphprint.c.

Referenced by print_filter().

◆ print_filter()

static void print_filter ( GraphPrintContext gpc,
const AVFilterContext filter,
AVDictionary input_map,
AVDictionary output_map 
)
static

Definition at line 383 of file graphprint.c.

Referenced by print_filtergraph_single().

◆ init_sections()

static void init_sections ( void  )
static

Definition at line 473 of file graphprint.c.

Referenced by init_graphprint().

◆ print_filtergraph_single()

static void print_filtergraph_single ( GraphPrintContext gpc,
FilterGraph fg,
AVFilterGraph graph 
)
static

Definition at line 479 of file graphprint.c.

Referenced by print_filtergraph().

◆ print_streams()

static int print_streams ( GraphPrintContext gpc,
InputFile **  ifiles,
int  nb_ifiles,
OutputFile **  ofiles,
int  nb_ofiles 
)
static

Definition at line 588 of file graphprint.c.

Referenced by print_filtergraphs_priv().

◆ uninit_graphprint()

static void uninit_graphprint ( GraphPrintContext gpc)
static

Definition at line 857 of file graphprint.c.

Referenced by print_filtergraph(), and print_filtergraphs_priv().

◆ init_graphprint()

static int init_graphprint ( GraphPrintContext **  pgpc,
AVBPrint *  target_buf 
)
static

Definition at line 871 of file graphprint.c.

Referenced by print_filtergraph(), and print_filtergraphs_priv().

◆ print_filtergraph()

int print_filtergraph ( FilterGraph fg,
AVFilterGraph graph 
)

Definition at line 954 of file graphprint.c.

Referenced by filter_thread().

◆ print_filtergraphs_priv()

static int print_filtergraphs_priv ( FilterGraph **  graphs,
int  nb_graphs,
InputFile **  ifiles,
int  nb_ifiles,
OutputFile **  ofiles,
int  nb_ofiles 
)
static

Definition at line 1003 of file graphprint.c.

Referenced by print_filtergraphs().

◆ print_filtergraphs()

int print_filtergraphs ( FilterGraph **  graphs,
int  nb_graphs,
InputFile **  ifiles,
int  nb_ifiles,
OutputFile **  ofiles,
int  nb_ofiles 
)

Definition at line 1093 of file graphprint.c.

Referenced by ffmpeg_cleanup().

Variable Documentation

◆ sections

struct AVTextFormatSection sections[]
static

Definition at line 77 of file graphprint.c.

Referenced by init_graphprint(), and init_sections().

◆ prefix_num

atomic_int prefix_num = 0
static

Definition at line 158 of file graphprint.c.

Referenced by init_graphprint().

f
f
Definition: af_crystalizer.c:122