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: with:
java-version: 1.8 java-version: 1.8
- name: Execute emulator tests - name: Execute emulator tests
timeout-minutes: 20 timeout-minutes: 16
uses: reactivecircus/android-emulator-runner@v2.0.0 uses: reactivecircus/android-emulator-runner@v2.2.0
with: with:
api-level: ${{ matrix.EMULATOR_API }} api-level: ${{ matrix.EMULATOR_API }}
arch: ${{ matrix.EMULATOR_ARCH }} arch: ${{ matrix.EMULATOR_ARCH }}
disable-animations: true disable-animations: true
profile: Nexus 5X profile: Nexus 5X
emulator-options: -no-snapshot -no-window -no-boot-anim -camera-back emulated -camera-front emulated emulator-options: -no-snapshot -no-window -no-boot-anim -camera-back emulated -camera-front emulated -gpu swiftshader_indirect
script: ./.github/workflows/emulator_script.sh 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 - name: Upload emulator tests artifact
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v1
with: 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()) { if (hasFrameProcessors()) {
getFrameManager().release(); getFrameManager().release();
} }
try { if (false) {
// Preferring this over stopRepeating() so we're sure that all in-flights operations try {
// are discarded as fast as possible, which is exactly what we want. // Preferring this over stopRepeating() so we're sure that all in-flights operations
// NOTE: this call is asynchronous. Should find a good way to wait for the outcome. // are discarded as fast as possible, which is exactly what we want.
LOG.i("onStopPreview:", "calling stopRepeating()."); // NOTE: this call is asynchronous. Should find a good way to wait for the outcome.
// TODO HANGS (rare, emulator only) LOG.i("onStopPreview:", "calling stopRepeating().");
mSession.stopRepeating(); // TODO HANGS (rare, emulator only)
LOG.i("onStopPreview:", "calling abortCaptures()."); mSession.stopRepeating();
mSession.abortCaptures(); LOG.i("onStopPreview:", "calling abortCaptures().");
LOG.i("onStopPreview:", "called abortCaptures()."); mSession.abortCaptures();
} catch (CameraAccessException e) { LOG.i("onStopPreview:", "called abortCaptures().");
// This tells us that we should stop everything. It's better to throw an unrecoverable } catch (CameraAccessException e) {
// exception rather than just swallow this, so everything gets stopped. // This tells us that we should stop everything. It's better to throw an unrecoverable
LOG.w("onStopPreview:", "abortCaptures failed!", e); // exception rather than just swallow this, so everything gets stopped.
throw createCameraException(e); LOG.w("onStopPreview:", "abortCaptures failed!", e);
} catch (IllegalStateException e) { throw createCameraException(e);
// This tells us that the session was already closed. } catch (IllegalStateException e) {
// Not sure if this can happen, but we can swallow it. // This tells us that the session was already closed.
// Not sure if this can happen, but we can swallow it.
}
} }
removeRepeatingRequestBuilderSurfaces(); removeRepeatingRequestBuilderSurfaces();
mLastRepeatingResult = null; mLastRepeatingResult = null;

Loading…
Cancel
Save