I use the Android Camera2 API to take photos for the application, and I cannot get the flash to work normally on most Samsung Galaxy devices (galaxy s6, galaxy s7, galaxy j7). I believe that I implemented the flash logic correctly, because the Google Camera application that was previously on the Play Store also shows the same behavior. Also, the s8 galaxy seems to work quite well with the flash (although the results definitely have inconsistent lighting)
The problem with the galaxy j7 is that when I take a picture with the flash (either with the flash turned on or with the automatic flash in a scene requiring a flash), the flash will remain for a long time, the preview will be blocked, and then after The image will take 7 seconds, and the flash is not part of the image.
I have the following way to handle flash modes:
private void setAutoFlash(CaptureRequest.Builder requestBuilder) { switch (mFlashState) { case FLASH_STATE_AUTO: requestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH); //requestBuilder.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_OFF); break; case FLASH_STATE_ON: requestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_ALWAYS_FLASH); //requestBuilder.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_SINGLE); break; case FLASH_STATE_OFF: requestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON); //requestBuilder.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_OFF); break; } }
This flash logic is called whenever CaptureRequest.Builder is needed.
3 numbered lines is still something I read that it was suggested to help flash work right for me, but it seems to do nothing
Samsung API- (http://developer.samsung.com/galaxy/camera) , Camera2, , API .
:
, , . , ZCamera ( ) , , , SDK Samsung. SDK Samsung.
SDK Samsung . Samsung SDK Google 2, Samsung, , Samsung.
, , , , , , (, / ), -, , , . googles camera2 api, .
, Samsung (, , , ), , AE, , . , , AE , ,
camera2 API Android. . : this this. , . Samsung, camera2API:
if (mIsFlashSupported) { switch (mFlashMode) { case FLASH_MODE_ON: requestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON); requestBuilder.set(CaptureRequest.FLASH_MODE, CameraMetadata.FLASH_MODE_SINGLE); requestBuilder.set(CaptureRequest.CONTROL_AWB_MODE, CaptureRequest.CONTROL_AWB_MODE_FLUORESCENT); break; case FLASH_MODE_OFF: requestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CameraMetadata.CONTROL_AE_MODE_ON); requestBuilder.set(CaptureRequest.FLASH_MODE, CameraMetadata.FLASH_MODE_OFF); requestBuilder.set(CaptureRequest.CONTROL_AWB_MODE, CaptureRequest.CONTROL_AWB_MODE_DAYLIGHT); break; case FLASH_MODE_AUTO: default: requestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CameraMetadata.CONTROL_AE_MODE_ON_AUTO_FLASH); requestBuilder.set(CaptureRequest.FLASH_MODE, CameraMetadata.FLASH_MODE_SINGLE); requestBuilder.set(CaptureRequest.CONTROL_AWB_MODE, CaptureRequest.CONTROL_AWB_MODE_DAYLIGHT); break; } }
5 . (1) , (2) , (3) Capture, Flash .
Samsung SM-G550T (Android 6.01), Flash Mode Moto G4 (Android 7.0). Flash, :
CaptureRequest.Builder requestBuilder = mCameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_STILL_CAPTURE); requestBuilder.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_SINGLE);
LG (M210N) (Android 7.0). , . ( ), .
CONTROL_AE_MODE_ON_ALWAYS_FLASH requestBuilder, LG . .
CONTROL_AE_MODE_ON_ALWAYS_FLASH
, . , .
Source: https://habr.com/ru/post/1679181/More articles:Skip groups of arguments in a Variadic template - c ++problems with headers youtube-iframe-api - youtube-iframe-apihttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1679178/how-to-expand-certain-columns-to-rows-using-python-pandas&usg=ALkJrhh8xsv7B1oXNdcRvUldJZ1iBMveyAEmbed Youtube with captions by default not working - javascriptHow to skip comments in a block / block / nested block in Boost.Spirit? - c ++Use lubridate to edit the year in the dplyr - r chainKafkaconsumer небезопасен для многопоточного доступа - spark-streamingHow can I sort a list of maps using Java 8? - javajava.util.ConcurrentModificationException: KafkaConsumer небезопасен для многопоточного доступа - multithreadingLogin with OAuth LinkedIn redirection returning the error message "Access-Control-Allow-Origin header is missing on the requested resource" - javascriptAll Articles