| | |
| | | package cn.com.basic.face.fragment; |
| | | |
| | | import android.graphics.Bitmap; |
| | | import android.os.Bundle; |
| | | import android.view.Surface; |
| | | import android.view.SurfaceView; |
| | | import android.view.View; |
| | | import android.widget.RadioButton; |
| | | import android.widget.RadioGroup; |
| | |
| | | |
| | | import cn.com.basic.face.base.BaseFragment; |
| | | |
| | | import com.bsk.zhangbo.demoforbsk.util.RtspFaceNative; |
| | | import cn.com.basic.face.base.MainActivity; |
| | | import cn.com.basic.face.util.RtspFaceNative; |
| | | |
| | | import cn.com.basic.face.service.SurvalanceMng; |
| | | import cn.com.basic.face.service.SurveillanceMng; |
| | | import cn.com.basic.face.widget.surveilance.SurveillanceBottomListView; |
| | | |
| | | import com.lidroid.xutils.view.annotation.ViewInject; |
| | | |
| | | |
| | | /** |
| | | * Created by zhangbo on 2017/2/15. |
| | | */ |
| | | |
| | | public class SurveillanceFragment extends BaseFragment { |
| | | |
| | |
| | | @ViewInject(R.id.fragment_supervisory_bottom_attendance_list_view) |
| | | private SurveillanceBottomListView fragment_supervisory_bottom_attendance_list_view; |
| | | @ViewInject(R.id.fragment_supervisory_enter_camera) |
| | | VideoView fragment_supervisory_enter_camera; |
| | | SurfaceView fragment_supervisory_enter_camera; |
| | | @ViewInject(R.id.fragment_supervisory_exit_camera) |
| | | VideoView fragment_supervisory_exit_camera; |
| | | SurfaceView fragment_supervisory_exit_camera; |
| | | |
| | | static boolean useNative = false; |
| | | |
| | | static { |
| | | if (useNative) { |
| | | System.loadLibrary("cvface_api"); |
| | | System.loadLibrary("opencv_java3"); |
| | | System.loadLibrary("protobuf-lite"); |
| | | System.loadLibrary("protobuf"); |
| | | System.loadLibrary("protoc"); |
| | | System.loadLibrary("rtspface"); |
| | | RtspFaceNative.init(); |
| | | RtspFaceNative.setLocalIP("192.168.1.10"); |
| | | } |
| | | } |
| | | |
| | |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | Thread.sleep(2000); |
| | | if (useNative) { |
| | | RtspFaceNative.setSurface(1, fragment_supervisory_enter_camera.getHolder().getSurface()); |
| | | RtspFaceNative.setSurface(2, fragment_supervisory_exit_camera.getHolder().getSurface()); |
| | | RtspFaceNative.createPlayer(1, "rtsp://admin:admin12345@192.168.1.70:554/h264/ch1/sub/av_stream"); |
| | | RtspFaceNative.createPlayer(2, "rtsp://admin:admin12345@192.168.1.70:554/h264/ch1/sub/av_stream"); |
| | | MainActivity.getInstance().runOnUiThread(new Runnable() { |
| | | public void run() { |
| | | RtspFaceNative.setSurface(1, fragment_supervisory_enter_camera.getHolder().getSurface()); |
| | | //RtspFaceNative.setSurface(2, fragment_supervisory_exit_camera.getHolder().getSurface()); |
| | | RtspFaceNative.createPlayer(1, "rtsp://admin:admin12345@192.168.1.70:554/h264/ch1/sub/av_stream"); |
| | | //RtspFaceNative.createPlayer(2, "rtsp://admin:admin12345@192.168.1.70:554/h264/ch1/sub/av_stream"); |
| | | RtspFaceNative.setFaceCallback(1, "cn/com/basic/face/util/RtspFaceNative", "faceCallBack"); |
| | | } |
| | | }); |
| | | } else { |
| | | // fragment_supervisory_enter_camera.setVideoURI(Uri.parse("rtsp://admin:admin12345@192.168.1.70:554/h264/ch1/sub/av_stream")); |
| | | // fragment_supervisory_enter_camera.requestFocus(); |
| | | // fragment_supervisory_enter_camera.start(); |
| | | // fragment_supervisory_exit_camera.setVideoURI(Uri.parse("rtsp://admin:admin12345@192.168.1.70:554/h264/ch1/main/av_stream")); |
| | | // fragment_supervisory_exit_camera.requestFocus(); |
| | | // fragment_supervisory_exit_camera.start(); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | } |
| | | |
| | | private void reloadBottomList() { |
| | | SurvalanceMng.getInstance().findSupervisoryBottomList(fragment_supervisory_bottom_visitor_radio_button.isChecked()); |
| | | SurveillanceMng.getInstance().findSurveillanceBottomList(fragment_supervisory_bottom_visitor_radio_button.isChecked()); |
| | | } |
| | | |
| | | } |