From: thermatk Date: Fri, 22 Jun 2018 17:04:43 +0200 Subject: kill Vision --- .../org/chromium/shape_detection/BarcodeDetectionImpl.java | 6 +++--- .../java/src/org/chromium/shape_detection/BitmapUtils.java | 12 ------------ .../chromium/shape_detection/FaceDetectionImplGmsCore.java | 6 +++--- .../chromium/shape_detection/FaceDetectionProviderImpl.java | 2 +- .../src/org/chromium/shape_detection/InterfaceRegistrar.java | 10 +++++----- .../src/org/chromium/shape_detection/TextDetectionImpl.java | 6 +++--- 6 files changed, 15 insertions(+), 27 deletions(-) diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/BarcodeDetectionImpl.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/BarcodeDetectionImpl.java --- a/services/shape_detection/android/java/src/org/chromium/shape_detection/BarcodeDetectionImpl.java +++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/BarcodeDetectionImpl.java @@ -43,11 +43,11 @@ public class BarcodeDetectionImpl implements BarcodeDetection { // on the device; this happens "fast", but it might have not completed, // bail in this case. Also, the API was disabled between and v.9.0 and // v.9.2, see https://developers.google.com/android/guides/releases. - if (!mBarcodeDetector.isOperational()) { +// if (!mBarcodeDetector.isOperational()) { Log.e(TAG, "BarcodeDetector is not operational"); callback.call(new BarcodeDetectionResult[0]); return; - } +/* } Frame frame = BitmapUtils.convertToFrame(bitmapData); if (frame == null) { @@ -77,7 +77,7 @@ public class BarcodeDetectionImpl implements BarcodeDetection { barcodeArray[i].cornerPoints[j].y = corners[j].y; } } - callback.call(barcodeArray); + callback.call(barcodeArray);*/ } @Override diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/BitmapUtils.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/BitmapUtils.java --- a/services/shape_detection/android/java/src/org/chromium/shape_detection/BitmapUtils.java +++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/BitmapUtils.java @@ -6,8 +6,6 @@ package org.chromium.shape_detection; import android.graphics.Bitmap; -import com.google.android.gms.vision.Frame; - import org.chromium.mojo_base.BigBufferUtil; import org.chromium.skia.mojom.ColorType; @@ -44,14 +42,4 @@ public class BitmapUtils { return bitmap; } - - public static Frame convertToFrame(org.chromium.skia.mojom.Bitmap bitmapData) { - Bitmap bitmap = convertToBitmap(bitmapData); - if (bitmap == null) { - return null; - } - - // This constructor implies a pixel format conversion to YUV. - return new Frame.Builder().setBitmap(bitmap).build(); - } } diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionImplGmsCore.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionImplGmsCore.java --- a/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionImplGmsCore.java +++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionImplGmsCore.java @@ -63,7 +63,7 @@ public class FaceDetectionImplGmsCore implements FaceDetection { // The vision library will be downloaded the first time the API is used // on the device; this happens "fast", but it might have not completed, // bail in this case. - if (!mFaceDetector.isOperational()) { +// if (!mFaceDetector.isOperational()) { Log.e(TAG, "FaceDetector is not operational"); // Fallback to Android's FaceDetectionImpl. @@ -73,7 +73,7 @@ public class FaceDetectionImplGmsCore implements FaceDetection { FaceDetectionImpl detector = new FaceDetectionImpl(options); detector.detect(bitmapData, callback); return; - } +/* } Frame frame = BitmapUtils.convertToFrame(bitmapData); if (frame == null) { @@ -157,7 +157,7 @@ public class FaceDetectionImplGmsCore implements FaceDetection { faceArray[i].boundingBox.height = face.getHeight(); } } - callback.call(faceArray); + callback.call(faceArray);*/ } @Override diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java --- a/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java +++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java @@ -30,7 +30,7 @@ public class FaceDetectionProviderImpl implements FaceDetectionProvider { == ConnectionResult.SUCCESS; if (isGmsCoreSupported) { - FaceDetection.MANAGER.bind(new FaceDetectionImplGmsCore(options), request); + //FaceDetection.MANAGER.bind(new FaceDetectionImplGmsCore(options), request); } else { FaceDetection.MANAGER.bind(new FaceDetectionImpl(options), request); } diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java --- a/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java +++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java @@ -20,10 +20,10 @@ class InterfaceRegistrar { // is not necessary to hold on to a reference to it explicitly. InterfaceRegistry registry = InterfaceRegistry.create( CoreImpl.getInstance().acquireNativeHandle(nativeHandle).toMessagePipeHandle()); - registry.addInterface( - BarcodeDetectionProvider.MANAGER, new BarcodeDetectionProviderImpl.Factory()); - registry.addInterface( - FaceDetectionProvider.MANAGER, new FaceDetectionProviderImpl.Factory()); - registry.addInterface(TextDetection.MANAGER, new TextDetectionImpl.Factory()); +// registry.addInterface( +// BarcodeDetectionProvider.MANAGER, new BarcodeDetectionProviderImpl.Factory()); +// registry.addInterface( +// FaceDetectionProvider.MANAGER, new FaceDetectionProviderImpl.Factory()); +// registry.addInterface(TextDetection.MANAGER, new TextDetectionImpl.Factory()); } } diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/TextDetectionImpl.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/TextDetectionImpl.java --- a/services/shape_detection/android/java/src/org/chromium/shape_detection/TextDetectionImpl.java +++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/TextDetectionImpl.java @@ -42,11 +42,11 @@ public class TextDetectionImpl implements TextDetection { // on the device; this happens "fast", but it might have not completed, // bail in this case. Also, the API was disabled between and v.9.0 and // v.9.2, see https://developers.google.com/android/guides/releases. - if (!mTextRecognizer.isOperational()) { +// if (!mTextRecognizer.isOperational()) { Log.e(TAG, "TextDetector is not operational"); callback.call(new TextDetectionResult[0]); return; - } +/* } Frame frame = BitmapUtils.convertToFrame(bitmapData); if (frame == null) { @@ -76,7 +76,7 @@ public class TextDetectionImpl implements TextDetection { detectedTextArray[i].cornerPoints[j].y = corners[j].y; } } - callback.call(detectedTextArray); + callback.call(detectedTextArray); */ } @Override -- 2.7.4