I'm using zxing in my android app. When it starts it goes in 16:9 mode. I'm debugging onto a 10' tablet. I'm pretty sure it loads in 16:9 beacause, opening the stock camera application, I can choose either 16:9 resolution and 4:3. When I set 16:9, the image matches exactly the one I get from my app running zxing. I need to set the resolution to 4:3. And I know that it is supported beacuse it shows me the option in the stock camera app. I'm using the front camera. I'm in lollipop. I need help. I've tried this:
Camera camera = Camera.open(1);
Camera.Parameters parameters = camera.getParameters();
parameters.setPictureSize(640, 480);
But when I later try to initiate the zxing IntentIntegrator it fails saying it was not able to access the camera with id 1 (front). I've searched for the equivalent with new camera2 API with no success. Maybe you know how to do it. I'm compiling zxing from the build.gradle in android studio. So I don't think I might be able to edit zxing sources.
Here's my code:
Camera camera = Camera.open(1);
Camera.Parameters parameters = camera.getParameters();
parameters.setPictureSize(640, 480);
IntentIntegrator integrator = new IntentIntegrator(this);
integrator.setCameraId(1);
integrator.initiateScan();
And here's the error: