fix: Fix crash when accessing planesCount
or bytesPerRow
(#380)
* fix: Fix `bytesPerRow` and `planeCount` crashing * use direct call * Call `getPlanesCount` and `getBytesPerRow` through java * revert camerapage changes * remove removed header import * Update CameraPage.tsx
This commit is contained in:
@@ -7,6 +7,7 @@ import androidx.annotation.Keep;
|
||||
import androidx.camera.core.ImageProxy;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
|
||||
@SuppressWarnings("unused") // used through JNI
|
||||
@DoNotStrip
|
||||
@Keep
|
||||
public class ImageProxyUtils {
|
||||
@@ -26,4 +27,16 @@ public class ImageProxyUtils {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@DoNotStrip
|
||||
@Keep
|
||||
public static int getPlanesCount(ImageProxy imageProxy) {
|
||||
return imageProxy.getPlanes().length;
|
||||
}
|
||||
|
||||
@DoNotStrip
|
||||
@Keep
|
||||
public static int getBytesPerRow(ImageProxy imageProxy) {
|
||||
return imageProxy.getPlanes()[0].getRowStride();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user