media/gpu/v4l2: do not start decoding before EGL image is assigned.

CL crrev.com/c/1288498 tried to optimize things a bit by assigning the
EGL image for a new buffer while the decoder started using said buffer.
This works on all platforms but Tegra: when doing so the first frame of
each buffer is a partially-cleared image without any trace of decoding.

What may be happening is that the Tegra EGL or V4L2 library clears the
buffers that are assigned to EGL images. This would explain the observed
behavior since the first frame is likely to get decoded into the buffer
before its EGL image is assigned. This would also explain why subsequent
frames are not affected.

Work this around by making sure that the buffer is not made available
for decoding before it is assigned an EGL image. This was the behavior
before crrev.com/c/1288498, so no performance penalty is introduced.

correct on nyan_big.

Bug: 920908
Test: Checked that H.264 playback on crosvideo.appspot.com was
Change-Id: I3bd79a02c82676b743305d23ac0691be7d67f8a7
Reviewed-on: https://chromium-review.googlesource.com/c/1424683
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#624537}
1 file changed