Abort read() after CameraSource has stopped

Before this change, CameraSource::read() may loop forever if
- setStopTimeUs() is called when there are no pending unprocessed
frames; and
- New frames that arrive after setStopTimeUs() was called have timestamps
greater than what was passed to setStopTimeUs().

This change makes read() return ERROR_END_OF_STREAM in this situation.

Test: cts-tradefed run cts -m CtsMediaTestCases \
-t android.media.cts.MediaRandomTest#testRecorderRandomAction

Test: cts-tradefed run cts -m CtsCameraTestCases \
-t android.hardware.camera2.cts.FastBasicsTest

Bug: 111661316
Change-Id: I4db4011849dbf9cc4b31e7f142017a650e4d0ed7
2 files changed