I download Android 8.0.0 Oreo (O8.0.0_1.0.0, 4.9 kernel) from Official website。We connected a camera with DVP interface,and need to get the raw data in YUYV format in the android application layer。I modified the camera file to add yuyv support in vendor\nxp-opensource\imx\libcamera3\InfraredCsi.cpp as follows:
sensorFormats[index] = v4l2_fourcc('Y', 'U', 'Y', 'V');
availFormats[index++] = v4l2_fourcc('Y', 'U', 'Y', 'V');
mSensorFormatCount = changeSensorFormats(sensorFormats, mSensorFormats, index);
if (mSensorFormatCount == 0) {
ALOGE("%s no sensor format enum", __func__);
close(fd);
return BAD_VALUE;
}
Also I add print in vendor\nxp-opensource\imx\libcamera3\Metadata.cpp :
m.addInt32(ANDROID_SCALER_AVAILABLE_FORMATS,
sensor.mAvailableFormatCount,
sensor.mAvailableFormats);
int i = 0;
for(i = 0; i < sensor.mAvailableFormatCount; i++)
{
ALOGE("====waz: mAvailableFormats = %d\n", sensor.mAvailableFormats[i]);
}
Only one value is printed here is 20, represents the yuyv format。
But use the camera2 interface to view in the application layer, and there is no such format。
Add yuyv support, what else needs to be modified?
Thanks!