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 } },
137#define print_id(k, v) print_sanizied_id(gpc, k, v, 0)
138#define print_id_noprefix(k, v) print_sanizied_id(gpc, k, v, 1)
139#define print_int(k, v) avtext_print_integer(tfc, k, v, 0)
140#define print_int_opt(k, v) avtext_print_integer(tfc, k, v, gpc->opt_flags)
141#define print_q(k, v, s) avtext_print_rational(tfc, k, v, s)
142#define print_str(k, v) avtext_print_string(tfc, k, v, 0)
143#define print_str_opt(k, v) avtext_print_string(tfc, k, v, gpc->opt_flags)
144#define print_val(k, v, u) avtext_print_unit_integer(tfc, k, v, AV_TEXTFORMAT_VALUE_FMT_INT, u)
146#define print_fmt(k, f, ...) do { \
147 av_bprint_clear(&gpc->pbuf); \
148 av_bprintf(&gpc->pbuf, f, __VA_ARGS__); \
149 avtext_print_string(tfc, k, gpc->pbuf.str, 0); \
152#define print_fmt_opt(k, f, ...) do { \
153 av_bprint_clear(&gpc->pbuf); \
154 av_bprintf(&gpc->pbuf, f, __VA_ARGS__); \
155 avtext_print_string(tfc, k, gpc->pbuf.str, gpc->opt_flags); \
164 for (
i = 0;
src[
i] &&
i < dst_size - 1;
i++)
172 const char *dot =
NULL;
173 const char *sep =
NULL;
181 end = strpbrk(url,
"?#");
183 end = url + strlen(url);
186 for (
const char *p = url; p < end; p++) {
189 else if (*p ==
'/' || *p ==
'\\')
194 if (dot && dot != url && (!sep || dot > sep + 1) && (dot + 1) < end) {
206 if (!hw_device_context)
219 if (!hw_frames_context || !hw_frames_context->
device_ctx)
230 if (pix_desc_hw->
alias)
237 if (pix_desc_sw->
alias)
252 char layout_string[64];
261 switch (link->
type) {
264 if (hw_frames_ctx && hw_frames_ctx->
data) {
268 if (pix_desc_hw && pix_desc_sw)
274 if (link->
w && link->
h) {
295 if (link->
w && link->
h) {
308 print_str(
"channel_layout", layout_string);
320 if (hw_frames_ctx && hw_frames_ctx->
data)
327 if ((
c >=
'0' &&
c <=
'9') || (
c >=
'a' &&
c <=
'z') || (
c >=
'A' &&
c <=
'Z'))
346 for (
const char *p = id_str; *p; p++)
369 for (
const char *p = id_str; *p; p++)
400 if (
filter->hw_device_ctx) {
403 if (
filter->extra_hw_frames > 0)
409 for (
unsigned i = 0;
i <
filter->nb_inputs;
i++) {
441 for (
unsigned i = 0;
i <
filter->nb_outputs;
i++) {
452 (void)
snprintf(buf,
sizeof(buf),
"out_%s", dic_entry->
value);
593 for (
int n = nb_ifiles - 1; n >= 0; n--) {
625 if (!ist || !ist->
par)
642 if (codec_desc && codec_desc->
name) {
645 }
else if (ist->
dec) {
672 for (
int n = 0; n < nb_ifiles; n++) {
709 for (
int n = 0; n < nb_ofiles; n++) {
716 if (!
ost || !
ost->st || !
ost->st->codecpar || !
ost->enc)
735 print_fmt(
"name",
"%s",
ost->enc->enc_ctx->av_class->item_name(
ost->enc->enc_ctx));
748 for (
int n = nb_ofiles - 1; n >= 0; n--) {
794 if (codec_desc && codec_desc->
name) {
817 for (
int n = 0; n < nb_ofiles; n++) {
823 if (
ost->ist && !
ost->filter) {
829 print_fmt(
"dest_stream_id",
"out__%d_%d", n,
i);
830 print_fmt(
"source_stream_id",
"in_%d_%d",
ost->ist->file->index,
ost->ist->index);
833 print_fmt(
"dest_stream_id",
"r_out__%d_%d", n,
i);
834 print_fmt(
"source_stream_id",
"r_in_%d_%d",
ost->ist->file->index,
ost->ist->index);
881 if (!text_formatter) {
924 if (!strcmp(text_formatter->
name,
"mermaid") || !strcmp(text_formatter->
name,
"mermaidhtml")) {
927 if (!strcmp(text_formatter->
name,
"mermaidhtml"))
1005 for (
int i = 0;
i < nb_graphs;
i++) {
1008 if (graph_buf->len > 0) {
1016 for (
int n = 0; n < nb_ofiles; n++) {
1022 if (
ost->fg_simple) {
1023 AVBPrint *graph_buf = &
ost->fg_simple->graph_print_buf;
1025 if (graph_buf->len > 0) {
1045 printf(
"%s", target_buf.str);
1053 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,...)
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 **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.
#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 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 void print_hwframescontext(const GraphPrintContext *gpc, const AVHWFramesContext *hw_frames_context)
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)
#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)
#define print_val(k, v, u)
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 int init_graphprint(GraphPrintContext **pgpc, AVBPrint *target_buf)
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,...)
int print_filtergraphs(FilterGraph **graphs, int nb_graphs, InputFile **ifiles, int nb_ifiles, OutputFile **ofiles, int nb_ofiles)
#define print_fmt(k, f,...)
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.
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 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.
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)
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.
const AVTextFormatter * formatter
the AVTextFormatter of which this is an instance
const char * context_type
int flags
a combination or AV_TEXTFORMAT__FLAG_*
struct AVBPrint graph_print_buf
AVTextWriterContext * wctx
AVTextFormatContext * tfc
AVDiagramConfig diagram_config
void(* filter)(uint8_t *src, ptrdiff_t stride, int qscale)
void av_diagram_init(AVTextFormatContext *tfc, AVDiagramConfig *diagram_config)
#define atomic_fetch_add(object, operand)