79 [
SECTION_ID_ROOT] = {
SECTION_ID_ROOT,
"root",
AV_TEXTFORMAT_SECTION_FLAG_IS_WRAPPER, {
SECTION_ID_FILTERGRAPHS,
SECTION_ID_INPUTFILES,
SECTION_ID_OUTPUTFILES,
SECTION_ID_DECODERS,
SECTION_ID_ENCODERS,
SECTION_ID_STREAMLINKS, -1 } },
154 uint32_t
len = str ? strlen(str) + 1 : 0;
163 if ((
size_t)(end - *p) <
size)
170static int rec_read_str(
const uint8_t **p,
const uint8_t *end,
const char **str)
177 if ((
size_t)(end - *p) <
len || (
len && (*p)[
len - 1]))
179 *str =
len ? (
const char *)*p :
NULL;
264 snprintf(buf,
sizeof(buf),
"%d%c%d", q.
num, sep, q.
den);
270 const uint8_t *p = (
const uint8_t *)rec->str;
271 const uint8_t *end = p +
FFMIN(rec->len, rec->size - 1);
276 const char *
key, *str;
286 if ((ret =
rec_read(&p, end, &
id,
sizeof(
id))) < 0 ||
287 (ret =
rec_read(&p, end, &has_ctx,
sizeof(has_ctx))) < 0)
332#define print_id(k, v) print_sanizied_id(gpc, k, v, 0)
333#define print_id_noprefix(k, v) print_sanizied_id(gpc, k, v, 1)
334#define print_int(k, v) gp_print_integer(gpc, k, v, 0)
335#define print_int_opt(k, v) gp_print_integer(gpc, k, v, gpc->opt_flags)
336#define print_q(k, v, s) gp_print_rational(gpc, k, v, s)
337#define print_str(k, v) gp_print_string(gpc, k, v, 0)
338#define print_str_opt(k, v) gp_print_string(gpc, k, v, gpc->opt_flags)
339#define print_val(k, v, u) gp_print_unit_integer(gpc, k, v, u)
341#define print_fmt(k, f, ...) do { \
342 av_bprint_clear(&gpc->pbuf); \
343 av_bprintf(&gpc->pbuf, f, __VA_ARGS__); \
344 gp_print_string(gpc, k, gpc->pbuf.str, 0); \
347#define print_fmt_opt(k, f, ...) do { \
348 av_bprint_clear(&gpc->pbuf); \
349 av_bprintf(&gpc->pbuf, f, __VA_ARGS__); \
350 gp_print_string(gpc, k, gpc->pbuf.str, gpc->opt_flags); \
359 for (
i = 0;
src[
i] &&
i < dst_size - 1;
i++)
367 const char *dot =
NULL;
368 const char *sep =
NULL;
376 end = strpbrk(url,
"?#");
378 end = url + strlen(url);
381 for (
const char *p = url; p < end; p++) {
384 else if (*p ==
'/' || *p ==
'\\')
389 if (dot && dot != url && (!sep || dot > sep + 1) && (dot + 1) < end) {
400 if (!hw_device_context)
412 if (!hw_frames_context || !hw_frames_context->
device_ctx)
423 if (pix_desc_hw->
alias)
430 if (pix_desc_sw->
alias)
444 char layout_string[64];
453 switch (link->
type) {
456 if (hw_frames_ctx && hw_frames_ctx->
data) {
460 if (pix_desc_hw && pix_desc_sw)
466 if (link->
w && link->
h) {
487 if (link->
w && link->
h) {
500 print_str(
"channel_layout", layout_string);
512 if (hw_frames_ctx && hw_frames_ctx->
data)
519 if ((
c >=
'0' &&
c <=
'9') || (
c >=
'a' &&
c <=
'z') || (
c >=
'A' &&
c <=
'Z'))
537 for (
const char *p = id_str; *p; p++)
559 for (
const char *p = id_str; *p; p++)
589 if (
filter->hw_device_ctx) {
592 if (
filter->extra_hw_frames > 0)
598 for (
unsigned i = 0;
i <
filter->nb_inputs;
i++) {
612 (void)snprintf(buf,
sizeof(buf),
"in_%s", dic_entry->
value);
630 for (
unsigned i = 0;
i <
filter->nb_outputs;
i++) {
641 (void)snprintf(buf,
sizeof(buf),
"out_%s", dic_entry->
value);
780 for (
int n = nb_ifiles - 1; n >= 0; n--) {
812 if (!ist || !ist->
par)
829 if (codec_desc && codec_desc->
name) {
832 }
else if (ist->
dec) {
859 for (
int n = 0; n < nb_ifiles; n++) {
896 for (
int n = 0; n < nb_ofiles; n++) {
903 if (!
ost || !
ost->st || !
ost->st->codecpar || !
ost->enc)
922 print_fmt(
"name",
"%s",
ost->enc->enc_ctx->av_class->item_name(
ost->enc->enc_ctx));
935 for (
int n = nb_ofiles - 1; n >= 0; n--) {
981 if (codec_desc && codec_desc->
name) {
1004 for (
int n = 0; n < nb_ofiles; n++) {
1010 if (
ost->ist && !
ost->filter) {
1016 print_fmt(
"dest_stream_id",
"out__%d_%d", n,
i);
1017 print_fmt(
"source_stream_id",
"in_%d_%d",
ost->ist->file->index,
ost->ist->index);
1020 print_fmt(
"dest_stream_id",
"r_out__%d_%d", n,
i);
1021 print_fmt(
"source_stream_id",
"r_in_%d_%d",
ost->ist->file->index,
ost->ist->index);
1068 if (!text_formatter) {
1100 gpc->
rec = record ? target_buf :
NULL;
1117 if (tfc && (!strcmp(text_formatter->
name,
"mermaid") || !strcmp(text_formatter->
name,
"mermaidhtml"))) {
1120 if (!strcmp(text_formatter->
name,
"mermaidhtml"))
1149 if (target_buf->len)
1171 if (graph_buf->len > 0) {
1183 AVBPrint target_buf;
1193 for (
int i = 0;
i < nb_graphs;
i++)
1196 for (
int n = 0; n < nb_ofiles; n++) {
1217 printf(
"%s", target_buf.str);
1225 avio_write(avio, (
const unsigned char *)target_buf.str,
FFMIN(target_buf.len, target_buf.size - 1));
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
Main libavfilter public API header.
int avio_closep(AVIOContext **s)
Close the resource accessed by the AVIOContext *s, free it and set the pointer pointing to it to NULL...
int avio_open2(AVIOContext **s, const char *filename, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options)
Create and initialize a AVIOContext for accessing the resource indicated by url.
#define AVIO_FLAG_WRITE
write-only
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
char * av_asprintf(const char *fmt,...)
void avtext_print_integer(AVTextFormatContext *tctx, const char *key, int64_t val, int flags)
void avtext_print_unit_integer(AVTextFormatContext *tctx, const char *key, int64_t val, AVTextFormatValueFormat fmt, const char *unit)
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_print_string(AVTextFormatContext *tctx, const char *key, const char *val, int flags)
int avtext_context_close(AVTextFormatContext **ptctx)
void avtext_print_section_header(AVTextFormatContext *tctx, const void *data, int section_id)
void avtext_print_section_footer(AVTextFormatContext *tctx)
const AVTextFormatter * avtext_get_formatter_by_name(const char *name)
int avtextwriter_context_close(AVTextWriterContext **pwctx)
#define AV_TEXTFORMAT_PRINT_STRING_OPTIONAL
#define AV_TEXTFORMAT_SECTION_FLAG_IS_WRAPPER
the section only contains other sections, but has no data at its own level
#define AV_TEXTFORMAT_SECTION_FLAG_HAS_VARIABLE_FIELDS
the section may contain a variable number of fields with variable keys.
@ AV_TEXTFORMAT_VALUE_FMT_INT
#define AV_TEXTFORMAT_SECTION_FLAG_HAS_LINKS
...
#define AV_TEXTFORMAT_SECTION_FLAG_IS_ARRAY
the section contains an array of elements of the same type
#define AV_TEXTFORMAT_SECTION_FLAG_IS_SHAPE
...
#define AV_TEXTFORMAT_SECTION_FLAG_IS_SUBGRAPH
...
#define AV_TEXTFORMAT_FLAG_IS_DIAGRAM_FORMATTER
#define AV_TEXTFORMAT_SECTION_PRINT_TAGS
...
int avtextwriter_create_buffer(AVTextWriterContext **pwctx, AVBPrint *buffer)
void av_bprintf(AVBPrint *buf, const char *fmt,...)
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
#define AV_BPRINT_SIZE_UNLIMITED
refcounted data buffer API
#define flags(name, subs,...)
#define i(width, name, range_min, range_max)
common internal and external API header
__device__ int printf(const char *,...)
static const uint16_t fc[]
char * print_graphs_format
static const AVTextFormatSection sections[]
static av_cold void cleanup(FlashSV2Context *s)
static void print_filtergraph_single(GraphPrintContext *gpc, FilterGraph *fg, AVFilterGraph *graph)
@ SECTION_ID_FILTERGRAPHS
@ SECTION_ID_OUTPUTSTREAM
@ SECTION_ID_HWFRAMESCONTEXT
@ SECTION_ID_FILTER_INPUT
@ SECTION_ID_FILTER_OUTPUT
@ SECTION_ID_GRAPH_OUTPUTS
@ SECTION_ID_GRAPH_OUTPUT
@ SECTION_ID_FILTER_OUTPUTS
@ SECTION_ID_INPUTSTREAMS
@ SECTION_ID_FILTER_INPUTS
@ SECTION_ID_GRAPH_INPUTS
@ SECTION_ID_OUTPUTSTREAMS
static int print_filtergraphs_priv(FilterGraph **graphs, int nb_graphs, InputFile **ifiles, int nb_ifiles, OutputFile **ofiles, int nb_ofiles)
static int rec_read(const uint8_t **p, const uint8_t *end, void *data, size_t size)
static void print_hwframescontext(const GraphPrintContext *gpc, const AVHWFramesContext *hw_frames_context)
static void print_recorded_graph(const GraphPrintContext *gpc, AVBPrint *graph_buf)
static void print_sanizied_id(const GraphPrintContext *gpc, const char *key, const char *id_str, int skip_prefix)
static int print_streams(GraphPrintContext *gpc, InputFile **ifiles, int nb_ifiles, OutputFile **ofiles, int nb_ofiles)
static void gp_print_integer(const GraphPrintContext *gpc, const char *key, int64_t value, int flags)
static void gp_print_unit_integer(const GraphPrintContext *gpc, const char *key, int64_t value, const char *unit)
#define print_int_opt(k, v)
static char * get_extension(const char *url)
static void print_hwdevicecontext(const GraphPrintContext *gpc, const AVHWDeviceContext *hw_device_context)
static const char * get_filterpad_name(const AVFilterPad *pad)
static atomic_int prefix_num
#define print_id_noprefix(k, v)
int print_filtergraph(FilterGraph *fg, AVFilterGraph *graph)
#define print_str_opt(k, v)
static void rec_write(AVBPrint *rec, const void *data, size_t size)
#define print_val(k, v, u)
static void gp_section_header(const GraphPrintContext *gpc, const AVTextFormatSectionContext *sec_ctx, int section_id)
static void print_filter(GraphPrintContext *gpc, const AVFilterContext *filter, AVDictionary *input_map, AVDictionary *output_map)
static void print_section_header_id(const GraphPrintContext *gpc, int section_id, const char *id_str, int skip_prefix)
static void rec_write_str(AVBPrint *rec, const char *str)
static int gp_replay(const GraphPrintContext *gpc, const AVBPrint *rec)
static int rec_read_str(const uint8_t **p, const uint8_t *end, const char **str)
static void gp_print_string(const GraphPrintContext *gpc, const char *key, const char *value, int flags)
static void gp_print_rational(const GraphPrintContext *gpc, const char *key, AVRational q, char sep)
static void print_link(GraphPrintContext *gpc, AVFilterLink *link)
static char * upcase_string(char *dst, size_t dst_size, const char *src)
static void uninit_graphprint(GraphPrintContext *gpc)
static char sanitize_char(const char c)
#define print_fmt_opt(k, f,...)
static void gp_section_footer(const GraphPrintContext *gpc)
int print_filtergraphs(FilterGraph **graphs, int nb_graphs, InputFile **ifiles, int nb_ifiles, OutputFile **ofiles, int nb_ofiles)
#define print_fmt(k, f,...)
static int init_graphprint(GraphPrintContext **pgpc, AVBPrint *target_buf, int record)
const AVCodecDescriptor * avcodec_descriptor_get(enum AVCodecID id)
const char * avfilter_pad_get_name(const AVFilterPad *pads, int pad_idx)
Get the name of an AVFilterPad.
AVBufferRef * avfilter_link_get_hw_frames_ctx(AVFilterLink *link)
Get the hardware frames context of a filter link.
int av_channel_layout_describe(const AVChannelLayout *channel_layout, char *buf, size_t buf_size)
Get a human-readable string describing the channel layout properties.
static int av_bprint_is_complete(const AVBPrint *buf)
Test if the print buffer is complete (not truncated).
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
void av_bprint_append_data(AVBPrint *buf, const char *data, unsigned size)
Append data to a print buffer.
void av_bprint_chars(AVBPrint *buf, char c, unsigned n)
Append char c n times to a print buffer.
void av_bprint_clear(AVBPrint *buf)
Reset the string to "" but keep internal allocated data.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
#define AV_LOG_INFO
Standard information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
char * av_strndup(const char *s, size_t len)
Duplicate a substring of a string.
const char * av_get_media_type_string(enum AVMediaType media_type)
Return a string describing the media_type enum, NULL if media_type is unknown.
static void * av_x_if_null(const void *p, const void *x)
Return x default pointer in case p is NULL.
@ AVMEDIA_TYPE_ATTACHMENT
Opaque data information usually sparse.
@ AVMEDIA_TYPE_DATA
Opaque data information usually continuous.
static av_const int av_toupper(int c)
Locale-independent conversion of ASCII characters to uppercase.
const char * av_hwdevice_get_type_name(enum AVHWDeviceType type)
Get the string name of an AVHWDeviceType.
static int op(uint8_t **dst, const uint8_t *dst_end, GetByteContext *gb, int pixel, int count, int *x, int width, int linesize)
Perform decode operation.
Memory handling functions.
const char * av_color_space_name(enum AVColorSpace space)
const char * av_color_range_name(enum AVColorRange range)
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
@ AVCOL_RANGE_UNSPECIFIED
char * ff_resman_get_string(FFResourceId resource_id)
void ff_resman_uninit(void)
#define FF_ARRAY_ELEMS(a)
#define atomic_fetch_add(object, operand)
A reference to a data buffer.
uint8_t * data
The data buffer.
int nb_channels
Number of channels in this layout.
This struct describes the properties of a single codec described by an AVCodecID.
const char * long_name
A more descriptive name for this codec.
const char * name
Name of the codec described by this descriptor.
enum AVMediaType codec_type
General type of the encoded data.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
const char * name
Name of the codec implementation.
const char * html_template
char * name
name of this filter instance
const AVFilter * filter
the AVFilter of which this is an instance
AVFilterContext ** filters
A link between two filters.
int w
agreed upon image width
int h
agreed upon image height
enum AVMediaType type
filter media type
AVFilterContext * src
source filter
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
int sample_rate
samples per second
AVChannelLayout ch_layout
channel layout of current buffer (see libavutil/channel_layout.h)
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
enum AVColorSpace colorspace
For non-YUV links, these are respectively set to fallback values (as appropriate for that colorspace)...
AVFilterPad * srcpad
output pad on the source filter
AVFilterPad * dstpad
input pad on the dest filter
AVFilterContext * dst
dest filter
int format
agreed upon media format
enum AVColorRange color_range
agreed upon YUV color range
A filter pad used for either input or output.
const char * name
Filter name.
const struct AVOutputFormat * oformat
The output container format.
This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e.
enum AVHWDeviceType type
This field identifies the underlying API used for hardware access.
This struct describes a set or pool of "hardware" frames (i.e.
enum AVPixelFormat format
The pixel format identifying the underlying HW surface type.
enum AVPixelFormat sw_format
The pixel format identifying the actual data layout of the hardware frames.
int initial_pool_size
Initial size of the frame pool.
int width
The allocated dimensions of the frames in this pool.
AVHWDeviceContext * device_ctx
The parent AVHWDeviceContext.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
const char * alias
Alternative comma-separated names.
Rational number (pair of numerator and denominator).
const char * context_type
int flags
a combination or AV_TEXTFORMAT__FLAG_*
struct AVBPrint graph_print_buf
AVTextWriterContext * wctx
AVBPrint * rec
record of the print calls, used instead of a formatter context
AVTextFormatContext * tfc
AVDiagramConfig diagram_config
void(* filter)(uint8_t *src, ptrdiff_t stride, int qscale)
void av_diagram_init(AVTextFormatContext *tfc, AVDiagramConfig *diagram_config)