| | |
| | | import android.os.Build; |
| | | import android.os.Bundle; |
| | | import android.text.format.Formatter; |
| | | import android.view.SurfaceHolder; |
| | | import android.view.SurfaceView; |
| | | import android.view.View; |
| | | import android.widget.ProgressBar; |
| | | import android.widget.RadioButton; |
| | | import android.widget.RadioGroup; |
| | | import android.widget.TextView; |
| | |
| | | import cn.com.basic.face.base.BaseFragment; |
| | | |
| | | 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.util.RtspFaceNative; |
| | | |
| | |
| | | @ViewInject(R.id.fragment_supervisory_bottom_attendance_list_view) |
| | | private SurveillanceBottomAttendanceListView fragment_supervisory_bottom_attendance_list_view; |
| | | @ViewInject(R.id.fragment_supervisory_enter_camera) |
| | | SurfaceView fragment_supervisory_enter_camera; |
| | | private SurfaceView fragment_supervisory_enter_camera; |
| | | @ViewInject(R.id.fragment_supervisory_exit_camera) |
| | | SurfaceView fragment_supervisory_exit_camera; |
| | | private SurfaceView fragment_supervisory_exit_camera; |
| | | @ViewInject(R.id.fragment_surveillance_enter_timer) |
| | | private TextView fragment_surveillance_enter_timer; |
| | | @ViewInject(R.id.fragment_surveillance_exit_timer) |
| | | private TextView fragment_surveillance_exit_timer; |
| | | @ViewInject(R.id.fragment_supervisory_enter_progress_bar) |
| | | private ProgressBar fragment_supervisory_enter_progress_bar; |
| | | @ViewInject(R.id.fragment_supervisory_exit_progress_bar) |
| | | private ProgressBar fragment_supervisory_exit_progress_bar; |
| | | |
| | | static boolean useNative = false; |
| | | |
| | |
| | | |
| | | @Override |
| | | protected void initViews(View view, Bundle savedInstanceState) { |
| | | fragment_supervisory_enter_camera.getHolder().addCallback(new SurfaceHolder.Callback() { |
| | | @Override |
| | | public void surfaceCreated(SurfaceHolder holder) { |
| | | fragment_supervisory_enter_progress_bar.setVisibility(View.INVISIBLE); |
| | | 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"); |
| | | } |
| | | |
| | | @Override |
| | | public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void surfaceDestroyed(SurfaceHolder holder) { |
| | | //fragment_supervisory_enter_progress_bar.setVisibility(View.VISIBLE); |
| | | } |
| | | }); |
| | | fragment_supervisory_exit_camera.getHolder().addCallback(new SurfaceHolder.Callback() { |
| | | @Override |
| | | public void surfaceCreated(SurfaceHolder holder) { |
| | | fragment_supervisory_exit_progress_bar.setVisibility(View.INVISIBLE); |
| | | 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"); |
| | | } |
| | | |
| | | @Override |
| | | public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void surfaceDestroyed(SurfaceHolder holder) { |
| | | //fragment_supervisory_exit_progress_bar.setVisibility(View.VISIBLE); |
| | | } |
| | | }); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | RtspFaceNative.setSurface(1, fragment_supervisory_enter_camera.getHolder().getSurface()); |
| | | RtspFaceNative.setSurface(2, fragment_supervisory_exit_camera.getHolder().getSurface()); |
| | | 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"); |
| | | |
| | | } |
| | | public String convertStreamToString(InputStream is) throws Exception { |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(is)); |