CameraHardwareInterface: Reconnect preview in HAL set_buffer_count
Workaround for b/27039775 Some camera device HAL v1 implementations expect that calling preview_stream_ops->set_buffer_count resets the preview stream's flag for whether any buffers have been queued up by the camera HAL, allowing the HAL to dequeue all buffers in the stream again (instead of just its own buffer count limit, which is lower). The underlying buffer queue behavior has now changed, and that flag is no longer reset on a change of buffer count, to support dynamic buffer queue buffer count features. To maintain backwards compatibility with HALv1 implementations that rely on this implicit HAL interface behavior, add a disconnect/connect pair to the set_buffer_count call, which will reset the dequeue flag, along with all other preview stream parameters. To maintain other parameters, cache them when they are originall set (either by the HAL or by the higher-level camera client), and apply them again after reconnecting. Bug: 27039775 Change-Id: I9fa220b356715e7f8e48adc7acdffbfa598c329c
Loading
Please register or sign in to comment