summaryrefslogtreecommitdiffstats
path: root/video/filter/vf.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-11-29 18:04:26 +0100
committerwm4 <wm4@nowhere>2017-11-29 18:04:56 +0100
commitd752f743fffa2440361f7b7ebb0930c173286644 (patch)
treec677d4e6f1519c4fb10fe215bf4bd6e98f147de8 /video/filter/vf.c
parent4dff0a809426368187c68bf8a58fb5ade350a363 (diff)
downloadmpv-d752f743fffa2440361f7b7ebb0930c173286644.tar.bz2
mpv-d752f743fffa2440361f7b7ebb0930c173286644.tar.xz
vf: add vf_convert as interim replacement for vf_scale
We want to drop vf_scale, but we still need a way to auto convert between imgfmts. In particular, vf.c will auto insert the "scale" filter if the VO doesn't support a pixfmt. To avoid chaos, create a new vf_convert.c filter, based on vf_scale.c, but without the unrelicensed code parts. In particular, this filter does not do scaling and has no options. It merely converts from one imgfmt to another, if needed.
Diffstat (limited to 'video/filter/vf.c')
-rw-r--r--video/filter/vf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/video/filter/vf.c b/video/filter/vf.c
index c2fc4f716a..6e2cb251e0 100644
--- a/video/filter/vf.c
+++ b/video/filter/vf.c
@@ -53,6 +53,7 @@ extern const vf_info_t vf_info_pullup;
extern const vf_info_t vf_info_sub;
extern const vf_info_t vf_info_yadif;
extern const vf_info_t vf_info_stereo3d;
+extern const vf_info_t vf_info_convert;
extern const vf_info_t vf_info_lavfi;
extern const vf_info_t vf_info_lavfi_bridge;
extern const vf_info_t vf_info_vaapi;
@@ -81,6 +82,7 @@ static const vf_info_t *const filter_list[] = {
&vf_info_sub,
#endif
+ &vf_info_convert,
&vf_info_lavfi,
&vf_info_lavfi_bridge,
&vf_info_buffer,
@@ -553,7 +555,7 @@ static void query_formats(uint8_t *fmts, struct vf_instance *vf)
static bool is_conv_filter(struct vf_instance *vf)
{
- return vf && (strcmp(vf->info->name, "scale") == 0 || vf->autoinserted);
+ return vf && (strcmp(vf->info->name, "convert") == 0 || vf->autoinserted);
}
static const char *find_conv_filter(uint8_t *fmts_in, uint8_t *fmts_out)
@@ -569,7 +571,7 @@ static const char *find_conv_filter(uint8_t *fmts_in, uint8_t *fmts_out)
}
}
}
- return "scale";
+ return "convert";
}
static void update_formats(struct vf_chain *c, struct vf_instance *vf,