Commit d5560b6e authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Commit Bot

media/gpu/v4l2: make accelerators work without GL

VideoDecodeAccelerators are supposed to work without GL support,
provided the make_context_current_cb_ callback is null. However the
Initialize() method of V4L2 accelerators checked for a valid EGL display
unconditionally. Move this check under the condition that
make_context_current_cb_ is not null, so that the V4L2 accelerators can
be used without an EGL display.

BUG=819542
TEST=Made sure VDA tests were still passing on eve, hana and kevin.

Change-Id: I632e85bad6871910c8a9114c6c34338c37262c08
Reviewed-on: https://chromium-review.googlesource.com/954767Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Reviewed-by: default avatarDan Sanders <sandersd@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542982}
parent 00eae0d9
...@@ -549,13 +549,13 @@ bool V4L2SliceVideoDecodeAccelerator::Initialize(const Config& config, ...@@ -549,13 +549,13 @@ bool V4L2SliceVideoDecodeAccelerator::Initialize(const Config& config,
decode_client_ = client_; decode_client_ = client_;
} }
if (egl_display_ == EGL_NO_DISPLAY) {
VLOGF(1) << "could not get EGLDisplay";
return false;
}
// We need the context to be initialized to query extensions. // We need the context to be initialized to query extensions.
if (!make_context_current_cb_.is_null()) { if (!make_context_current_cb_.is_null()) {
if (egl_display_ == EGL_NO_DISPLAY) {
VLOGF(1) << "could not get EGLDisplay";
return false;
}
if (!make_context_current_cb_.Run()) { if (!make_context_current_cb_.Run()) {
VLOGF(1) << "could not make context current"; VLOGF(1) << "could not make context current";
return false; return false;
......
...@@ -222,13 +222,13 @@ bool V4L2VideoDecodeAccelerator::Initialize(const Config& config, ...@@ -222,13 +222,13 @@ bool V4L2VideoDecodeAccelerator::Initialize(const Config& config,
video_profile_ = config.profile; video_profile_ = config.profile;
if (egl_display_ == EGL_NO_DISPLAY) {
VLOGF(1) << "could not get EGLDisplay";
return false;
}
// We need the context to be initialized to query extensions. // We need the context to be initialized to query extensions.
if (!make_context_current_cb_.is_null()) { if (!make_context_current_cb_.is_null()) {
if (egl_display_ == EGL_NO_DISPLAY) {
VLOGF(1) << "could not get EGLDisplay";
return false;
}
if (!make_context_current_cb_.Run()) { if (!make_context_current_cb_.Run()) {
VLOGF(1) << "could not make context current"; VLOGF(1) << "could not make context current";
return false; return false;
......
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