summaryrefslogtreecommitdiffstats
path: root/video/sws_utils.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-10-20 01:57:47 +0200
committerwm4 <wm4@nowhere>2019-10-20 02:17:31 +0200
commit51e141f7ba8a9207a752d295da59b01286e02c23 (patch)
tree60431bc29d227a65b97228924bc8e8950f39c91e /video/sws_utils.h
parent07aa29ed8e11797310bbc8d569cc58e29bb794e3 (diff)
downloadmpv-51e141f7ba8a9207a752d295da59b01286e02c23.tar.bz2
mpv-51e141f7ba8a9207a752d295da59b01286e02c23.tar.xz
sws_utils: hack in zimg redirection support
Awful shit. I probably wouldn't accept this code from someone else, just so you know. The idea is that a sws_utils user can automatically use zimg without large code changes. Basically, laziness. Since zimg support is still very new, and I don't want that anything breaks just because zimg was enabled at build time, an option needs to be set to enable it. (I have especially especially obscure stuff in mind, which is all what libswscale is used in mpv.) This _still_ doesn't cause zimg to be used anywhere, because the sws_utils user has to opt-in by setting allow_zimg. This is because some users depend on certain libswscale features.
Diffstat (limited to 'video/sws_utils.h')
-rw-r--r--video/sws_utils.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/video/sws_utils.h b/video/sws_utils.h
index 629e6be2dd..1d40ceab66 100644
--- a/video/sws_utils.h
+++ b/video/sws_utils.h
@@ -31,6 +31,7 @@ struct mp_sws_context {
// mp_sws_scale() will handle the changes transparently.
int flags;
int brightness, contrast, saturation;
+ bool allow_zimg; // use zimg if available (ignores filters and all)
bool force_reload;
// These are also implicitly set by mp_sws_scale(), and thus optional.
// Setting them before that call makes sense when using mp_sws_reinit().
@@ -46,8 +47,10 @@ struct mp_sws_context {
struct SwsContext *sws;
bool supports_csp;
- // Contains parameters for which sws is valid
- struct mp_sws_context *cached;
+ // Private.
+ struct mp_sws_context *cached; // contains parameters for which sws is valid
+ struct mp_zimg_context *zimg;
+ bool opts_allow_zimg, zimg_ok;
};
struct mp_sws_context *mp_sws_alloc(void *talloc_ctx);