android - Custom Camera PictureCallback does not run if flash used on S4 devices -


I wrote a basic custom camera that I recently changed to use Flash (where available) on the device Was there. Once I made the change, the code was okay on my HTC One Mini 2, but now has not worked on my Galaxy S4. After stepping through, I found that my JPEG callback never returns to S4, but rather a raw callback is run, but with the supply of an empty byte [].

I got this same question:

which confirm problems and solutions on these devices, but the solution has not been documented.

To repeat, code works fine on S4, unless I do not turn on Flash:

  Camera. Parameter p = mCamera.getParameters (); P.setFlashMode (Camera.Parameters.FLASH_MODE_AUTO); // or FLASH_MODE_ON mCamera.setParameters (P);  

Can anyone provide any solutions with experience on these devices?

After a lot of testing and error in the last week I have stumbled upon two possible solutions to this problem First of which I do not understand:

  1. Forcing Zoom to be greater than X1 For some reasons if I set the zoom to X 1.2 etc. Camera works again as I expect.

  2. Make sure the aspect ratio of the selected picture size matches the native aspect S4 has a resolution of 1920x1080, so the size of any picture that is 16 : Match 9 ratio, works on Flash on it It makes a bit more sense but why the flash is different and why nothing is supported, I should not go back with getSupportedPictureSizes () (although they appear without flash.)

Currently I have opted to use Option 2 and are testing on my other devices. It should also be noted that my next step was on S4 that the user was allowed to turn on the Flash / ON / OFF flash but every time the camera was needed to destroy and rebuild it.


Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -