Camera ITS: Record preview by encoding through the GPU
The preview stabilization tests created a Surface with
HW_COMPOSER_OVERLAY flag and piped it directly to the MediaRecorder.
This sometimes resulted in buffer format mismatch as the gralloc buffer
allocated for HW_COMPOSER_OVERLAY alone was not compatible with
MediaRecorder. USAGE_VIDEO_ENCODE flag couldn't directly be added to the
camera surface because the test explcitly tests for non-recording
scenarios.
This CL creates a GPU pipeline to feed frames to MediaRecorder. The
camera writes to a SurfaceTexture, which does not contain the
VIDEO_ENCODE usage flag. Frames in this texture passes through a trivial
shader and written to a MediaRecorder surface set up with the
appropriate flags. The GPU handles any transcoding that needs to happen
between the SurfaceTexture and surface set up for MediaRecorder.
Bug: 240533598
Test: Manually ran test_preview_stabilization* tests.
Change-Id: I7aa349ad2355bfa9901bc95888def8d33fdd9d55
3 files changed