diff options
author | wm4 <wm4@nowhere> | 2019-10-02 23:00:28 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-10-02 23:12:50 +0200 |
commit | 9b55009e8f6e81bdc19172b4469b58646464dc80 (patch) | |
tree | 296b626ed22927ba797efece7b6de913b2dd0dda /filters/f_autoconvert.h | |
parent | 55424c29d35ec96061c36537e1ad18cd9a281b5a (diff) | |
download | mpv-9b55009e8f6e81bdc19172b4469b58646464dc80.tar.bz2 mpv-9b55009e8f6e81bdc19172b4469b58646464dc80.tar.xz |
f_autoconvert: provide a function to determine if conversion works
This adds the function as seen in the f_autoconvert.h part of the patch.
It's pretty simple, but goes along with an intrusive code move. I guess
the resulting code is slightly nicer anyway.
Diffstat (limited to 'filters/f_autoconvert.h')
-rw-r--r-- | filters/f_autoconvert.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/filters/f_autoconvert.h b/filters/f_autoconvert.h index d8fac346e5..c26612f2f9 100644 --- a/filters/f_autoconvert.h +++ b/filters/f_autoconvert.h @@ -2,6 +2,8 @@ #include "filter.h" +struct mp_image; + // A filter which automatically creates and uses a conversion filter based on // the filter settings, or passes through data unchanged if no conversion is // required. @@ -34,6 +36,17 @@ void mp_autoconvert_add_imgfmt(struct mp_autoconvert *c, int imgfmt, int subfmt) // as the normal semantics will exclude other formats (including hw ones). void mp_autoconvert_add_all_sw_imgfmts(struct mp_autoconvert *c); +// Approximate test for whether the input would be accepted for conversion +// according to the current settings. If false is returned, conversion will +// definitely fail; if true is returned, it might succeed, but with no hard +// guarantee. This is mainly intended for better error reporting to the user. +// The result is "approximate" because it could still fail at runtime. +// The mp_image is not mutated. +// This function is relatively slow. +// Accepting mp_image instead of any mp_frame is the result of laziness. +bool mp_autoconvert_probe_input_video(struct mp_autoconvert *c, + struct mp_image *img); + // Add the formats supported by the hwdec interops (or essentially refine them), // and trigger conversion if hw_subfmts mismatch. This is mostly a hack for // D3D11/ANGLE (which supports NV12 only). |