| | |
| | | package cn.com.basic.face.fragment; |
| | | |
| | | import android.graphics.ImageFormat; |
| | | import android.media.ImageReader; |
| | | import android.os.Build; |
| | | import android.os.Bundle; |
| | | import android.view.SurfaceView; |
| | | import android.view.View; |
| | |
| | | import cn.com.basic.face.base.BaseFragment; |
| | | |
| | | import cn.com.basic.face.base.MainActivity; |
| | | import cn.com.basic.face.service.DeviceMng; |
| | | import cn.com.basic.face.util.RtspFaceNative; |
| | | |
| | | import cn.com.basic.face.service.SurveillanceMng; |
| | |
| | | @ViewInject(R.id.fragment_surveillance_exit_timer) |
| | | private TextView fragment_surveillance_exit_timer; |
| | | |
| | | static boolean useNative = true; |
| | | static boolean useNative = false; |
| | | |
| | | 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 |
| | | // RtspFaceNative.setLocalIP("192.168.1.203"); |
| | | } |
| | | } |
| | | |
| | |
| | | public void run() { |
| | | RtspFaceNative.setSurface(1, fragment_supervisory_enter_camera.getHolder().getSurface()); |
| | | RtspFaceNative.setSurface(2, fragment_supervisory_exit_camera.getHolder().getSurface()); |
| | | RtspFaceNative.createPlayer(1, "rtsp://admin:admin12345@192.168.1.70:554/h264/ch1/sub/av_stream"); |
| | | RtspFaceNative.createPlayer(2, "rtsp://admin:a1234567@192.168.1.68:554/h264/ch1/sub/av_stream"); |
| | | RtspFaceNative.createPlayer(1, DeviceMng.getInstance().getCamera1Address()); |
| | | RtspFaceNative.createPlayer(2, DeviceMng.getInstance().getCamera2Address()); |
| | | RtspFaceNative.setFaceCallback(1, "cn/com/basic/face/util/RtspFaceNative", "faceCallBack"); |
| | | RtspFaceNative.setFaceCallback(2, "cn/com/basic/face/util/RtspFaceNative", "faceCallBack"); |
| | | } |
| | |
| | | } |
| | | }).start(); |
| | | reloadBottomList(); |
| | | new SurveillanceMng.SurveillanceListThread().start(); |
| | | } |
| | | |
| | | @OnClick(R.id.fragment_supervisory_bottom_visitor_radio_button) |