summaryrefslogtreecommitdiffstats
path: root/video/sws_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/sws_utils.c')
-rw-r--r--video/sws_utils.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/video/sws_utils.c b/video/sws_utils.c
index a310772280..9f1d0fd950 100644
--- a/video/sws_utils.c
+++ b/video/sws_utils.c
@@ -121,6 +121,21 @@ bool mp_sws_supported_format(int imgfmt)
&& sws_isSupportedOutput(av_format);
}
+bool mp_sws_supports_formats(struct mp_sws_context *ctx,
+ int imgfmt_out, int imgfmt_in)
+{
+#if HAVE_ZIMG
+ if (ctx->allow_zimg && ctx->opts_allow_zimg) {
+ if (mp_zimg_supports_in_format(imgfmt_in) &&
+ mp_zimg_supports_out_format(imgfmt_out))
+ return true;
+ }
+#endif
+
+ return sws_isSupportedInput(imgfmt2pixfmt(imgfmt_in)) &&
+ sws_isSupportedOutput(imgfmt2pixfmt(imgfmt_out));
+}
+
static int mp_csp_to_sws_colorspace(enum mp_csp csp)
{
// The SWS_CS_* macros are just convenience redefinitions of the