parent
15f73b1c82
commit
5d9f429b8a
@ -0,0 +1,29 @@ |
||||
package com.otaliastudios.cameraview.internal; |
||||
|
||||
import android.graphics.SurfaceTexture; |
||||
|
||||
import androidx.annotation.NonNull; |
||||
|
||||
import com.otaliastudios.cameraview.size.Size; |
||||
|
||||
/** |
||||
* Fixes an issue for some devices with snapshot picture and video recording. |
||||
* This is so dirty and totally unclear that I wanted to have a separate class. |
||||
*/ |
||||
public class Issue514Workaround { |
||||
|
||||
private final SurfaceTexture surfaceTexture; |
||||
|
||||
public Issue514Workaround(int cameraTextureId, @NonNull Size size) { |
||||
surfaceTexture = new SurfaceTexture(cameraTextureId); |
||||
surfaceTexture.setDefaultBufferSize(size.getWidth(), size.getHeight()); |
||||
} |
||||
|
||||
public void onStart() { |
||||
surfaceTexture.updateTexImage(); |
||||
} |
||||
|
||||
public void onEnd() { |
||||
surfaceTexture.release(); |
||||
} |
||||
} |
Loading…
Reference in new issue