History

lavfi: regroup formats lists in a single structure.

It will allow to refernce it as a whole without clunky macros. Most of the changes have been automatically made with sed: sed -i ' s/-> *in_formats/->incfg.formats/g; s/-> *out_formats/->outcfg.formats/g; s/-> *in_channel_layouts/->incfg.channel_layouts/g; s/-> *out_channel_layouts/->outcfg.channel_layouts/g; s/-> *in_samplerates/->incfg.samplerates/g; s/-> *out_samplerates/->outcfg.samplerates/g; ' src/libavfilter/*(.)

Nicolas George committed 6 years ago

Commit 2f764761 parent 6a2df7c70 files · +386 −364Browse files

Showing the changes to libavfilter/avfilter.h (1 of 70 files). Show all

Unified · Split

libavfilter/avfilter.h+41−19
@@ -68,6 +68,7 @@ typedef struct AVFilterContext AVFilterContext; · 67 unmodified lines
6868 typedef struct AVFilterLink AVFilterLink;
6969 typedef struct AVFilterPad AVFilterPad;
7070 typedef struct AVFilterFormats AVFilterFormats;
71+typedef struct AVFilterChannelLayouts AVFilterChannelLayouts;
7172
7273 /**
7374 * Get the number of elements in a NULL-terminated array of AVFilterPads (e.g.
@@ -264,13 +265,13 @@ typedef struct AVFilter { · 190 unmodified lines
264265 * and outputs are fixed), shortly before the format negotiation. This
265266 * callback may be called more than once.
266267 *
267− * This callback must set AVFilterLink.out_formats on every input link and
268− * AVFilterLink.in_formats on every output link to a list of pixel/sample
268+ * This callback must set AVFilterLink.outcfg.formats on every input link and
269+ * AVFilterLink.incfg.formats on every output link to a list of pixel/sample
269270 * formats that the filter supports on that link. For audio links, this
270− * filter must also set @ref AVFilterLink.in_samplerates "in_samplerates" /
271− * @ref AVFilterLink.out_samplerates "out_samplerates" and
272− * @ref AVFilterLink.in_channel_layouts "in_channel_layouts" /
273− * @ref AVFilterLink.out_channel_layouts "out_channel_layouts" analogously.
271+ * filter must also set @ref AVFilterLink.incfg.samplerates "in_samplerates" /
272+ * @ref AVFilterLink.outcfg.samplerates "out_samplerates" and
273+ * @ref AVFilterLink.incfg.channel_layouts "in_channel_layouts" /
274+ * @ref AVFilterLink.outcfg.channel_layouts "out_channel_layouts" analogously.
274275 *
275276 * This callback may be NULL for filters with one input, in which case
276277 * libavfilter assumes that it supports all input formats and preserves
@@ -424,6 +425,35 @@ struct AVFilterContext { · 147 unmodified lines
424425 int extra_hw_frames;
425426 };
426427
428+/**
429+ * Lists of formats / etc. supported by an end of a link.
430+ *
431+ * This structure is directly part of AVFilterLink, in two copies:
432+ * one for the source filter, one for the destination filter.
433+
434+ * These lists are used for negotiating the format to actually be used,
435+ * which will be loaded into the format and channel_layout members of
436+ * AVFilterLink, when chosen.
437+ */
438+typedef struct AVFilterFormatsConfig {
439+
440+ /**
441+ * List of supported formats (pixel or sample).
442+ */
443+ AVFilterFormats *formats;
444+
445+ /**
446+ * Lists of supported sample rates, only for audio.
447+ */
448+ AVFilterFormats *samplerates;
449+
450+ /**
451+ * Lists of supported channel layouts, only for audio.
452+ */
453+ AVFilterChannelLayouts *channel_layouts;
454+
455+} AVFilterFormatsConfig;
456+
427457 /**
428458 * A link between two filters. This contains pointers to the source and
429459 * destination filters between which this link exists, and the indexes of
@@ -471,24 +501,16 @@ struct AVFilterLink { · 41 unmodified lines
471501 * New public fields should be added right above.
472502 *****************************************************************
473503 */
504+
474505 /**
475− * Lists of formats and channel layouts supported by the input and output
476− * filters respectively. These lists are used for negotiating the format
477− * to actually be used, which will be loaded into the format and
478− * channel_layout members, above, when chosen.
479− *
506+ * Lists of supported formats / etc. supported by the input filter.
480507 */
481− AVFilterFormats *in_formats;
482− AVFilterFormats *out_formats;
508+ AVFilterFormatsConfig incfg;
483509
484510 /**
485− * Lists of channel layouts and sample rates used for automatic
486− * negotiation.
511+ * Lists of supported formats / etc. supported by the output filter.
487512 */
488− AVFilterFormats *in_samplerates;
489− AVFilterFormats *out_samplerates;
490− struct AVFilterChannelLayouts *in_channel_layouts;
491− struct AVFilterChannelLayouts *out_channel_layouts;
513+ AVFilterFormatsConfig outcfg;
492514
493515 /** stage of the initialization of the link properties (dimensions, etc) */
494516 enum {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t