pull/696/head
Mattia Iavarone 6 years ago
parent 430d89bdde
commit 42c0a20060
  1. 2
      cameraview/src/androidTest/java/com/otaliastudios/cameraview/tools/RecoverCameraRule.java
  2. 2
      cameraview/src/main/java/com/otaliastudios/cameraview/engine/Camera1Engine.java
  3. 6
      cameraview/src/main/java/com/otaliastudios/cameraview/engine/CameraEngine.java
  4. 2
      cameraview/src/main/java/com/otaliastudios/cameraview/video/VideoRecorder.java

@ -45,6 +45,8 @@ public class RecoverCameraRule implements TestRule {
mCallback.getLogger().e("**************************************");
mCallback.getCamera().destroy();
base.evaluate();
} else {
throw throwable;
}
}
}

@ -312,6 +312,7 @@ public class Camera1Engine extends CameraEngine implements
@EngineThread
@Override
protected void onTakePicture(@NonNull PictureResult.Stub stub, boolean doMetering) {
LOG.i("onTakePicture:", "executing.");
stub.rotation = getAngles().offset(Reference.SENSOR, Reference.OUTPUT,
Axis.RELATIVE_TO_SENSOR);
stub.size = getPictureSize(Reference.OUTPUT);
@ -324,6 +325,7 @@ public class Camera1Engine extends CameraEngine implements
protected void onTakePictureSnapshot(@NonNull PictureResult.Stub stub,
@NonNull AspectRatio outputRatio,
boolean doMetering) {
LOG.i("onTakePictureSnapshot:", "executing.");
// Not the real size: it will be cropped to match the view ratio
stub.size = getUncroppedSnapshotSize(Reference.OUTPUT);
// Actually it will be rotated and set to 0.

@ -340,7 +340,7 @@ public abstract class CameraEngine implements
// Cannot use Tasks.await() because we might be on the UI thread.
final CountDownLatch latch = new CountDownLatch(1);
stop(true).addOnCompleteListener(
WorkerHandler.get().getExecutor(),
mHandler.getExecutor(),
new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
@ -348,9 +348,9 @@ public abstract class CameraEngine implements
}
});
try {
boolean success = latch.await(3, TimeUnit.SECONDS);
boolean success = latch.await(6, TimeUnit.SECONDS);
if (!success) {
LOG.e("Probably some deadlock in destroy.",
LOG.e("DESTROY: Could not destroy synchronously after 6 seconds.",
"Current thread:", Thread.currentThread(),
"Handler thread: ", mHandler.getThread());
}

@ -155,6 +155,7 @@ public abstract class VideoRecorder {
@SuppressWarnings("WeakerAccess")
@CallSuper
protected void dispatchVideoRecordingStart() {
LOG.i("dispatchVideoRecordingStart:", "About to dispatch.");
if (mListener != null) {
mListener.onVideoRecordingStart();
}
@ -167,6 +168,7 @@ public abstract class VideoRecorder {
@SuppressWarnings("WeakerAccess")
@CallSuper
protected void dispatchVideoRecordingEnd() {
LOG.i("dispatchVideoRecordingEnd:", "About to dispatch.");
if (mListener != null) {
mListener.onVideoRecordingEnd();
}

Loading…
Cancel
Save