xuxiuxi
2017-07-25 d343b71cd89f59a87e85c46ce7a04d47c357462d
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/SurveillanceFragment.java
@@ -28,6 +28,7 @@
import cn.com.basic.face.util.RtspFaceNative;
import cn.com.basic.face.service.SurveillanceMng;
import cn.com.basic.face.util.SurveillancePhotoEmulateThread;
import cn.com.basic.face.widget.surveilance.SurveillanceBottomAttendanceListView;
import cn.com.basic.face.widget.surveilance.SurveillanceBottomVisitorListView;
@@ -97,6 +98,9 @@
            useNative = false;
        }
        //useNative = false;
        if (CommonVariables.EMULATOR) {
            useNative = false;
        }
        if (useNative) {
            System.loadLibrary("cvface_api");
            System.loadLibrary("opencv_java3");
@@ -145,7 +149,12 @@
                e.printStackTrace();
            }
//            outputStream.writeBytes("busybox ifconfig wlan0 hw ether  00:e0:2c:31:1a:ba\n");
            /*
sysctl kernel.sched_is_big_little=1
sysctl  net.core.rmem_max=40000000
             */
            RtspFaceNative.setLocalIP(ipAddress);
            System.out.println("ipaddr="+ipAddress);
        }
    }
@@ -178,6 +187,7 @@
        }
        fragment_supervisory_enter_camera.getHolder().addCallback(new SurfaceHolder.Callback() {
            public void surfaceCreated(SurfaceHolder holder) {
                new SurveillancePhotoEmulateThread().start();
                if (useNative) {
                    RtspFaceNative.setSurface(Integer.parseInt(CommonVariables.Camera.IN), fragment_supervisory_enter_camera.getHolder().getSurface());
                    RtspFaceNative.createPlayer(Integer.parseInt(CommonVariables.Camera.IN), DeviceMng.getInstance().getCamera1Address());
@@ -199,7 +209,14 @@
                }
            }
            public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {}
            public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
                System.out.print("width="+width+",height="+height);
//                if (useNative) {
//                    RtspFaceNative.setSurface(Integer.parseInt(CommonVariables.Camera.IN), fragment_supervisory_enter_camera.getHolder().getSurface());
//                    RtspFaceNative.createPlayer(Integer.parseInt(CommonVariables.Camera.IN), DeviceMng.getInstance().getCamera1Address());
//                    RtspFaceNative.setFaceCallback(Integer.parseInt(CommonVariables.Camera.IN), "cn/com/basic/face/util/RtspFaceNative", "faceCallBack");
//                }
            }
            public void surfaceDestroyed(SurfaceHolder holder) {
                System.out.println("surfaceDestroyed");
            }