| | |
| | | import cn.com.basic.face.base.MainActivity; |
| | | import cn.com.basic.face.discern.common.CommonVariables; |
| | | import cn.com.basic.face.service.DeviceMng; |
| | | import cn.com.basic.face.thread.StartCameraThread; |
| | | import cn.com.basic.face.util.RtspFaceNative; |
| | | |
| | | import cn.com.basic.face.service.SurveillanceMng; |
| | |
| | | @ViewInject(R.id.fragment_surveillance_bottom_linear_layout) |
| | | private LinearLayout fragment_surveillance_bottom_linear_layout; |
| | | |
| | | StartCameraThread startEnterCameraThread = null; |
| | | StartCameraThread startExitCameraThread = null; |
| | | |
| | | static boolean useNative = false; |
| | | |
| | |
| | | if (CommonVariables.FACE_SERVER) { |
| | | fragment_supervisory_enter_camera_relative_layout.addView(MainActivity.getInstance().mPreview); |
| | | fragment_supervisory_enter_camera_relative_layout.addView(MainActivity.getInstance().mDraw); |
| | | //fragment_supervisory_exit_camera_relative_layout.setVisibility(View.GONE); |
| | | //fragment_surveillance_bottom_linear_layout.setVisibility(View.GONE); |
| | | } |
| | | 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()); |
| | | RtspFaceNative.setFaceCallback(Integer.parseInt(CommonVariables.Camera.IN), "cn/com/basic/face/util/RtspFaceNative", "faceCallBack"); |
| | | synchronized (MainActivity.getInstance()) { |
| | | startEnterCameraThread = new StartCameraThread(Integer.parseInt(CommonVariables.Camera.IN), fragment_supervisory_enter_camera.getHolder().getSurface()); |
| | | startEnterCameraThread.start(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {} |
| | | public void surfaceDestroyed(SurfaceHolder holder) { |
| | | System.out.println("surfaceDestroyed"); |
| | | } |
| | | public void surfaceDestroyed(SurfaceHolder holder) { } |
| | | }); |
| | | 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"); |
| | | synchronized (MainActivity.getInstance()) { |
| | | startEnterCameraThread = new StartCameraThread(Integer.parseInt(CommonVariables.Camera.OUT), fragment_supervisory_exit_camera.getHolder().getSurface()); |
| | | startEnterCameraThread.start(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | 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"); |
| | | } |
| | | public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { } |
| | | public void surfaceDestroyed(SurfaceHolder holder) { } |
| | | }); |
| | | new SurveillanceMng.SurveillanceListThread().start(); |
| | | } |