media/android: Ensure correct synchronization of video buffers.

The current code only waits on a fence from either GL or the android
framework depending on which was the last user of the buffer. However,
if that buffer is used by both these APIs, we should be waiting on
fences from both these consumers when releasing this buffer back to the
AImageReader. Fix that.

R=liberato@chromium.org, piman@chromium.org

Bug: 889328
Change-Id: I03623aea03fc894362758ced490caeb3487d9f63
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1506947
Commit-Queue: Khushal <khushalsagar@chromium.org>
Commit-Queue: Frank Liberato <liberato@chromium.org>
Auto-Submit: Khushal <khushalsagar@chromium.org>
Reviewed-by: Frank Liberato <liberato@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#639127}
4 files changed