fix: Fix VideoPipeline crash because ProGuard removed mHybridData (#2169)

This commit is contained in:
Marc Rousavy 2023-11-17 14:46:17 +01:00 committed by GitHub
parent 1055430cbb
commit c9dbd412be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -8,7 +8,9 @@ import android.media.ImageWriter
import android.os.Build import android.os.Build
import android.util.Log import android.util.Log
import android.view.Surface import android.view.Surface
import androidx.annotation.Keep
import com.facebook.jni.HybridData import com.facebook.jni.HybridData
import com.facebook.proguard.annotations.DoNotStrip
import com.mrousavy.camera.frameprocessor.Frame import com.mrousavy.camera.frameprocessor.Frame
import com.mrousavy.camera.frameprocessor.FrameProcessor import com.mrousavy.camera.frameprocessor.FrameProcessor
import com.mrousavy.camera.types.Orientation import com.mrousavy.camera.types.Orientation
@ -51,6 +53,8 @@ class VideoPipeline(
} }
} }
@DoNotStrip
@Keep
private val mHybridData: HybridData private val mHybridData: HybridData
private var openGLTextureId: Int? = null private var openGLTextureId: Int? = null
private var transformMatrix = FloatArray(16) private var transformMatrix = FloatArray(16)

View File

@ -1,5 +1,6 @@
package com.mrousavy.camera.frameprocessor; package com.mrousavy.camera.frameprocessor;
import androidx.annotation.Keep;
import com.facebook.jni.HybridData; import com.facebook.jni.HybridData;
import com.facebook.proguard.annotations.DoNotStrip; import com.facebook.proguard.annotations.DoNotStrip;
import com.mrousavy.camera.core.CameraQueues; import com.mrousavy.camera.core.CameraQueues;
@ -8,6 +9,7 @@ import com.mrousavy.camera.core.CameraQueues;
public class VisionCameraScheduler { public class VisionCameraScheduler {
@SuppressWarnings({"unused", "FieldCanBeLocal"}) @SuppressWarnings({"unused", "FieldCanBeLocal"})
@DoNotStrip @DoNotStrip
@Keep
private final HybridData mHybridData; private final HybridData mHybridData;
public VisionCameraScheduler() { public VisionCameraScheduler() {