<div dir="ltr"><div><div><div><div><div><div><div><div>Hi,<br><br></div>Thx for your answers.<br><br></div>Actually I also realized that "vaQueryImageFormats" is maybe more related to what formats "vaCreateImage" supports.<br></div>And actually in mesa, vlVaCreateImage can create image for all formats NV12, YV12, YUYV, UYVY, BGRA.<br><br></div>So what I am looking for is a way to retrieve what format is supported for the output surface, not for a VAImage.<br></div>Also I noticed that mesa can only convert from nv12 -> yv12.<br></div>So even if an application creates one of these 5 image format, only nv12 and yv12 will be accepted to get the content of the surface, see vlVaGetImage impl.<br><br>vlVaGetConfigAttributes(VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoint, VAConfigAttrib *attrib_list, int num_attribs) sounded good but only returns VA_RT_FORMAT_YUV420 which can be I420, NV12, YV12 ... Well I can use what VaCreateImage output to pick one of the YUV420 formats but what if I want to avoid any conversion by just using exact same format of the surface.<br><br></div>And finally there is <code>vaQuerySurfaceAttributes</code>: <a href="http://cgit.freedesktop.org/libva/tree/va/va.h#n837">http://cgit.freedesktop.org/libva/tree/va/va.h#n837</a> to retrieve <code>VASurfaceAttribPixelFormat: <a href="http://cgit.freedesktop.org/libva/tree/va/va.h#n724">http://cgit.freedesktop.org/libva/tree/va/va.h#n724</a><br></code><br></div><u>But it seems mesa st/va does not implement it</u>. (neither vaapi 's vdpau-driver: <a href="http://cgit.freedesktop.org/vaapi/vdpau-driver/">http://cgit.freedesktop.org/vaapi/vdpau-driver/</a>)<br><div><div><div><div><div><div><div>There is a fallback <a href="http://cgit.freedesktop.org/libva/tree/va/va.c#n765">http://cgit.freedesktop.org/libva/tree/va/va.c#n765</a> if the backend does not provide it but just append all image formats: <a href="http://cgit.freedesktop.org/libva/tree/va/va.c#n828">http://cgit.freedesktop.org/libva/tree/va/va.c#n828</a><br>But vaapi intel driver provides it: <a href="http://cgit.freedesktop.org/vaapi/intel-driver/tree/src/i965_drv_video.c#n4825">http://cgit.freedesktop.org/vaapi/intel-driver/tree/src/i965_drv_video.c#n4825</a><br></div><div><br></div><div>So is vaQuerySurfaceAttributes the best option to retrieve this NV12 ? If yes I can try to make a patch that implements vlVaQuerySurfaceAttributes.<br><br></div><div>Thx<br></div><div>Julien<br></div><div><br></div></div></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 21 August 2015 at 18:31, Christian König <span dir="ltr"><<a href="mailto:deathsimple@vodafone.de" target="_blank">deathsimple@vodafone.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 21.08.2015 18:30, Ilia Mirkin wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Fri, Aug 21, 2015 at 12:22 PM, Julien Isorce <<a href="mailto:julien.isorce@gmail.com" target="_blank">julien.isorce@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
What is the purpose of checking PIPE_VIDEO_PROFILE_UNKNOWN :<br>
<a href="http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/nouveau/nouveau_vp3_video.c#n486" rel="noreferrer" target="_blank">http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/nouveau/nouveau_vp3_video.c#n486</a><br>
and<br>
<a href="http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/radeon/radeon_video.c#n323" rel="noreferrer" target="_blank">http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/radeon/radeon_video.c#n323</a><br>
?<br>
</blockquote>
The st calls nouveau_vp3_screen_video_supported with UNKNOWN at some<br>
point (see src/gallium/state_trackers/vdpau). Basically VDPAU can do a<br>
lot of things. One of them is video decoding, for which only NV12 is<br>
supported. But it also supports other things, for which the st<br>
supports the various other formats. No idea if that's useful, but at<br>
least that's the idea.<br>
</blockquote></span>
Yes, exactly.<br>
<br>
Querying with unknown is for checking if we can create video buffers with that format in general.<br>
<br>
Querying with a specific profile/entrypoint is for checking if we can create video buffers and decode into them.<br>
<br>
Regards,<br>
Christian.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
   -ilia<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote>
<br>
</blockquote></div><br></div>