High quality camera sensors usually output only raw RGB(Bayer pattern) data.
But FSL camera HAL can only preview HAL_PIXEL_FORMAT_YCbCr_420_SP format, which is supported by IPU and VPU both(see below codes in BSP).
void DeviceAdapter::setPreviewPixelFormat()
{
int vpuFormats[MAX_VPU_SUPPORT_FORMAT];
memset(vpuFormats, 0, sizeof(vpuFormats));
int ret = mMetadaManager->getSupportedRecordingFormat(&vpuFormats[0],
MAX_VPU_SUPPORT_FORMAT);
if (ret != NO_ERROR) {
FLOGE("getSupportedRecordingFormat failed");
mPreviewPixelFormat = HAL_PIXEL_FORMAT_YCbCr_420_SP;
return;
}
mPreviewPixelFormat = getMatchFormat(vpuFormats, MAX_VPU_SUPPORT_FORMAT,
mAvailableFormats, MAX_SENSOR_FORMAT);
}
How to modify the camera HALL to preview this type of sensor data?