aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-04-12 14:49:25 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-04-12 14:49:30 +0200
commitf4db6bfeb86feda2aeb98072e55b55de85ba0962 (patch)
treec18b40f04e4fc7d57650d175e521b15669297805
parent16fc24b240cafc37cd1ea402e9ab2b4cd5ba6269 (diff)
parent7e8fe4be5fb4c98aa3c6a4ed3cec999f4e3cc3aa (diff)
downloadffmpeg-f4db6bfeb86feda2aeb98072e55b55de85ba0962.tar.gz
Merge commit '7e8fe4be5fb4c98aa3c6a4ed3cec999f4e3cc3aa'
* commit '7e8fe4be5fb4c98aa3c6a4ed3cec999f4e3cc3aa': lavfi: add a function for counting elements in AVFilterPad arrays. Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--doc/APIchanges1
-rw-r--r--libavfilter/avfilter.c6
-rw-r--r--libavfilter/avfilter.h6
3 files changed, 10 insertions, 3 deletions
diff --git a/doc/APIchanges b/doc/APIchanges
index 8837b0db7e..3a435afe71 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -170,6 +170,7 @@ API changes, most recent first:
Add avfilter_init_str(), deprecate avfilter_init_filter().
Add avfilter_init_dict().
Add AVFilter.flags field and AVFILTER_FLAG_DYNAMIC_{INPUTS,OUTPUTS} flags.
+ Add avfilter_pad_count() for counting filter inputs/outputs.
2013-xx-xx - lavfi 3.7.0 - avfilter.h
Add AVFilter.priv_class for exporting filter options through the AVOptions API
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index d912a42a55..e03b6f2f61 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -436,7 +436,7 @@ void avfilter_uninit(void)
next_registered_avfilter_idx = 0;
}
-static int pad_count(const AVFilterPad *pads)
+int avfilter_pad_count(const AVFilterPad *pads)
{
int count;
@@ -515,7 +515,7 @@ AVFilterContext *ff_filter_alloc(const AVFilter *filter, const char *inst_name)
av_opt_set_defaults(ret->priv);
}
- ret->nb_inputs = pad_count(filter->inputs);
+ ret->nb_inputs = avfilter_pad_count(filter->inputs);
if (ret->nb_inputs ) {
ret->input_pads = av_malloc(sizeof(AVFilterPad) * ret->nb_inputs);
if (!ret->input_pads)
@@ -526,7 +526,7 @@ AVFilterContext *ff_filter_alloc(const AVFilter *filter, const char *inst_name)
goto err;
}
- ret->nb_outputs = pad_count(filter->outputs);
+ ret->nb_outputs = avfilter_pad_count(filter->outputs);
if (ret->nb_outputs) {
ret->output_pads = av_malloc(sizeof(AVFilterPad) * ret->nb_outputs);
if (!ret->output_pads)
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index 8dad5dc041..4bc97554fe 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -389,6 +389,12 @@ struct AVFilterPad {
#endif
/**
+ * Get the number of elements in a NULL-terminated array of AVFilterPads (e.g.
+ * AVFilter.inputs/outputs).
+ */
+int avfilter_pad_count(const AVFilterPad *pads);
+
+/**
* Get the name of an AVFilterPad.
*
* @param pads an array of AVFilterPads