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
68typedef struct AVFilterLink AVFilterLink;68typedef struct AVFilterLink AVFilterLink;
69typedef struct AVFilterPad AVFilterPad;69typedef struct AVFilterPad AVFilterPad;
70typedef struct AVFilterFormats AVFilterFormats;70typedef struct AVFilterFormats AVFilterFormats;
71typedef struct AVFilterChannelLayouts AVFilterChannelLayouts;
71 72
72/**73/**
73 * Get the number of elements in a NULL-terminated array of AVFilterPads (e.g.74 * Get the number of elements in a NULL-terminated array of AVFilterPads (e.g.
@@ -264,13 +265,13 @@ typedef struct AVFilter { · 190 unmodified lines
264 * and outputs are fixed), shortly before the format negotiation. This265 * and outputs are fixed), shortly before the format negotiation. This
265 * callback may be called more than once.266 * callback may be called more than once.
266 *267 *
267 * This callback must set AVFilterLink.out_formats on every input link and268 * This callback must set AVFilterLink.outcfg.formats on every input link and
268 * AVFilterLink.in_formats on every output link to a list of pixel/sample269 * AVFilterLink.incfg.formats on every output link to a list of pixel/sample
269 * formats that the filter supports on that link. For audio links, this270 * formats that the filter supports on that link. For audio links, this
270 * filter must also set @ref AVFilterLink.in_samplerates "in_samplerates" /271 * filter must also set @ref AVFilterLink.incfg.samplerates "in_samplerates" /
271 * @ref AVFilterLink.out_samplerates "out_samplerates" and272 * @ref AVFilterLink.outcfg.samplerates "out_samplerates" and
272 * @ref AVFilterLink.in_channel_layouts "in_channel_layouts" /273 * @ref AVFilterLink.incfg.channel_layouts "in_channel_layouts" /
273 * @ref AVFilterLink.out_channel_layouts "out_channel_layouts" analogously.274 * @ref AVFilterLink.outcfg.channel_layouts "out_channel_layouts" analogously.
274 *275 *
275 * This callback may be NULL for filters with one input, in which case276 * This callback may be NULL for filters with one input, in which case
276 * libavfilter assumes that it supports all input formats and preserves277 * libavfilter assumes that it supports all input formats and preserves
@@ -424,6 +425,35 @@ struct AVFilterContext { · 147 unmodified lines
424 int extra_hw_frames;425 int extra_hw_frames;
425};426};
426 427
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 */
438typedef 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
427/**457/**
428 * A link between two filters. This contains pointers to the source and458 * A link between two filters. This contains pointers to the source and
429 * destination filters between which this link exists, and the indexes of459 * destination filters between which this link exists, and the indexes of
@@ -471,24 +501,16 @@ struct AVFilterLink { · 41 unmodified lines
471 * New public fields should be added right above.501 * New public fields should be added right above.
472 *****************************************************************502 *****************************************************************
473 */503 */
504
474 /**505 /**
475 * Lists of formats and channel layouts supported by the input and output506 * Lists of supported formats / etc. supported by the input filter.
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 *
480 */507 */
481 AVFilterFormats *in_formats;508 AVFilterFormatsConfig incfg;
482 AVFilterFormats *out_formats;
483 509
484 /**510 /**
485 * Lists of channel layouts and sample rates used for automatic511 * Lists of supported formats / etc. supported by the output filter.
486 * negotiation.
487 */512 */
488 AVFilterFormats *in_samplerates;513 AVFilterFormatsConfig outcfg;
489 AVFilterFormats *out_samplerates;
490 struct AVFilterChannelLayouts *in_channel_layouts;
491 struct AVFilterChannelLayouts *out_channel_layouts;
492 514
493 /** stage of the initialization of the link properties (dimensions, etc) */515 /** stage of the initialization of the link properties (dimensions, etc) */
494 enum {516 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