summaryrefslogtreecommitdiff
path: root/libavfilter/vf_weave.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2019-11-19 12:35:55 +0100
committerPaul B Mahol <onemda@gmail.com>2019-11-19 12:35:55 +0100
commit18d25ecede6a5c3e57bf08489ab3f696250a665a (patch)
tree74b8ff426dd203c4f9796a88515348e257c9f7b5 /libavfilter/vf_weave.c
parent5ed6b735ab8ba989b3c60884afee889b6c55aede (diff)
downloadffmpeg-18d25ecede6a5c3e57bf08489ab3f696250a665a.tar.gz
avfilter/vf_weave: pal and hwaccel formats are not supported
Diffstat (limited to 'libavfilter/vf_weave.c')
-rw-r--r--libavfilter/vf_weave.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/libavfilter/vf_weave.c b/libavfilter/vf_weave.c
index 663d79f511..8951b09095 100644
--- a/libavfilter/vf_weave.c
+++ b/libavfilter/vf_weave.c
@@ -49,6 +49,26 @@ static const AVOption weave_options[] = {
AVFILTER_DEFINE_CLASS(weave);
+static int query_formats(AVFilterContext *ctx)
+{
+ AVFilterFormats *formats = NULL;
+ int ret;
+
+ for (int fmt = 0; av_pix_fmt_desc_get(fmt); fmt++) {
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(fmt);
+
+ if (!(desc->flags & AV_PIX_FMT_FLAG_PAL) &&
+ !(desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) {
+ if ((ret = ff_add_format(&formats, fmt)) < 0) {
+ ff_formats_unref(&formats);
+ return ret;
+ }
+ }
+ }
+
+ return ff_set_common_formats(ctx, formats);
+}
+
static int config_props_output(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
@@ -156,6 +176,7 @@ AVFilter ff_vf_weave = {
.description = NULL_IF_CONFIG_SMALL("Weave input video fields into frames."),
.priv_size = sizeof(WeaveContext),
.priv_class = &weave_class,
+ .query_formats = query_formats,
.uninit = uninit,
.inputs = weave_inputs,
.outputs = weave_outputs,
@@ -179,6 +200,7 @@ AVFilter ff_vf_doubleweave = {
.description = NULL_IF_CONFIG_SMALL("Weave input video fields into double number of frames."),
.priv_size = sizeof(WeaveContext),
.priv_class = &doubleweave_class,
+ .query_formats = query_formats,
.init = init,
.uninit = uninit,
.inputs = weave_inputs,