mitchtabian / TabianCustomCamera

Custom camera for android using camera2 api (DEPRECATED)
153 stars 64 forks source link

Image Captured By Camera (Front & Back ) Is Always A Focused Circle Shape #5

Closed AliShujaatBhatti closed 5 years ago

AliShujaatBhatti commented 5 years ago

Everything Is Working Fine But When Image Is Captured ( Either Form Back Or Front Camera), it is always A Focused Circle Shape Image

Take A Look At some Screenshots Taken From The App ScreenShot 1: screenshot_2018-10-30-13-39-32

ScreenShot 2: screenshot_2018-10-30-13-38-32

ScreenShot 3: screenshot_2018-10-30-13-37-54

// Now I Think The Problem Is in the startManualFocus() Method, I Tried To made Some Changes In It , but it didn't work For Me

------------- Phone Test Reuslts:-------------------- Device Information: OS Version: 3.10.72(1479799023) OS API Level: 22 Device: QMobile Model (and Product): QMobile i6i (QMobile i6i)

Display Properties : Display Width: 480 Display Height: 854 Aspect Ratio: 1.7791667

mitchtabian commented 5 years ago

I'm unable to reproduce this issue as I don't have one of those phones.

What if you replace the "onTouch" method in Camera2Fragment with this: https://gist.github.com/mitchtabian/337e5091b5a44c9b891c77251c5bd1ed

(I've commented out the 'startManualFocus' method)

AliShujaatBhatti commented 5 years ago

ok let me try this , and i think so i had already tried this by commenting this function , let me try again and i will tell you

AliShujaatBhatti commented 5 years ago

Its Still having the same issue bro , i also commented out the startManualFocus Method but its still the same

mitchtabian commented 5 years ago

Copy the two methods in this gist into the Camera2Fragment.java class. One will replace your current "startManualFocus" method and the other one is a method I just made named "checkDeviceSupportLevel"

https://gist.github.com/mitchtabian/8b33874ce8cfd8c9843c059d3a11aae8

Run the app and click the screen to trigger a focus. Then look at the log and tell me what the output is. It will show one of the cases from the switch statement in the "checkDeviceSupportLevel" method.

AliShujaatBhatti commented 5 years ago

bro i toasted that thing , actually android studio is not showing anything in Log i dont know why but i toasted that thing

Note :- it is the third case in your checkDeviceSupportLevel method

--> See This screenShot Below screenshot_2018-11-08-02-19-29

mitchtabian commented 5 years ago

Sorry the gist was incorrect. I've changed the "checkDeviceSupportLevel" method.

LEGACY is actually the lowest (1/5). So that's likely your problem. The camera2 api is not really supported by that device. You'll need to use the old camera api for devices with API level less than 21. Some devices with API level 21 support the camera2 api, but its not guaranteed.

AliShujaatBhatti commented 5 years ago

ohh ok :O tomorrow i will try it on some other Device and thanks for help :)

mitchtabian commented 5 years ago

Let me know how it goes with the other device.