xuxiuxi
2017-07-21 1d67388595f3e843c12ee0cd2f74ba7a2ccc6fda
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/SurveillanceFragment.java
@@ -149,6 +149,7 @@
            }
//            outputStream.writeBytes("busybox ifconfig wlan0 hw ether  00:e0:2c:31:1a:ba\n");
            RtspFaceNative.setLocalIP(ipAddress);
            System.out.println("ipaddr="+ipAddress);
        }
    }
@@ -181,11 +182,11 @@
        }
        fragment_supervisory_enter_camera.getHolder().addCallback(new SurfaceHolder.Callback() {
            public void surfaceCreated(SurfaceHolder holder) {
                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");
                }
//                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 surfaceChanged(SurfaceHolder holder, int format, int width, int height) {}
@@ -195,14 +196,21 @@
        });
        fragment_supervisory_exit_camera.getHolder().addCallback(new SurfaceHolder.Callback() {
            public void surfaceCreated(SurfaceHolder holder) {
                if (useNative) {
                    RtspFaceNative.setSurface(Integer.parseInt(CommonVariables.Camera.OUT), fragment_supervisory_exit_camera.getHolder().getSurface());
                    RtspFaceNative.createPlayer(Integer.parseInt(CommonVariables.Camera.OUT), DeviceMng.getInstance().getCamera2Address());
                    RtspFaceNative.setFaceCallback(Integer.parseInt(CommonVariables.Camera.OUT), "cn/com/basic/face/util/RtspFaceNative", "faceCallBack");
                }
//                if (useNative) {
//                    RtspFaceNative.setSurface(Integer.parseInt(CommonVariables.Camera.OUT), fragment_supervisory_exit_camera.getHolder().getSurface());
//                    RtspFaceNative.createPlayer(Integer.parseInt(CommonVariables.Camera.OUT), DeviceMng.getInstance().getCamera2Address());
//                    RtspFaceNative.setFaceCallback(Integer.parseInt(CommonVariables.Camera.OUT), "cn/com/basic/face/util/RtspFaceNative", "faceCallBack");
//                }
            }
            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");
            }