<html><head></head><body>Why is this needed anymore? It should be possible to add a new VA without changing the avcodec plugin.<br><br><div class="gmail_quote">Le 18 décembre 2019 16:53:04 GMT+02:00, Steve Lhomme <robux4@ycbcr.xyz> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">Similar to vlc_va_GetChroma() but without forcing an output format.<hr> modules/codec/avcodec/va.c | 57 ++++++++++++++++++++++++++++++++++++++<br> modules/codec/avcodec/va.h | 9 ++++++<br> 2 files changed, 66 insertions(+)<br><br>diff --git a/modules/codec/avcodec/va.c b/modules/codec/avcodec/va.c<br>index fc3ef3fe8ab..f045304efb5 100644<br>--- a/modules/codec/avcodec/va.c<br>+++ b/modules/codec/avcodec/va.c<br>@@ -95,6 +95,63 @@ vlc_fourcc_t vlc_va_GetChroma(enum PixelFormat hwfmt, enum PixelFormat swfmt)<br> }<br> }<br> <br>+bool vlc_va_MightDecode(enum PixelFormat hwfmt, enum PixelFormat swfmt)<br>+{<br>+ switch (hwfmt)<br>+ {<br>+ case AV_PIX_FMT_VAAPI_VLD:<br>+ switch (swfmt)<br>+ {<br>+ case AV_PIX_FMT_YUVJ420P:<br>+ case AV_PIX_FMT_YUV420P:<br>+ case AV_PIX_FMT_YUV420P10LE:<br>+ return true;<br>+ default:<br>+ return false;<br>+ }<br>+ case AV_PIX_FMT_DXVA2_VLD:<br>+ switch (swfmt)<br>+ {<br>+ case AV_PIX_FMT_YUV420P10LE:<br>+ case AV_PIX_FMT_YUVJ420P:<br>+ case AV_PIX_FMT_YUV420P:<br>+ return true;<br>+ default:<br>+ return false;<br>+ }<br>+ break;<br>+<br>+ case AV_PIX_FMT_D3D11VA_VLD:<br>+ switch (swfmt)<br>+ {<br>+ case AV_PIX_FMT_YUV420P10LE:<br>+ case AV_PIX_FMT_YUVJ420P:<br>+ case AV_PIX_FMT_YUV420P:<br>+ return true;<br>+ default:<br>+ return false;<br>+ }<br>+ break;<br>+<br>+ case AV_PIX_FMT_VDPAU:<br>+ switch (swfmt)<br>+ {<br>+ case AV_PIX_FMT_YUVJ444P:<br>+ case AV_PIX_FMT_YUV444P:<br>+ case AV_PIX_FMT_YUVJ422P:<br>+ case AV_PIX_FMT_YUV422P:<br>+ case AV_PIX_FMT_YUVJ420P:<br>+ case AV_PIX_FMT_YUV420P:<br>+ return true;<br>+ default:<br>+ return false;<br>+ }<br>+ break;<br>+ default:<br>+ return false;<br>+ }<br>+}<br>+<br> static int vlc_va_Start(void *func, bool forced, va_list ap)<br> {<br> vlc_va_t *va = va_arg(ap, vlc_va_t *);<br>diff --git a/modules/codec/avcodec/va.h b/modules/codec/avcodec/va.h<br>index 95d1303f683..8ef429f4f96 100644<br>--- a/modules/codec/avcodec/va.h<br>+++ b/modules/codec/avcodec/va.h<br>@@ -64,6 +64,15 @@ typedef int (*vlc_va_open)(vlc_va_t *, AVCodecContext *, const AVPixFmtDescripto<br> */<br> vlc_fourcc_t vlc_va_GetChroma(enum PixelFormat hwfmt, enum PixelFormat swfmt);<br> <br>+/**<br>+ * Determines whether the hardware acceleration PixelFormat can be used to<br>+ * decode pixels similar to the software PixelFormat.<br>+ * @param hwfmt the hardware acceleration pixel format<br>+ * @param swfmt the software pixel format<br>+ * @return true if the hardware acceleration should be supported<br>+ */<br>+bool vlc_va_MightDecode(enum PixelFormat hwfmt, enum PixelFormat swfmt);<br>+<br> /**<br> * Creates an accelerated video decoding back-end for libavcodec.<br> * @param obj parent VLC object</pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>