Skip to content

Commit 7ab7d9c

Browse files
committed
avfilter/avfilter: Add FFFilter, hide internals of AVFilter
This patch is analogous to 20f9727: It hides the internal part of AVFilter by adding a new internal structure FFFilter (declared in filters.h) that has an AVFilter as its first member; the internal part of AVFilter is moved to this new structure. Signed-off-by: Andreas Rheinhardt <[email protected]>
1 parent 9bbab32 commit 7ab7d9c

File tree

462 files changed

+3595
-3611
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

462 files changed

+3595
-3611
lines changed

configure

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4262,7 +4262,7 @@ find_things_extern(){
42624262

42634263
find_filters_extern(){
42644264
file=$source_path/$1
4265-
sed -n 's/^extern const AVFilter ff_[avfsinkrc]\{2,5\}_\([[:alnum:]_]\{1,\}\);/\1_filter/p' $file
4265+
sed -n 's/^extern const FFFilter ff_[avfsinkrc]\{2,5\}_\([[:alnum:]_]\{1,\}\);/\1_filter/p' $file
42664266
}
42674267

42684268
FILTER_LIST=$(find_filters_extern libavfilter/allfilters.c)
@@ -8311,7 +8311,7 @@ cp_if_changed $TMPH libavutil/avconfig.h
83118311
# full_filter_name_foo=vf_foo
83128312
# full_filter_name_bar=asrc_bar
83138313
# ...
8314-
eval "$(sed -n "s/^extern const AVFilter ff_\([avfsinkrc]\{2,5\}\)_\(.*\);/full_filter_name_\2=\1_\2/p" $source_path/libavfilter/allfilters.c)"
8314+
eval "$(sed -n "s/^extern const FFFilter ff_\([avfsinkrc]\{2,5\}\)_\(.*\);/full_filter_name_\2=\1_\2/p" $source_path/libavfilter/allfilters.c)"
83158315

83168316
# generate the lists of enabled components
83178317
print_enabled_components(){
@@ -8345,7 +8345,7 @@ print_enabled_components(){
83458345
cp_if_changed $TMPH $file
83468346
}
83478347

8348-
print_enabled_components libavfilter/filter_list.c AVFilter filter_list $FILTER_LIST
8348+
print_enabled_components libavfilter/filter_list.c FFFilter filter_list $FILTER_LIST
83498349
print_enabled_components libavcodec/codec_list.c FFCodec codec_list $CODEC_LIST
83508350
print_enabled_components libavcodec/parser_list.c AVCodecParser parser_list $PARSER_LIST
83518351
print_enabled_components libavcodec/bsf_list.c FFBitStreamFilter bitstream_filters $BSF_LIST

libavfilter/aeval.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -321,17 +321,16 @@ static const AVFilterPad aevalsrc_outputs[] = {
321321
},
322322
};
323323

324-
const AVFilter ff_asrc_aevalsrc = {
325-
.name = "aevalsrc",
326-
.description = NULL_IF_CONFIG_SMALL("Generate an audio signal generated by an expression."),
324+
const FFFilter ff_asrc_aevalsrc = {
325+
.p.name = "aevalsrc",
326+
.p.description = NULL_IF_CONFIG_SMALL("Generate an audio signal generated by an expression."),
327+
.p.priv_class = &aevalsrc_class,
327328
.init = init,
328329
.uninit = uninit,
329330
.activate = activate,
330331
.priv_size = sizeof(EvalContext),
331-
.inputs = NULL,
332332
FILTER_OUTPUTS(aevalsrc_outputs),
333333
FILTER_QUERY_FUNC2(query_formats),
334-
.priv_class = &aevalsrc_class,
335334
};
336335

337336
#endif /* CONFIG_AEVALSRC_FILTER */
@@ -463,17 +462,17 @@ static const AVFilterPad aeval_outputs[] = {
463462
},
464463
};
465464

466-
const AVFilter ff_af_aeval = {
467-
.name = "aeval",
468-
.description = NULL_IF_CONFIG_SMALL("Filter audio signal according to a specified expression."),
465+
const FFFilter ff_af_aeval = {
466+
.p.name = "aeval",
467+
.p.description = NULL_IF_CONFIG_SMALL("Filter audio signal according to a specified expression."),
468+
.p.priv_class = &aeval_class,
469+
.p.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
469470
.init = init,
470471
.uninit = uninit,
471472
.priv_size = sizeof(EvalContext),
472473
FILTER_INPUTS(aeval_inputs),
473474
FILTER_OUTPUTS(aeval_outputs),
474475
FILTER_QUERY_FUNC2(aeval_query_formats),
475-
.priv_class = &aeval_class,
476-
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
477476
};
478477

479478
#endif /* CONFIG_AEVAL_FILTER */

libavfilter/af_aap.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -315,18 +315,18 @@ static const AVFilterPad outputs[] = {
315315
},
316316
};
317317

318-
const AVFilter ff_af_aap = {
319-
.name = "aap",
320-
.description = NULL_IF_CONFIG_SMALL("Apply Affine Projection algorithm to first audio stream."),
318+
const FFFilter ff_af_aap = {
319+
.p.name = "aap",
320+
.p.description = NULL_IF_CONFIG_SMALL("Apply Affine Projection algorithm to first audio stream."),
321+
.p.priv_class = &aap_class,
322+
.p.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL |
323+
AVFILTER_FLAG_SLICE_THREADS,
321324
.priv_size = sizeof(AudioAPContext),
322-
.priv_class = &aap_class,
323325
.init = init,
324326
.uninit = uninit,
325327
.activate = activate,
326328
FILTER_INPUTS(inputs),
327329
FILTER_OUTPUTS(outputs),
328330
FILTER_QUERY_FUNC2(query_formats),
329-
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL |
330-
AVFILTER_FLAG_SLICE_THREADS,
331331
.process_command = ff_filter_process_command,
332332
};

libavfilter/af_acontrast.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@ static const AVFilterPad inputs[] = {
169169
},
170170
};
171171

172-
const AVFilter ff_af_acontrast = {
173-
.name = "acontrast",
174-
.description = NULL_IF_CONFIG_SMALL("Simple audio dynamic range compression/expansion filter."),
172+
const FFFilter ff_af_acontrast = {
173+
.p.name = "acontrast",
174+
.p.description = NULL_IF_CONFIG_SMALL("Simple audio dynamic range compression/expansion filter."),
175+
.p.priv_class = &acontrast_class,
175176
.priv_size = sizeof(AudioContrastContext),
176-
.priv_class = &acontrast_class,
177177
FILTER_INPUTS(inputs),
178178
FILTER_OUTPUTS(ff_audio_default_filterpad),
179179
FILTER_SAMPLEFMTS(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP,

libavfilter/af_acopy.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ static const AVFilterPad acopy_inputs[] = {
5353
},
5454
};
5555

56-
const AVFilter ff_af_acopy = {
57-
.name = "acopy",
58-
.description = NULL_IF_CONFIG_SMALL("Copy the input audio unchanged to the output."),
59-
.flags = AVFILTER_FLAG_METADATA_ONLY,
56+
const FFFilter ff_af_acopy = {
57+
.p.name = "acopy",
58+
.p.description = NULL_IF_CONFIG_SMALL("Copy the input audio unchanged to the output."),
59+
.p.flags = AVFILTER_FLAG_METADATA_ONLY,
6060
FILTER_INPUTS(acopy_inputs),
6161
FILTER_OUTPUTS(ff_audio_default_filterpad),
6262
};

libavfilter/af_acrossover.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -617,17 +617,17 @@ static const AVFilterPad inputs[] = {
617617
},
618618
};
619619

620-
const AVFilter ff_af_acrossover = {
621-
.name = "acrossover",
622-
.description = NULL_IF_CONFIG_SMALL("Split audio into per-bands streams."),
620+
const FFFilter ff_af_acrossover = {
621+
.p.name = "acrossover",
622+
.p.description = NULL_IF_CONFIG_SMALL("Split audio into per-bands streams."),
623+
.p.priv_class = &acrossover_class,
624+
.p.outputs = NULL,
625+
.p.flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS |
626+
AVFILTER_FLAG_SLICE_THREADS,
623627
.priv_size = sizeof(AudioCrossoverContext),
624-
.priv_class = &acrossover_class,
625628
.init = init,
626629
.activate = activate,
627630
.uninit = uninit,
628631
FILTER_INPUTS(inputs),
629-
.outputs = NULL,
630632
FILTER_QUERY_FUNC2(query_formats),
631-
.flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS |
632-
AVFILTER_FLAG_SLICE_THREADS,
633633
};

libavfilter/af_acrusher.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,15 +326,15 @@ static const AVFilterPad avfilter_af_acrusher_inputs[] = {
326326
},
327327
};
328328

329-
const AVFilter ff_af_acrusher = {
330-
.name = "acrusher",
331-
.description = NULL_IF_CONFIG_SMALL("Reduce audio bit resolution."),
329+
const FFFilter ff_af_acrusher = {
330+
.p.name = "acrusher",
331+
.p.description = NULL_IF_CONFIG_SMALL("Reduce audio bit resolution."),
332+
.p.priv_class = &acrusher_class,
333+
.p.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
332334
.priv_size = sizeof(ACrusherContext),
333-
.priv_class = &acrusher_class,
334335
.uninit = uninit,
335336
FILTER_INPUTS(avfilter_af_acrusher_inputs),
336337
FILTER_OUTPUTS(ff_audio_default_filterpad),
337338
FILTER_SINGLE_SAMPLEFMT(AV_SAMPLE_FMT_DBL),
338339
.process_command = process_command,
339-
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
340340
};

libavfilter/af_adeclick.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -778,18 +778,18 @@ static const AVFilterPad inputs[] = {
778778
},
779779
};
780780

781-
const AVFilter ff_af_adeclick = {
782-
.name = "adeclick",
783-
.description = NULL_IF_CONFIG_SMALL("Remove impulsive noise from input audio."),
781+
const FFFilter ff_af_adeclick = {
782+
.p.name = "adeclick",
783+
.p.description = NULL_IF_CONFIG_SMALL("Remove impulsive noise from input audio."),
784+
.p.priv_class = &adeclick_class,
785+
.p.flags = AVFILTER_FLAG_SLICE_THREADS | AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
784786
.priv_size = sizeof(AudioDeclickContext),
785-
.priv_class = &adeclick_class,
786787
.init = init,
787788
.activate = activate,
788789
.uninit = uninit,
789790
FILTER_INPUTS(inputs),
790791
FILTER_OUTPUTS(ff_audio_default_filterpad),
791792
FILTER_SINGLE_SAMPLEFMT(AV_SAMPLE_FMT_DBLP),
792-
.flags = AVFILTER_FLAG_SLICE_THREADS | AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
793793
};
794794

795795
static const AVOption adeclip_options[] = {
@@ -814,16 +814,16 @@ static const AVOption adeclip_options[] = {
814814

815815
AVFILTER_DEFINE_CLASS(adeclip);
816816

817-
const AVFilter ff_af_adeclip = {
818-
.name = "adeclip",
819-
.description = NULL_IF_CONFIG_SMALL("Remove clipping from input audio."),
817+
const FFFilter ff_af_adeclip = {
818+
.p.name = "adeclip",
819+
.p.description = NULL_IF_CONFIG_SMALL("Remove clipping from input audio."),
820+
.p.priv_class = &adeclip_class,
821+
.p.flags = AVFILTER_FLAG_SLICE_THREADS | AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
820822
.priv_size = sizeof(AudioDeclickContext),
821-
.priv_class = &adeclip_class,
822823
.init = init,
823824
.activate = activate,
824825
.uninit = uninit,
825826
FILTER_INPUTS(inputs),
826827
FILTER_OUTPUTS(ff_audio_default_filterpad),
827828
FILTER_SINGLE_SAMPLEFMT(AV_SAMPLE_FMT_DBLP),
828-
.flags = AVFILTER_FLAG_SLICE_THREADS | AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
829829
};

libavfilter/af_adecorrelate.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -231,15 +231,15 @@ static const AVFilterPad inputs[] = {
231231
},
232232
};
233233

234-
const AVFilter ff_af_adecorrelate = {
235-
.name = "adecorrelate",
236-
.description = NULL_IF_CONFIG_SMALL("Apply decorrelation to input audio."),
234+
const FFFilter ff_af_adecorrelate = {
235+
.p.name = "adecorrelate",
236+
.p.description = NULL_IF_CONFIG_SMALL("Apply decorrelation to input audio."),
237+
.p.priv_class = &adecorrelate_class,
238+
.p.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC |
239+
AVFILTER_FLAG_SLICE_THREADS,
237240
.priv_size = sizeof(ADecorrelateContext),
238-
.priv_class = &adecorrelate_class,
239241
.uninit = uninit,
240242
FILTER_INPUTS(inputs),
241243
FILTER_OUTPUTS(ff_audio_default_filterpad),
242244
FILTER_SINGLE_SAMPLEFMT(AV_SAMPLE_FMT_DBLP),
243-
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC |
244-
AVFILTER_FLAG_SLICE_THREADS,
245245
};

libavfilter/af_adelay.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -465,17 +465,17 @@ static const AVFilterPad adelay_inputs[] = {
465465
},
466466
};
467467

468-
const AVFilter ff_af_adelay = {
469-
.name = "adelay",
470-
.description = NULL_IF_CONFIG_SMALL("Delay one or more audio channels."),
468+
const FFFilter ff_af_adelay = {
469+
.p.name = "adelay",
470+
.p.description = NULL_IF_CONFIG_SMALL("Delay one or more audio channels."),
471+
.p.priv_class = &adelay_class,
472+
.p.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
471473
.priv_size = sizeof(AudioDelayContext),
472-
.priv_class = &adelay_class,
473474
.activate = activate,
474475
.uninit = uninit,
475476
FILTER_INPUTS(adelay_inputs),
476477
FILTER_OUTPUTS(ff_audio_default_filterpad),
477478
FILTER_SAMPLEFMTS(AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P,
478479
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP),
479-
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
480480
.process_command = process_command,
481481
};

0 commit comments

Comments
 (0)