Use emulator runner 2.2.0

pull/696/head
Mattia Iavarone 6 years ago
parent 639857eda6
commit 990b6754e6
  1. 24
      .github/workflows/build.yml
  2. 4
      .github/workflows/emulator_script.sh
  3. 38
      cameraview/src/main/java/com/otaliastudios/cameraview/engine/Camera2Engine.java

@ -64,15 +64,31 @@ jobs:
with:
java-version: 1.8
- name: Execute emulator tests
timeout-minutes: 20
uses: reactivecircus/android-emulator-runner@v2.0.0
timeout-minutes: 16
uses: reactivecircus/android-emulator-runner@v2.2.0
with:
api-level: ${{ matrix.EMULATOR_API }}
arch: ${{ matrix.EMULATOR_ARCH }}
disable-animations: true
profile: Nexus 5X
emulator-options: -no-snapshot -no-window -no-boot-anim -camera-back emulated -camera-front emulated
script: ./.github/workflows/emulator_script.sh
emulator-options: -no-snapshot -no-window -no-boot-anim -camera-back emulated -camera-front emulated -gpu swiftshader_indirect
emulator-build: 6031357
script: |
# Core
ADB_TAGS="CameraView:I CameraCallbacks:I CameraOrchestrator:I CameraEngine:I"
ADB_TAGS="$ADB_TAGS CameraUtils:I WorkerHandler:I"
# Recorders
ADB_TAGS="$ADB_TAGS VideoRecorder:I FullVideoRecorder:I SnapshotVideoRecorder:I"
ADB_TAGS="$ADB_TAGS FullPictureRecorder:I SnapshotPictureRecorder:I DeviceEncoders:I"
# Video encoders
ADB_TAGS="$ADB_TAGS MediaEncoderEngine:I MediaEncoder:I AudioMediaEncoder:I VideoMediaEncoder:I TextureMediaEncoder:I"
# Debugging
ADB_TAGS="$ADB_TAGS CameraIntegrationTest:I MessageQueue:W MPEG4Writer:I"
echo "Logcat tags: $ADB_TAGS"
adb logcat -c
adb logcat $ADB_TAGS *:E -v color &
emulator -version
./gradlew cameraview:connectedCheck
- name: Upload emulator tests artifact
uses: actions/upload-artifact@v1
with:

@ -1,4 +0,0 @@
#!/usr/bin/env bash
adb logcat -c
adb logcat CameraOrchestrator:I CameraEngine:I CameraView:I CameraCallbacks:I CameraIntegrationTest:I MediaEncoderEngine:I MediaEncoder:I AudioMediaEncoder:I VideoMediaEncoder:I TextureMediaEncoder:I VideoRecorder:I FullVideoRecorder:I SnapshotVideoRecorder:I CameraUtils:I MessageQueue:W WorkerHandler:I DeviceEncoders:I MPEG4Writer:I FullPictureRecorder:I SnapshotPictureRecorder:I *:E -v color &
./gradlew cameraview:connectedCheck

@ -638,24 +638,26 @@ public class Camera2Engine extends CameraEngine implements ImageReader.OnImageAv
if (hasFrameProcessors()) {
getFrameManager().release();
}
try {
// Preferring this over stopRepeating() so we're sure that all in-flights operations
// are discarded as fast as possible, which is exactly what we want.
// NOTE: this call is asynchronous. Should find a good way to wait for the outcome.
LOG.i("onStopPreview:", "calling stopRepeating().");
// TODO HANGS (rare, emulator only)
mSession.stopRepeating();
LOG.i("onStopPreview:", "calling abortCaptures().");
mSession.abortCaptures();
LOG.i("onStopPreview:", "called abortCaptures().");
} catch (CameraAccessException e) {
// This tells us that we should stop everything. It's better to throw an unrecoverable
// exception rather than just swallow this, so everything gets stopped.
LOG.w("onStopPreview:", "abortCaptures failed!", e);
throw createCameraException(e);
} catch (IllegalStateException e) {
// This tells us that the session was already closed.
// Not sure if this can happen, but we can swallow it.
if (false) {
try {
// Preferring this over stopRepeating() so we're sure that all in-flights operations
// are discarded as fast as possible, which is exactly what we want.
// NOTE: this call is asynchronous. Should find a good way to wait for the outcome.
LOG.i("onStopPreview:", "calling stopRepeating().");
// TODO HANGS (rare, emulator only)
mSession.stopRepeating();
LOG.i("onStopPreview:", "calling abortCaptures().");
mSession.abortCaptures();
LOG.i("onStopPreview:", "called abortCaptures().");
} catch (CameraAccessException e) {
// This tells us that we should stop everything. It's better to throw an unrecoverable
// exception rather than just swallow this, so everything gets stopped.
LOG.w("onStopPreview:", "abortCaptures failed!", e);
throw createCameraException(e);
} catch (IllegalStateException e) {
// This tells us that the session was already closed.
// Not sure if this can happen, but we can swallow it.
}
}
removeRepeatingRequestBuilderSurfaces();
mLastRepeatingResult = null;

Loading…
Cancel
Save