RELAND: vaapi: decode on client NativePixmaps
This CL relands crrev.com/c/1021675 that got reverted as predecessor to crrev.com/c/1104394 (but was otherwise innocent AFAIK). The said predecessor situation has been corrected by crrev.com/c/1117606 (that landed in ChromeOS 10840.0.0 [1]) [1] https://crosland.corp.google.com/log/10837.0.0..10840.0.0 TBR=dcastagna@chromium.org (same code as reviewed before) Original CL description ----------------------------------------------- vaapi: decode on client NativePixmaps This CL teaches VaVDA to use client VASurfaceIDs to decode onto, saving a buffer copy and removing a costly blit (DownloadFromSurface) on the GPU Main thread. Three groups of changes: 1. In AssignPictureBuffers(): if |vaapi_picture_factory_| Create()s a VaapiPicture with a VASurfaceID, we use those to decode onto and set a new flag: |decode_using_client_picture_buffers_| 2. When the decoder calls CreateVASurface(), instead of giving it the first |available_va_surfaces_|, we need to figure out the first VASurfaceID in this |available_va_surfaces_| such that the corresponding VaapiPicture in |pictures_| is available (i.e. in |available_picture_buffers_|). Reason: libva holds on to some VASurfaceIDs, there's no simple one-to-one correspondence like on ToT. 3. When we're ready to OutputPicture() to |client_|, instead of using the first |available_picture_buffers_|, we find the corresponding one for the passed |va_surface_id| (we could search all over |pictures_| but there's always less |available_picture_buffers_|. Some other notable developments: - s/output_buffers_/available_picture_buffers_/ - OutputPicture() loses a parameter. - |decode_using_client_picture_buffers_| is still false for e.g. VP9 Profile 2 or the ImportBufferForPicture() path. - Pictures is made a base::small_map. (Originally from crrev.com/c/988512). resolutions for a long time. No hickups, no dropped frames. Bug: 822346, 717265 Test: v_d_a_unittest vp8/vp9/h264 passing on eve, running crosvideo changing Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel Change-Id: Ie1fb21a7a302476bceee3dd905278d53f13b1475 Reviewed-on: https://chromium-review.googlesource.com/1021675Reviewed-by:Daniele Castagna <dcastagna@chromium.org> Reviewed-by:
Kristian H. Kristensen <hoegsberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1147143 Commit-Queue: Miguel Casas <mcasas@chromium.org> Reviewed-by:
Miguel Casas <mcasas@chromium.org> Cr-Commit-Position: refs/heads/master@{#577226}
Showing
Please register or sign in to comment