setParameters failed
See original GitHub issueUnable to set parameters in certain devices(Redmi Note 3)
List<Camera.Size> pictureSizes = mCamera.getParameters().getSupportedPictureSizes();
//set the preview sizes that are the lowest, as we don't have to display the preview.
parameters.setPreviewSize(pictureSizes.get(pictureSizes.size() - 1).width,
pictureSizes.get(pictureSizes.size() - 1).height);
//set the camera image size based on config provided
Camera.Size cameraSize;
switch (mCameraConfig.getResolution()) {
case CameraResolution.HIGH_RESOLUTION:
cameraSize = pictureSizes.get(0); //Highest res
break;
case CameraResolution.MEDIUM_RESOLUTION:
cameraSize = pictureSizes.get(pictureSizes.size() / 2); //Resolution at the middle
break;
case CameraResolution.LOW_RESOLUTION:
cameraSize = pictureSizes.get(pictureSizes.size() - 1); //Lowest res
break;
default:
throw new RuntimeException("Invalid camera resolution.");
}
parameters.setPictureSize(cameraSize.width, cameraSize.height);
removing this code under CamPreview.java fixes the issue. Can you please remove it and push
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Camera java.lang.RuntimeException: setParameters failed
RuntimeException setParameters failed. I am facing this exception, due to this: params.setPictureSize(1200, 900);.
Read more >java.lang.RuntimeException: setParameters failed #940 - GitHub
Fatal Exception: java.lang.RuntimeException: setParameters failed at android.hardware.Camera.native_setParameters(Camera.java) at ...
Read more >camera.setParameters failed in android - iTecNote
I have tested the app on the device on 2.1. The error I got from the user is using nexus one which will...
Read more >Redmi Note 5 AI Camera Keep Stopping - XDA Forums
RuntimeException: setParameters failed at android.hardware.Camera.native_setParameters(Native Method) at android.hardware.Camera.
Read more >java.lang.RuntimeException: setParameters failed at android ...
java.lang.RuntimeException : setParameters failed at android.hardware.Camera.native_setParameters(Na. 50 views50 views. Sep 25, 2020.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks a lot,everything is working fine now.
@hussainbadri21 v1.2 is live with above fix. Check that out.— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
And for providing this library thankyou