diff options
author | Philip Langdale <philipl@overt.org> | 2023-12-11 09:28:26 +0800 |
---|---|---|
committer | Philip Langdale <github.philipl@overt.org> | 2023-12-15 14:17:19 -0800 |
commit | 672829439a21d8290ffa866a1bbe48e659036451 (patch) | |
tree | ce1c99002209e09893b525619547d50467251686 /filters/f_hwtransfer.c | |
parent | f575b3d1bdb41354ee1741655328ab3d458a20f3 (diff) | |
download | mpv-672829439a21d8290ffa866a1bbe48e659036451.tar.bz2 mpv-672829439a21d8290ffa866a1bbe48e659036451.tar.xz |
hwtransfer: actually treat hardware formats as supported input formats
It's conceptually broken for an hw format to be identified as a
supported sw format for an hwdec, but in the case of the drm hwdec,
we have no choice but to do so for the weird rpi formats, as these
are declared, incorrectly, as hw formats in their forked ffmpegs.
This means we can't reject such formats as a matter of principle,
as we do today. Instead let's just assume that such formats can always
be accepted as-is, and will never require conversion. In practice, this
is either true or it will fail in the VO, which is the old behaviour
from before I introduced the conversion filter capability.
Diffstat (limited to 'filters/f_hwtransfer.c')
-rw-r--r-- | filters/f_hwtransfer.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/filters/f_hwtransfer.c b/filters/f_hwtransfer.c index 94359bf439..26b1daaedc 100644 --- a/filters/f_hwtransfer.c +++ b/filters/f_hwtransfer.c @@ -94,10 +94,12 @@ static bool select_format(struct priv *p, int input_fmt, if (!input_fmt) return false; - // If the input format is a hw format, then we shouldn't be doing this - // format selection here at all. + // If the input format is a hw format, then we won't be doing any sort of + // conversion. Just assume that it will pass-through successfully. if (IMGFMT_IS_HWACCEL(input_fmt)) { - return false; + *out_hw_input_fmt = input_fmt; + *out_hw_output_fmt = input_fmt; + return true; } // If there is no capability to do uploads or conversions during uploads, |