xuxiuxi
2017-07-22 d999731ac1ba495dbfea06cbb14dcfd3a53bcd64
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;
@@ -182,11 +183,12 @@
        }
        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");
//                }
                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());
                    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) {}
@@ -196,20 +198,20 @@
        });
        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) {
                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");
                }
//                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");