[vlc-commits] [Git][videolan/vlc][master] 2 commits: interop_vaapi: set ExportSurfaceHandle flags

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Thu Feb 2 12:53:09 UTC 2023



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
1264e7b9 by Zhao Zhili at 2023-02-02T12:35:52+00:00
interop_vaapi: set ExportSurfaceHandle flags

Set VA_EXPORT_SURFACE_READ_ONLY flag, and request separate layers
via VA_EXPORT_SURFACE_SEPARATE_LAYERS explicitly.

- - - - -
28bf3ccc by Zhao Zhili at 2023-02-02T12:35:52+00:00
interop_vaapi: sync before ExportSurfaceHandle

ExportSurfaceHandle does not perform any synchronisation. If the
contents of the surface will be read, vaSyncSurface() must be
called before doing so.

- - - - -


1 changed file:

- modules/video_output/opengl/interop_vaapi.c


Changes:

=====================================
modules/video_output/opengl/interop_vaapi.c
=====================================
@@ -224,8 +224,10 @@ tc_vaegl_update(const struct vlc_gl_interop *interop, uint32_t textures[],
         assert(va_image.format.fourcc == priv->fourcc);
 
 #if VA_CHECK_VERSION(1, 1, 0)
+        VA_CALL(o, vaSyncSurface, priv->vadpy, vlc_vaapi_PicGetSurface(pic));
         if (vlc_vaapi_ExportSurfaceHandle(o, priv->vadpy, vlc_vaapi_PicGetSurface(pic),
-                                          VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2, 0,
+                                          VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2,
+                                          VA_EXPORT_SURFACE_READ_ONLY | VA_EXPORT_SURFACE_SEPARATE_LAYERS,
                                           &va_surface_descriptor))
             goto error;
 #else
@@ -244,12 +246,6 @@ tc_vaegl_update(const struct vlc_gl_interop *interop, uint32_t textures[],
     {
         unsigned obj_idx = va_surface_descriptor.layers[i].object_index[0];
 
-        /* Since we don't ask for composite object through
-         * vaExportSurfaceHandle, we shouldn't get any multiplane
-         * layer. */
-        if (va_surface_descriptor.layers[i].num_planes > 1)
-          goto error;
-
         egl_images[i] =
             vaegl_image_create(interop, tex_width[i], tex_height[i],
                                priv->drm_fourccs[i],



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f791cbed559a086e7aaa13c5f3dffc09f4a82dea...28bf3ccc4ded16a6a4c5e6bc21fabf2b61787bf7

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f791cbed559a086e7aaa13c5f3dffc09f4a82dea...28bf3ccc4ded16a6a4c5e6bc21fabf2b61787bf7
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list