summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/avfiltergraph.c40
-rw-r--r--libavfilter/avfiltergraph.h11
-rw-r--r--libavfilter/graphdump.c2
-rw-r--r--libavfilter/graphparser.c12
-rw-r--r--libavfilter/version.h2
5 files changed, 38 insertions, 29 deletions
diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index 2764b8c85a..9b05c6d6d1 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -62,8 +62,8 @@ void avfilter_graph_free(AVFilterGraph **graph)
{
if (!*graph)
return;
- for (; (*graph)->filter_count > 0; (*graph)->filter_count--)
- avfilter_free((*graph)->filters[(*graph)->filter_count - 1]);
+ for (; (*graph)->nb_filters > 0; (*graph)->nb_filters--)
+ avfilter_free((*graph)->filters[(*graph)->nb_filters - 1]);
av_freep(&(*graph)->sink_links);
av_freep(&(*graph)->scale_sws_opts);
av_freep(&(*graph)->aresample_swr_opts);
@@ -75,12 +75,12 @@ void avfilter_graph_free(AVFilterGraph **graph)
int avfilter_graph_add_filter(AVFilterGraph *graph, AVFilterContext *filter)
{
AVFilterContext **filters = av_realloc(graph->filters,
- sizeof(AVFilterContext*) * (graph->filter_count+1));
+ sizeof(AVFilterContext*) * (graph->nb_filters + 1));
if (!filters)
return AVERROR(ENOMEM);
graph->filters = filters;
- graph->filters[graph->filter_count++] = filter;
+ graph->filters[graph->nb_filters++] = filter;
return 0;
}
@@ -124,7 +124,7 @@ static int graph_check_validity(AVFilterGraph *graph, AVClass *log_ctx)
AVFilterContext *filt;
int i, j;
- for (i = 0; i < graph->filter_count; i++) {
+ for (i = 0; i < graph->nb_filters; i++) {
const AVFilterPad *pad;
filt = graph->filters[i];
@@ -162,7 +162,7 @@ static int graph_config_links(AVFilterGraph *graph, AVClass *log_ctx)
AVFilterContext *filt;
int i, ret;
- for (i=0; i < graph->filter_count; i++) {
+ for (i = 0; i < graph->nb_filters; i++) {
filt = graph->filters[i];
if (!filt->nb_outputs) {
@@ -178,7 +178,7 @@ AVFilterContext *avfilter_graph_get_filter(AVFilterGraph *graph, char *name)
{
int i;
- for (i = 0; i < graph->filter_count; i++)
+ for (i = 0; i < graph->nb_filters; i++)
if (graph->filters[i]->name && !strcmp(name, graph->filters[i]->name))
return graph->filters[i];
@@ -245,7 +245,7 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
for (j = 0; j < 2; j++) {
/* ask all the sub-filters for their supported media formats */
- for (i = 0; i < graph->filter_count; i++) {
+ for (i = 0; i < graph->nb_filters; i++) {
/* Call query_formats on sources first.
This is a temporary workaround for amerge,
until format renegociation is implemented. */
@@ -261,7 +261,7 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
}
/* go through and merge as many format lists as possible */
- for (i = 0; i < graph->filter_count; i++) {
+ for (i = 0; i < graph->nb_filters; i++) {
AVFilterContext *filter = graph->filters[i];
for (j = 0; j < filter->nb_inputs; j++) {
@@ -519,7 +519,7 @@ static void reduce_formats(AVFilterGraph *graph)
do {
reduced = 0;
- for (i = 0; i < graph->filter_count; i++)
+ for (i = 0; i < graph->nb_filters; i++)
reduced |= reduce_formats_on_filter(graph->filters[i]);
} while (reduced);
}
@@ -567,7 +567,7 @@ static void swap_samplerates(AVFilterGraph *graph)
{
int i;
- for (i = 0; i < graph->filter_count; i++)
+ for (i = 0; i < graph->nb_filters; i++)
swap_samplerates_on_filter(graph->filters[i]);
}
@@ -698,7 +698,7 @@ static void swap_channel_layouts(AVFilterGraph *graph)
{
int i;
- for (i = 0; i < graph->filter_count; i++)
+ for (i = 0; i < graph->nb_filters; i++)
swap_channel_layouts_on_filter(graph->filters[i]);
}
@@ -766,7 +766,7 @@ static void swap_sample_fmts(AVFilterGraph *graph)
{
int i;
- for (i = 0; i < graph->filter_count; i++)
+ for (i = 0; i < graph->nb_filters; i++)
swap_sample_fmts_on_filter(graph->filters[i]);
}
@@ -778,7 +778,7 @@ static int pick_formats(AVFilterGraph *graph)
do{
change = 0;
- for (i = 0; i < graph->filter_count; i++) {
+ for (i = 0; i < graph->nb_filters; i++) {
AVFilterContext *filter = graph->filters[i];
if (filter->nb_inputs){
for (j = 0; j < filter->nb_inputs; j++){
@@ -810,7 +810,7 @@ static int pick_formats(AVFilterGraph *graph)
}
}while(change);
- for (i = 0; i < graph->filter_count; i++) {
+ for (i = 0; i < graph->nb_filters; i++) {
AVFilterContext *filter = graph->filters[i];
for (j = 0; j < filter->nb_inputs; j++)
@@ -859,7 +859,7 @@ static int ff_avfilter_graph_config_pointers(AVFilterGraph *graph,
AVFilterContext *f;
AVFilterLink **sinks;
- for (i = 0; i < graph->filter_count; i++) {
+ for (i = 0; i < graph->nb_filters; i++) {
f = graph->filters[i];
for (j = 0; j < f->nb_inputs; j++) {
f->inputs[j]->graph = graph;
@@ -878,7 +878,7 @@ static int ff_avfilter_graph_config_pointers(AVFilterGraph *graph,
sinks = av_calloc(sink_links_count, sizeof(*sinks));
if (!sinks)
return AVERROR(ENOMEM);
- for (i = 0; i < graph->filter_count; i++) {
+ for (i = 0; i < graph->nb_filters; i++) {
f = graph->filters[i];
if (!f->nb_outputs) {
for (j = 0; j < f->nb_inputs; j++) {
@@ -899,7 +899,7 @@ static int graph_insert_fifos(AVFilterGraph *graph, AVClass *log_ctx)
int i, j, ret;
int fifo_count = 0;
- for (i = 0; i < graph->filter_count; i++) {
+ for (i = 0; i < graph->nb_filters; i++) {
f = graph->filters[i];
for (j = 0; j < f->nb_inputs; j++) {
@@ -965,7 +965,7 @@ int avfilter_graph_send_command(AVFilterGraph *graph, const char *target, const
if(res_len && res)
res[0]= 0;
- for (i = 0; i < graph->filter_count; i++) {
+ for (i = 0; i < graph->nb_filters; i++) {
AVFilterContext *filter = graph->filters[i];
if(!strcmp(target, "all") || (filter->name && !strcmp(target, filter->name)) || !strcmp(target, filter->filter->name)){
r = avfilter_process_command(filter, cmd, arg, res, res_len, flags);
@@ -986,7 +986,7 @@ int avfilter_graph_queue_command(AVFilterGraph *graph, const char *target, const
if(!graph)
return 0;
- for (i = 0; i < graph->filter_count; i++) {
+ for (i = 0; i < graph->nb_filters; i++) {
AVFilterContext *filter = graph->filters[i];
if(filter && (!strcmp(target, "all") || !strcmp(target, filter->name) || !strcmp(target, filter->filter->name))){
AVFilterCommand **queue = &filter->command_queue, *next;
diff --git a/libavfilter/avfiltergraph.h b/libavfilter/avfiltergraph.h
index 3965412803..61110f99a1 100644
--- a/libavfilter/avfiltergraph.h
+++ b/libavfilter/avfiltergraph.h
@@ -27,11 +27,20 @@
typedef struct AVFilterGraph {
const AVClass *av_class;
- unsigned filter_count;
+#if FF_API_FOO_COUNT
+ attribute_deprecated
+ unsigned filter_count_unused;
+#endif
AVFilterContext **filters;
+#if !FF_API_FOO_COUNT
+ unsigned nb_filters;
+#endif
char *scale_sws_opts; ///< sws options to use for the auto-inserted scale filters
char *resample_lavr_opts; ///< libavresample options to use for the auto-inserted resample filters
+#if FF_API_FOO_COUNT
+ unsigned nb_filters;
+#endif
char *aresample_swr_opts; ///< swr options to use for the auto-inserted aresample filters, Access ONLY through AVOptions
/**
diff --git a/libavfilter/graphdump.c b/libavfilter/graphdump.c
index 28e9bc9789..756f63dc49 100644
--- a/libavfilter/graphdump.c
+++ b/libavfilter/graphdump.c
@@ -62,7 +62,7 @@ static void avfilter_graph_dump_to_buf(AVBPrint *buf, AVFilterGraph *graph)
{
unsigned i, j, x, e;
- for (i = 0; i < graph->filter_count; i++) {
+ for (i = 0; i < graph->nb_filters; i++) {
AVFilterContext *filter = graph->filters[i];
unsigned max_src_name = 0, max_dst_name = 0;
unsigned max_in_name = 0, max_out_name = 0;
diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c
index 3e85261c38..8d2fffc194 100644
--- a/libavfilter/graphparser.c
+++ b/libavfilter/graphparser.c
@@ -436,8 +436,8 @@ int avfilter_graph_parse2(AVFilterGraph *graph, const char *filters,
return 0;
fail:end:
- for (; graph->filter_count > 0; graph->filter_count--)
- avfilter_free(graph->filters[graph->filter_count - 1]);
+ for (; graph->nb_filters > 0; graph->nb_filters--)
+ avfilter_free(graph->filters[graph->nb_filters - 1]);
av_freep(&graph->filters);
avfilter_inout_free(&open_inputs);
avfilter_inout_free(&open_outputs);
@@ -504,8 +504,8 @@ int avfilter_graph_parse(AVFilterGraph *graph, const char *filters,
fail:
if (ret < 0) {
- for (; graph->filter_count > 0; graph->filter_count--)
- avfilter_free(graph->filters[graph->filter_count - 1]);
+ for (; graph->nb_filters > 0; graph->nb_filters--)
+ avfilter_free(graph->filters[graph->nb_filters - 1]);
av_freep(&graph->filters);
}
avfilter_inout_free(&inputs);
@@ -591,8 +591,8 @@ end:
avfilter_inout_free(&curr_inputs);
if (ret < 0) {
- for (; graph->filter_count > 0; graph->filter_count--)
- avfilter_free(graph->filters[graph->filter_count - 1]);
+ for (; graph->nb_filters > 0; graph->nb_filters--)
+ avfilter_free(graph->filters[graph->nb_filters - 1]);
av_freep(&graph->filters);
}
return ret;
diff --git a/libavfilter/version.h b/libavfilter/version.h
index 3a2fff3bf8..3ec6f2db46 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -29,7 +29,7 @@
#include "libavutil/avutil.h"
#define LIBAVFILTER_VERSION_MAJOR 3
-#define LIBAVFILTER_VERSION_MINOR 46
+#define LIBAVFILTER_VERSION_MINOR 47
#define LIBAVFILTER_VERSION_MICRO 100
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \