Created
October 31, 2014 10:28
-
-
Save chico/7b374a28691de4a1f957 to your computer and use it in GitHub Desktop.
GPUImage.saveToPictures blocks UI with preview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in onCreate() | |
glSurfaceView = (GLSurfaceView) findViewById(R.id.surfaceView); | |
mGPUImage = new GPUImage(this); | |
mGPUImage.setGLSurfaceView(glSurfaceView); | |
// on user button click | |
mCamera.mCameraInstance.takePicture(null, null, new Camera.PictureCallback() { | |
@Override | |
public void onPictureTaken(byte[] data, final Camera camera) { | |
camera.startPreview(); | |
Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length); | |
// GPUImage.saveToPictures blocks UI and view goes black for up to 5 seconds when saving high resolution picture | |
mGPUImage.saveToPictures(bitmap, "GPUImage", null); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment