I’ve noticed that when requesting Camera2 ImageFormat.YUV_420_888 VGA data on the specified device - Galaxy A23 (SM-A236B) - the Y, U and V channels have unexpected sizes and row strides.
This was visible in all Android versions available for this device.
Could you please let me know if there is an issue with your Camera2 implementation on this device or if you are returning something that is not YUV_420_888.
In this case, you need to be sure that you correctly configure the image format available when prompted by the Camera2 API. If you match ImageFormat.YUV_420_888, then the corresponding Y, U and V, should have the appropriate dimensions and line steps. However, if you are sure to change the image scale, it is possible that the scaling problem with the Camera2 implementation is approaching an outcome. In this case, it is recommended to prefer the device manufacturer or the developer of the Android system infection for more information and a solution to the problem. You can also try using other image formats, such as ImageFormat. NV21 to make sure that the problem does not affect the YUV format.
@SachinKumar Although Camera1 returns Y “normally” i found the camera2 returns Y with padding hence the values (y Row stride > requested width). For example, in the first row, the values past index 640 on Y are filled with zeros. I’m pretty sure this is a manufacturer limitation so it would be nice to have this data somewhere so we know which devices can behave differently…
There is more issues with this device and Camera2/Vulkan… but i won’t even start on those to not mix issues into this one.