Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwm4 <nfxjfg@googlemail.com>2016-02-27 01:37:33 +0300
committerwm4 <nfxjfg@googlemail.com>2016-02-27 23:35:20 +0300
commit5d2c5e8bffed936f7d4f17e03628572bf25886a7 (patch)
treed0b907b0729409d6759b47af98f1d9a3cd5faf28 /libavfilter/vf_copy.c
parente266d29978cdb04c04027ded24a62b405303c120 (diff)
vf_copy: exclude hwaccel formats
This does obviously not work. (Additions based on vf_crop.c.)
Diffstat (limited to 'libavfilter/vf_copy.c')
-rw-r--r--libavfilter/vf_copy.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libavfilter/vf_copy.c b/libavfilter/vf_copy.c
index fb9a906048..b0159cff00 100644
--- a/libavfilter/vf_copy.c
+++ b/libavfilter/vf_copy.c
@@ -27,6 +27,23 @@
#include "internal.h"
#include "video.h"
+static int query_formats(AVFilterContext *ctx)
+{
+ AVFilterFormats *formats = NULL;
+ int fmt;
+
+ for (fmt = 0; av_pix_fmt_desc_get(fmt); fmt++) {
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(fmt);
+ int ret;
+ if (desc->flags & AV_PIX_FMT_FLAG_HWACCEL)
+ continue;
+ if ((ret = ff_add_format(&formats, fmt)) < 0)
+ return ret;
+ }
+
+ return ff_set_common_formats(ctx, formats);
+}
+
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
{
AVFilterLink *outlink = inlink->dst->outputs[0];
@@ -64,4 +81,5 @@ AVFilter ff_vf_copy = {
.description = NULL_IF_CONFIG_SMALL("Copy the input video unchanged to the output."),
.inputs = avfilter_vf_copy_inputs,
.outputs = avfilter_vf_copy_outputs,
+ .query_formats = query_formats,
};