Commit 64390b3c authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Commit Bot

vaapi: support allocating buffers without GL

VDAs can be created without any GL context. In this case,
VaapiPictureFactory fails to return pictures since it cannot rely on the
GL implementation to decide an allocation method. Turn to Ozone in such
a case, since this is the most sensible candidate and we plan to use
this feature in unit tests mainly.

BUG=819542
TEST=Verified that vdatest was still passing on eve, hana and kevin

Change-Id: I08484d1619f32a6bf7613f3cb4663314a1f67c72
Reviewed-on: https://chromium-review.googlesource.com/961779Reviewed-by: default avatarMiguel Casas <mcasas@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544979}
parent 01411024
......@@ -54,19 +54,24 @@ std::unique_ptr<VaapiPicture> VaapiPictureFactory::Create(
// Select DRM(egl) / TFP(glx) at runtime with --use-gl=egl / --use-gl=desktop
switch (GetVaapiImplementation(gl::GetGLImplementation())) {
case kVaapiImplementationDrm:
#if defined(USE_OZONE)
// We can be called without GL initialized, which is valid if we use Ozone.
case kVaapiImplementationNone:
FALLTHROUGH;
case kVaapiImplementationDrm:
picture.reset(new VaapiPictureNativePixmapOzone(
vaapi_wrapper, make_context_current_cb, bind_image_cb,
picture_buffer_id, size, texture_id, client_texture_id,
texture_target));
break;
#elif defined(USE_EGL)
case kVaapiImplementationDrm:
picture.reset(new VaapiPictureNativePixmapEgl(
vaapi_wrapper, make_context_current_cb, bind_image_cb,
picture_buffer_id, size, texture_id, client_texture_id,
texture_target));
#endif
break;
#endif
#if defined(USE_X11)
case kVaapiImplementationX11:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment