summaryrefslogtreecommitdiff
path: root/libavfilter/avfilter.h
diff options
context:
space:
mode:
Diffstat (limited to 'libavfilter/avfilter.h')
-rw-r--r--libavfilter/avfilter.h52
1 files changed, 46 insertions, 6 deletions
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index 69ecb0186d..566c1b87ce 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -203,12 +203,18 @@ typedef struct AVFilter {
/**
* The number of entries in the list of inputs.
*/
- uint16_t nb_inputs;
+ uint8_t nb_inputs;
/**
* The number of entries in the list of outputs.
*/
- uint16_t nb_outputs;
+ uint8_t nb_outputs;
+
+ /**
+ * This field determines the state of the formats union.
+ * It is an enum FilterFormatsState value.
+ */
+ uint8_t formats_state;
/**
* Filter pre-initialization function
@@ -274,6 +280,11 @@ typedef struct AVFilter {
void (*uninit)(AVFilterContext *ctx);
/**
+ * The state of the following union is determined by formats_state.
+ * See the documentation of enum FilterFormatsState in internal.h.
+ */
+ union {
+ /**
* Query formats supported by the filter on its inputs and outputs.
*
* This callback is called after the filter is initialized (so the inputs
@@ -288,14 +299,43 @@ typedef struct AVFilter {
* @ref AVFilterLink.incfg.channel_layouts "in_channel_layouts" /
* @ref AVFilterLink.outcfg.channel_layouts "out_channel_layouts" analogously.
*
- * This callback may be NULL for filters with one input, in which case
- * libavfilter assumes that it supports all input formats and preserves
- * them on output.
+ * This callback must never be NULL if the union is in this state.
*
* @return zero on success, a negative value corresponding to an
* AVERROR code otherwise
*/
- int (*query_formats)(AVFilterContext *);
+ int (*query_func)(AVFilterContext *);
+ /**
+ * A pointer to an array of admissible pixel formats delimited
+ * by AV_PIX_FMT_NONE. The generic code will use this list
+ * to indicate that this filter supports each of these pixel formats,
+ * provided that all inputs and outputs use the same pixel format.
+ *
+ * This list must never be NULL if the union is in this state.
+ * The type of all inputs and outputs of filters using this must
+ * be AVMEDIA_TYPE_VIDEO.
+ */
+ const enum AVPixelFormat *pixels_list;
+ /**
+ * Analogous to pixels, but delimited by AV_SAMPLE_FMT_NONE
+ * and restricted to filters that only have AVMEDIA_TYPE_AUDIO
+ * inputs and outputs.
+ *
+ * In addition to that the generic code will mark all inputs
+ * and all outputs as supporting all sample rates and every
+ * channel count and channel layout, as long as all inputs
+ * and outputs use the same sample rate and channel count/layout.
+ */
+ const enum AVSampleFormat *samples_list;
+ /**
+ * Equivalent to { pix_fmt, AV_PIX_FMT_NONE } as pixels_list.
+ */
+ enum AVPixelFormat pix_fmt;
+ /**
+ * Equivalent to { sample_fmt, AV_SAMPLE_FMT_NONE } as samples_list.
+ */
+ enum AVSampleFormat sample_fmt;
+ } formats;
int priv_size; ///< size of private data to allocate for the filter