|
|
@ -2,9 +2,6 @@ package com.otaliastudios.cameraview.picture; |
|
|
|
|
|
|
|
|
|
|
|
import android.annotation.TargetApi; |
|
|
|
import android.annotation.TargetApi; |
|
|
|
import android.graphics.Bitmap; |
|
|
|
import android.graphics.Bitmap; |
|
|
|
import android.graphics.Canvas; |
|
|
|
|
|
|
|
import android.graphics.Color; |
|
|
|
|
|
|
|
import android.graphics.PorterDuff; |
|
|
|
|
|
|
|
import android.graphics.Rect; |
|
|
|
import android.graphics.Rect; |
|
|
|
import android.graphics.SurfaceTexture; |
|
|
|
import android.graphics.SurfaceTexture; |
|
|
|
import android.opengl.EGL14; |
|
|
|
import android.opengl.EGL14; |
|
|
@ -14,7 +11,6 @@ import android.os.Build; |
|
|
|
|
|
|
|
|
|
|
|
import com.otaliastudios.cameraview.CameraLogger; |
|
|
|
import com.otaliastudios.cameraview.CameraLogger; |
|
|
|
import com.otaliastudios.cameraview.PictureResult; |
|
|
|
import com.otaliastudios.cameraview.PictureResult; |
|
|
|
import com.otaliastudios.cameraview.internal.Issue514Workaround; |
|
|
|
|
|
|
|
import com.otaliastudios.cameraview.internal.egl.EglBaseSurface; |
|
|
|
import com.otaliastudios.cameraview.internal.egl.EglBaseSurface; |
|
|
|
import com.otaliastudios.cameraview.overlay.Overlay; |
|
|
|
import com.otaliastudios.cameraview.overlay.Overlay; |
|
|
|
import com.otaliastudios.cameraview.controls.Facing; |
|
|
|
import com.otaliastudios.cameraview.controls.Facing; |
|
|
@ -105,6 +101,12 @@ public class SnapshotGlPictureRecorder extends PictureRecorder { |
|
|
|
mPreview.removeRendererFrameCallback(this); |
|
|
|
mPreview.removeRendererFrameCallback(this); |
|
|
|
SnapshotGlPictureRecorder.this.onRendererFrame(surfaceTexture, scaleX, scaleY, shaderEffect); |
|
|
|
SnapshotGlPictureRecorder.this.onRendererFrame(surfaceTexture, scaleX, scaleY, shaderEffect); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void |
|
|
|
|
|
|
|
onFilterChanged(@NonNull Filter filter) { |
|
|
|
|
|
|
|
mViewport.changeShaderFilter(filter); |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -150,7 +152,6 @@ public class SnapshotGlPictureRecorder extends PictureRecorder { |
|
|
|
@RendererThread |
|
|
|
@RendererThread |
|
|
|
@TargetApi(Build.VERSION_CODES.KITKAT) |
|
|
|
@TargetApi(Build.VERSION_CODES.KITKAT) |
|
|
|
private void onRendererFrame(final @NonNull SurfaceTexture surfaceTexture, final float scaleX, final float scaleY, @NonNull Filter filter) { |
|
|
|
private void onRendererFrame(final @NonNull SurfaceTexture surfaceTexture, final float scaleX, final float scaleY, @NonNull Filter filter) { |
|
|
|
mViewport.changeShaderEffect(filter); |
|
|
|
|
|
|
|
// Get egl context from the RendererThread, which is the one in which we have created
|
|
|
|
// Get egl context from the RendererThread, which is the one in which we have created
|
|
|
|
// the textureId and the overlayTextureId, managed by the GlSurfaceView.
|
|
|
|
// the textureId and the overlayTextureId, managed by the GlSurfaceView.
|
|
|
|
// Next operations can then be performed on different threads using this handle.
|
|
|
|
// Next operations can then be performed on different threads using this handle.
|
|
|
|