From 577be329fbe84596c55b5402a570e5eeaafac6e2 Mon Sep 17 00:00:00 2001 From: Jaeyong Han Date: Tue, 21 Mar 2017 11:43:44 +0900 Subject: [PATCH] change min sdk version --- gradle.properties | 2 +- .../sample/activity/ActivityCamera.java | 77 +++++++++---------- 2 files changed, 38 insertions(+), 41 deletions(-) diff --git a/gradle.properties b/gradle.properties index 737a43c85..4ad3e7d6b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ ARTIFACT_ID=gpuimage-library COMPILE_SDK_VERSION=23 BUILD_TOOLS_VERSION=23.0.2 TARGET_SDK_VERSION=23 -MIN_SDK_VERSION=18 +MIN_SDK_VERSION=16 POM_DESCRIPTION=Image filters for Android with OpenGL (based on GPUImage for iOS) POM_URL=https://github.com/cyberagent/android-gpuimage diff --git a/sample/src/jp/co/cyberagent/android/gpuimage/sample/activity/ActivityCamera.java b/sample/src/jp/co/cyberagent/android/gpuimage/sample/activity/ActivityCamera.java index 2cecad575..b0aa84a97 100644 --- a/sample/src/jp/co/cyberagent/android/gpuimage/sample/activity/ActivityCamera.java +++ b/sample/src/jp/co/cyberagent/android/gpuimage/sample/activity/ActivityCamera.java @@ -165,48 +165,46 @@ private void takePicture() { for (Camera.Size size : params.getSupportedPictureSizes()) { Log.i("ASDF", "Supported: " + size.width + "x" + size.height); } - mCamera.mCameraInstance.takePicture(null, null, - new Camera.PictureCallback() { + mCamera.mCameraInstance.takePicture(null, null, new Camera.PictureCallback() { - @Override - public void onPictureTaken(byte[] data, final Camera camera) { + @Override + public void onPictureTaken(byte[] data, final Camera camera) { - final File pictureFile = getOutputMediaFile(MEDIA_TYPE_IMAGE); - if (pictureFile == null) { - Log.d("ASDF", - "Error creating media file, check storage permissions"); - return; - } + final File pictureFile = getOutputMediaFile(MEDIA_TYPE_IMAGE); + if (pictureFile == null) { + Log.d("ASDF", + "Error creating media file, check storage permissions"); + return; + } - try { - FileOutputStream fos = new FileOutputStream(pictureFile); - fos.write(data); - fos.close(); - } catch (FileNotFoundException e) { - Log.d("ASDF", "File not found: " + e.getMessage()); - } catch (IOException e) { - Log.d("ASDF", "Error accessing file: " + e.getMessage()); - } + try { + FileOutputStream fos = new FileOutputStream(pictureFile); + fos.write(data); + fos.close(); + } catch (FileNotFoundException e) { + Log.d("ASDF", "File not found: " + e.getMessage()); + } catch (IOException e) { + Log.d("ASDF", "Error accessing file: " + e.getMessage()); + } - data = null; - Bitmap bitmap = BitmapFactory.decodeFile(pictureFile.getAbsolutePath()); - // mGPUImage.setImage(bitmap); - final GLTextureView view = (GLTextureView) findViewById(R.id.surfaceView); - view.setRenderMode(GLTextureView.RENDERMODE_WHEN_DIRTY); - mGPUImage.saveToPictures(bitmap, "GPUImage", - System.currentTimeMillis() + ".jpg", - new OnPictureSavedListener() { - - @Override - public void onPictureSaved(final Uri - uri) { - pictureFile.delete(); - camera.startPreview(); - view.setRenderMode(GLTextureView.RENDERMODE_CONTINUOUSLY); - } - }); - } - }); + data = null; + Bitmap bitmap = BitmapFactory.decodeFile(pictureFile.getAbsolutePath()); + // mGPUImage.setImage(bitmap); + final GLTextureView view = (GLTextureView) findViewById(R.id.surfaceView); + view.setRenderMode(GLTextureView.RENDERMODE_WHEN_DIRTY); + mGPUImage.saveToPictures(bitmap, "GPUImage", + System.currentTimeMillis() + ".jpg", + new OnPictureSavedListener() { + + @Override + public void onPictureSaved(final Uri uri) { + pictureFile.delete(); + camera.startPreview(); + view.setRenderMode(GLTextureView.RENDERMODE_CONTINUOUSLY); + } + }); + } + }); } public static final int MEDIA_TYPE_IMAGE = 1; @@ -246,8 +244,7 @@ private static File getOutputMediaFile(final int type) { } private void switchFilterTo(final GPUImageFilter filter) { - if (mFilter == null - || (filter != null && !mFilter.getClass().equals(filter.getClass()))) { + if (mFilter == null || (filter != null && !mFilter.getClass().equals(filter.getClass()))) { mFilter = filter; GPUImageFilterGroup filters = new GPUImageFilterGroup();