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

fixes #24 #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fixes #24 #56

wants to merge 1 commit into from

Conversation

d3orn
Copy link

@d3orn d3orn commented Aug 23, 2016

This should fix the freezing cameraPreview (fixes #24) if the app is put to sleep with the power button and is woken up later.

The static sSurfaceHolder stores the surfaceHolder and onResume() checks if it is still set. There are two cases:

  1. If the app is put into background the surfaceHolder gets destroyed correctly (see surfaceDestroyed()) and the static variable is set to null.
  2. If the power button is pressed surfaceDestroyed() callback is never called because the surface is not destroyed.

In case number 1 we do not have to do anything because our app just goes trough the inital setup with the help of the Surface Callback
In case number 2 we still have the surface but we released() everything else, therefore we have to setup() all the other things after opening the camera (EGL, mCameraTexture, mEncoderSurface, mCircEncoder...)

This works for me and I hope it will work for others as well.

I could not really test it because I cannot build this directory but I used this exact solution in my own app which is built on grafika/Continuous Capture for your changes. Lines starting

… with the power button and is woken up later.

The static sSurfaceHolder stores the surfaceHolder and onResume() checks if it is still set. There are two cases:
1. If the app is put into background the surfaceHolder gets destroyed correctly (see surfaceDestroyed()) and the static variable is set to null.
2. If the power button is pressed surfaceDestroyed() callback is never called because the surface is not destroyed.

In case number 1 we do not have to do anything because our app just goes trough the inital setup with the help of the Surface Callback
In case number 2 we still have the surface but we released() everything else, therefore we have to setup() all the other things after opening the camera (EGL, mCameraTexture, mEncoderSurface, mCircEncoder...)

This works for me and I hope it will work for others as well.

I could not really test it because I cannot build this directory but I used this exact solution in my own app which is built on grafika/Continuous Capture for your changes. Lines starting
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@d3orn
Copy link
Author

d3orn commented Aug 23, 2016

I signed it!

On Tue, Aug 23, 2016 at 3:05 PM googlebot [email protected] wrote:

Thanks for your pull request. It looks like this may be your first
contribution to a Google open source project. Before we can look at your
pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/
https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll

verify. Thanks.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#56 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAZHVxXov6ipsQ--CqqGt_iymJl9zDTsks5qivA2gaJpZM4Jq5p6
.

@googlebot
Copy link

CLAs look good, thanks!

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

Successfully merging this pull request may close these issues.

"Continuous Capture" Activity mishandles unblank
2 participants