I am developing a camera application using camera2 api. I use the project in this link: https://github.com/googlesamples/android-Camera2Basic
Here is my problem:
- If I set the relation as the display relation, everything is fine.
- If I need a 4: 3 camera preview, I have problems with Samsung Note 4 (both rear and front camera), on Nexus 6 (front camera). The camera preview is stretched horizontally. Here are the images (left: what I expected is correct: what I got).

Please help me solve this problem.
source share