Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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