summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2023-05-14 00:10:57 +0200
committerPaul B Mahol <onemda@gmail.com>2023-05-14 00:13:59 +0200
commit28a73506df9c6bcfc6f1ba5b750709f15e4c5ea0 (patch)
treed9689d7b2bc6f38b9c95c0f6b67f291aa9d53eff /libavfilter
parentfb8efa97935ebe111b644696bccad64bef7437d7 (diff)
downloadffmpeg-28a73506df9c6bcfc6f1ba5b750709f15e4c5ea0.tar.gz
avfilter/vf_waveform: add input option
For finer control of selected formats for filtering.
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_waveform.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavfilter/vf_waveform.c b/libavfilter/vf_waveform.c
index 8872c43aeb..a6a8ec78e7 100644
--- a/libavfilter/vf_waveform.c
+++ b/libavfilter/vf_waveform.c
@@ -120,6 +120,7 @@ typedef struct WaveformContext {
float ftint[2];
int tint[2];
int fitmode;
+ int input;
int (*waveform_slice)(AVFilterContext *ctx, void *arg,
int jobnr, int nb_jobs);
@@ -196,6 +197,9 @@ static const AVOption waveform_options[] = {
{ "fm", "set fit mode", OFFSET(fitmode), AV_OPT_TYPE_INT, {.i64=0}, 0, NB_FITMODES-1, FLAGS, "fitmode" },
{ "none", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FM_NONE}, 0, 0, FLAGS, "fitmode" },
{ "size", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FM_SIZE}, 0, 0, FLAGS, "fitmode" },
+ { "input", "set input formats selection", OFFSET(input), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS, "input" },
+ { "all", "try to select from all available formats", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "input" },
+ { "first", "pick first available format", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "input" },
{ NULL }
};
@@ -356,7 +360,7 @@ static int query_formats(AVFilterContext *ctx)
depth2 = desc2->comp[0].depth;
if (ncomp != ncomp2 || depth != depth2)
return AVERROR(EAGAIN);
- for (i = 1; i < avff->nb_formats; i++) {
+ for (i = 1; i < avff->nb_formats && !s->input; i++) {
desc = av_pix_fmt_desc_get(avff->formats[i]);
if (rgb != (desc->flags & AV_PIX_FMT_FLAG_RGB) ||
depth != desc->comp[0].depth)