diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/filter/MultiFilter.java b/cameraview/src/main/java/com/otaliastudios/cameraview/filter/MultiFilter.java index e660e55f..5742336c 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/filter/MultiFilter.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/filter/MultiFilter.java @@ -226,7 +226,7 @@ public class MultiFilter implements Filter, OneParameterFilter, TwoParameterFilt // Each filter outputs into its own framebuffer object, except the // last filter, which outputs into the default framebuffer. if (!isLast) { - GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, state.outputFramebuffer.getId()); + state.outputFramebuffer.bind(); GLES20.glClearColor(0, 0, 0, 0); } else { GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0); @@ -245,9 +245,10 @@ public class MultiFilter implements Filter, OneParameterFilter, TwoParameterFilt // It is the framebuffer texture from this cycle. If this is the last // filter, reset this value just to cleanup. if (!isLast) { - GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, state.outputTexture.getId()); + state.outputTexture.bind(); } else { GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0); + GLES20.glActiveTexture(GLES20.GL_TEXTURE0); } GLES20.glUseProgram(0); diff --git a/demo/src/main/java/com/otaliastudios/cameraview/demo/CameraActivity.java b/demo/src/main/java/com/otaliastudios/cameraview/demo/CameraActivity.java index 0364c87a..bf5a4c52 100644 --- a/demo/src/main/java/com/otaliastudios/cameraview/demo/CameraActivity.java +++ b/demo/src/main/java/com/otaliastudios/cameraview/demo/CameraActivity.java @@ -47,7 +47,7 @@ import java.util.List; public class CameraActivity extends AppCompatActivity implements View.OnClickListener, OptionView.Callback { private final static CameraLogger LOG = CameraLogger.create("DemoApp"); - private final static boolean USE_FRAME_PROCESSOR = false; + private final static boolean USE_FRAME_PROCESSOR = true; private final static boolean DECODE_BITMAP = false; private CameraView camera; @@ -372,13 +372,13 @@ public class CameraActivity extends AppCompatActivity implements View.OnClickLis message(filter.toString(), false); // Normal behavior: - // camera.setFilter(filter.newInstance()); + camera.setFilter(filter.newInstance()); // To test MultiFilter: - DuotoneFilter duotone = new DuotoneFilter(); - duotone.setFirstColor(Color.RED); - duotone.setSecondColor(Color.GREEN); - camera.setFilter(new MultiFilter(duotone, filter.newInstance())); + // DuotoneFilter duotone = new DuotoneFilter(); + // duotone.setFirstColor(Color.RED); + // duotone.setSecondColor(Color.GREEN); + // camera.setFilter(new MultiFilter(duotone, filter.newInstance())); } @Override