Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

capturePicture followed by toggleFacing has issues #164

Closed
Yumcoder-dev opened this issue Feb 25, 2018 · 3 comments
Closed

capturePicture followed by toggleFacing has issues #164

Yumcoder-dev opened this issue Feb 25, 2018 · 3 comments

Comments

@Yumcoder-dev
Copy link

Yumcoder-dev commented Feb 25, 2018

  • I am using the latest version
  • capturePicture() does not take a picture!

Detailed steps to reproduce the issue:
1- call the camera1.capturePicture()
2- and if user immediately click on toggle facing buttom (when capturePicture is in progress) the CameraView.toggleFacing() is called
3- camera1.capturePicture() is disable!

Expected behavior:

after call toggleFacing, capturePicture take a picture

problem description:

1- camera1.capturePicture() --> mIsCapturingImage = true;
2- CameraView.toggleFacing() --> camera1.onStop() --> mCamera.release(); and mIsCapturingImage is never false
3- camera1.capturePicture() does not work beacuse when mIsCapturingImage==true capturePicture return immediately

how to fix it:

in the last line of camera1.onStop() add the following line:
mIsCapturingImage = false;

@Yumcoder-dev Yumcoder-dev changed the title report a bug - capturePicture() do not take a picture! report a bug - capturePicture() does not take a picture! Feb 25, 2018
@natario1
Copy link
Owner

I don't think mIsCapturingImage has a role here, the operations are executed in their order.

But maybe this can be improved.

@natario1 natario1 changed the title report a bug - capturePicture() does not take a picture! capturePicture followed by toggleFacing has issues Feb 27, 2018
@natario1
Copy link
Owner

For the moment, you should wait for the picture callback before using toggleFacing.

@natario1
Copy link
Owner

natario1 commented Mar 1, 2018

Thanks, I understand what you were saying now that I took a look. It should be fixed as you said! #173

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants