media/android: Increase max_images limit for AImageReader.

Currently we assume that atmost 2 buffers can be acquired simultaneously
from AImageReader, the buffer currently being used and the next buffer.
In UpdateTexImage we first acquire a new buffer before releasing the
previous one. The current limit is set to 3, one higher than the
expected usage.

But with SurfaceControl, the ownership of the buffer remains with the
framework until a frame/transaction is acked. Since we use triple
buffering, this means we can acquire upto 3 buffers simultaneously.
Update the max_images limit when setting AImageReader to account for
this usage pattern.

Bug: 889328
Change-Id: Id4e0f4a103c4e8549ffacad7052315304efd363f
Auto-Submit: Khushal <>
Commit-Queue: Frank Liberato <>
Reviewed-by: Frank Liberato <>
Cr-Commit-Position: refs/heads/master@{#631845}
1 file changed