diff options
author | wm4 <wm4@nowhere> | 2019-10-21 01:29:48 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-10-21 01:38:25 +0200 |
commit | 5dba244c226383f9f3b15b07dfa5133ad08b6497 (patch) | |
tree | 3b6e46e9ef3350670f32a56140322980e3b37954 /filters/f_swscale.h | |
parent | 8a4e9d5c180157684546db4c1235d8c958172ca9 (diff) | |
download | mpv-5dba244c226383f9f3b15b07dfa5133ad08b6497.tar.bz2 mpv-5dba244c226383f9f3b15b07dfa5133ad08b6497.tar.xz |
filters: extend vf_format so that it can convert color parameters
Form some reason (and because of my fault), vf_format converts image
formats, but nothing else. For example, setting the "colormatrix"
sub-parameter would not convert it to the new value, but instead
overwrite the metadata (basically "reinterpreting" the image data
without changing it).
Make the historical mistake worse, and go all the way and extend it such
that it can perform a conversion. For compatibility reasons, this needs
to be requested explicitly. (Maybe this would deserve a separate filter
to begin with, but things are messed up anyway. Feel free to suggest an
elegant and simple solution.)
This demonstrates how zimg can properly perform some conversions which
swscale cannot (see examples added to vf.rst).
Stupidly this requires 2 code paths, one for conversion, and one for
overriding the parameters.
Due to the filter bullshit (what was I thinking), this requires quite
some acrobatics that would not be necessary without these abstractions.
On the other hand, it'd definitely be more of a mess without it. Oh
whatever.
Diffstat (limited to 'filters/f_swscale.h')
-rw-r--r-- | filters/f_swscale.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/filters/f_swscale.h b/filters/f_swscale.h index fd5aa11f5e..6e26aef1ac 100644 --- a/filters/f_swscale.h +++ b/filters/f_swscale.h @@ -2,10 +2,15 @@ #include <stdbool.h> +#include "video/mp_image.h" + struct mp_sws_filter { struct mp_filter *f; // Desired output imgfmt. If 0, uses the input format. int out_format; + // If set, force all image params; ignores out_format. + bool use_out_params; + struct mp_image_params out_params; // private state struct mp_sws_context *sws; struct mp_image_pool *pool; |