mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 874546 - Detach the preview when the Camera surface is destroyed. r=blassey
This commit is contained in:
parent
f5826d6b94
commit
c646b21629
@ -214,8 +214,7 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback {
|
||||
return res;
|
||||
}
|
||||
|
||||
public int StopCapture() {
|
||||
Log.d(TAG, "StopCapture");
|
||||
public int DetachCamera() {
|
||||
try {
|
||||
previewBufferLock.lock();
|
||||
isCaptureRunning = false;
|
||||
@ -224,14 +223,18 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback {
|
||||
camera.setPreviewCallbackWithBuffer(null);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
Log.e(TAG, "Failed to stop camera");
|
||||
Log.e(TAG, "Failed to stop camera: " + ex.getMessage());
|
||||
return -1;
|
||||
}
|
||||
|
||||
isCaptureStarted = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int StopCapture() {
|
||||
Log.d(TAG, "StopCapture");
|
||||
isCaptureStarted = false;
|
||||
return DetachCamera();
|
||||
}
|
||||
|
||||
native void ProvideCameraFrame(byte[] data, int length, long captureObject);
|
||||
|
||||
public void onPreviewFrame(byte[] data, Camera camera) {
|
||||
@ -314,5 +317,6 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback {
|
||||
public void surfaceDestroyed(SurfaceHolder holder) {
|
||||
Log.d(TAG, "VideoCaptureAndroid::surfaceDestroyed");
|
||||
isSurfaceReady = false;
|
||||
DetachCamera();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user