FFmpeg
|
A list of supported formats for one end of a filter link. More...
#include <formats.h>
Data Fields | |
unsigned | nb_formats |
number of formats | |
int * | formats |
list of media formats | |
unsigned | refcount |
number of references to this list | |
struct AVFilterFormats *** | refs |
references to this list | |
A list of supported formats for one end of a filter link.
This is used during the format negotiation process to try to pick the best format to use to minimize the number of necessary conversions. Each filter gives a list of the formats supported by each input and output pad. The list given for each pad need not be distinct - they may be references to the same list of formats, as is often the case when a filter supports multiple formats, but will always output the same format as it is given in input.
In this way, a list of possible input formats and a list of possible output formats are associated with each link. When a set of formats is negotiated over a link, the input and output lists are merged to form a new list containing only the common elements of each list. In the case that there were no common elements, a format conversion is necessary. Otherwise, the lists are merged, and all other links which reference either of the format lists involved in the merge are also affected.
For example, consider the filter chain: filter (a) –> (b) filter (b) –> (c) filter
where the letters in parenthesis indicate a list of formats supported on the input or output of the link. Suppose the lists are as follows: (a) = {A, B} (b) = {A, B, C} (c) = {B, C}
First, the first link's lists are merged, yielding: filter (a) –> (a) filter (a) –> (c) filter
Notice that format list (b) now refers to the same list as filter list (a). Next, the lists for the second link are merged, yielding: filter (a) –> (a) filter (a) –> (a) filter
where (a) = {B}.
Unfortunately, when the format lists at the two ends of a link are merged, we must ensure that all links which reference either pre-merge format list get updated as well. Therefore, we have the format list structure store a pointer to each of the pointers to itself.
unsigned AVFilterFormats::nb_formats |
number of formats
Definition at line 65 of file formats.h.
Referenced by clone_filter_formats(), ff_merge_formats(), ff_merge_samplerates(), pick_format(), pick_formats(), query_formats(), swap_sample_fmts_on_filter(), and swap_samplerates_on_filter().
int* AVFilterFormats::formats |
list of media formats
Definition at line 66 of file formats.h.
Referenced by can_merge_formats(), clone_filter_formats(), ff_merge_formats(), ff_merge_samplerates(), pick_format(), query_formats(), swap_sample_fmts_on_filter(), and swap_samplerates_on_filter().
unsigned AVFilterFormats::refcount |
number of references to this list
Definition at line 68 of file formats.h.
Referenced by clone_filter_formats(), and query_formats().
struct AVFilterFormats*** AVFilterFormats::refs |
references to this list
Definition at line 69 of file formats.h.
Referenced by can_merge_formats(), clone_filter_formats(), ff_merge_formats(), and ff_merge_samplerates().