| | |
| | | package cn.com.basic.face.fragment; |
| | | |
| | | import android.os.Build; |
| | | import android.os.Bundle; |
| | | import android.view.SurfaceView; |
| | | import android.view.View; |
| | |
| | | |
| | | static boolean useNative = true; |
| | | |
| | | public static boolean isEmulator() { |
| | | return Build.FINGERPRINT.startsWith("generic") |
| | | || Build.FINGERPRINT.startsWith("unknown") |
| | | || Build.MODEL.contains("google_sdk") |
| | | || Build.MODEL.contains("Emulator") |
| | | || Build.MODEL.contains("Android SDK built for x86") |
| | | || Build.MANUFACTURER.contains("Genymotion") |
| | | || (Build.BRAND.startsWith("generic") && Build.DEVICE.startsWith("generic")) |
| | | || "google_sdk".equals(Build.PRODUCT); |
| | | } |
| | | |
| | | static { |
| | | if (isEmulator()) { |
| | | useNative = false; |
| | | } else { |
| | | useNative = true; |
| | | } |
| | | if (useNative) { |
| | | System.loadLibrary("cvface_api"); |
| | | System.loadLibrary("opencv_java3"); |
| | |
| | | System.loadLibrary("protoc"); |
| | | System.loadLibrary("rtspface"); |
| | | RtspFaceNative.init(); |
| | | RtspFaceNative.setLocalIP("192.168.1.10"); |
| | | // RtspFaceNative.setLocalIP("192.168.1.10"); |
| | | RtspFaceNative.setLocalIP("192.168.1.106");//自己手机ip |
| | | } |
| | | } |
| | | |