git-svn-id: http://192.168.1.226/svn/proxy@537 454eff88-639b-444f-9e54-f578c98de674
| | |
| | |
|
| | | import com.bsk.zhangbo.demoforbsk.R;
|
| | | import cn.com.basic.face.base.BaseFragment;
|
| | | import cn.com.basic.face.discern.common.CommonVariables;
|
| | | import cn.com.basic.face.discern.entity.Register;
|
| | | import cn.com.basic.face.discern.query.item.CheckInQueryItem;
|
| | | import cn.com.basic.face.service.DictionaryMng;
|
| | |
| | | List<Bitmap> bitmapList = new ArrayList<>();
|
| | | bitmapList.add(0, bitmap);
|
| | |
|
| | | SurveillanceMng.getInstance().addBitmap(bitmapList, null, 0);
|
| | | SurveillanceMng.getInstance().addBitmap(bitmapList, null, 0, CommonVariables.Camera.IN);
|
| | |
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | |
| | | // });
|
| | | }
|
| | |
|
| | | public void addBitmap(final List<Bitmap> bitmapList, byte[] byteArray, int len) {
|
| | | public void addBitmap(final List<Bitmap> bitmapList, byte[] byteArray, int len, String cameraInOrOut) {
|
| | | if (!BaseApplication.deviceAvailable) {
|
| | | return;
|
| | | }
|
| | | final int cameraInOrOut = Integer.parseInt(CommonVariables.Camera.IN);
|
| | | //final int cameraInOrOut = Integer.parseInt(CommonVariables.Camera.IN);
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.SURVEILLANCE_UPLOAD);
|
| | | params.addBodyParameter("base64Photo", Base64.encodeToString(byteArray, 0, len, Base64.DEFAULT));
|
| | | params.addBodyParameter("deviceCompanyId", BaseApplication.getInstance().getDevice().getDeviceCompanyId());
|
| | |
| | | //public static native ArrayList<NativeImgIdx> getFaceImages(int cameraIdx, RefByteArray faceImages);
|
| | | public static native ArrayList<NativeImg> getFaceImages(int cameraIdx);
|
| | |
|
| | | public static void faceCallBack(int cameraIdx, int count)
|
| | | public static void faceCallBack(int cameraInOrOut, int count)
|
| | | {
|
| | | Log.i("@@@", "RtspFaceNative.faceCallBack, cameraIdx=" + cameraIdx + ", count=" + count);
|
| | | Log.i("@@@", "RtspFaceNative.faceCallBack, cameraIdx=" + cameraInOrOut + ", count=" + count);
|
| | |
|
| | | // something else
|
| | | if (count <= 0)
|
| | | return;
|
| | |
|
| | | lockFace(cameraIdx);
|
| | | lockFace(cameraInOrOut);
|
| | |
|
| | | RefByteArray faceListPb = new RefByteArray();
|
| | | int s = getFaceList(cameraIdx, faceListPb);
|
| | | Log.i("@@@", "RtspFaceNative.faceCallBack, getFaceList, cameraIdx=" + cameraIdx + ", size=" + s);
|
| | | int s = getFaceList(cameraInOrOut, faceListPb);
|
| | | Log.i("@@@", "RtspFaceNative.faceCallBack, getFaceList, cameraIdx=" + cameraInOrOut + ", size=" + s);
|
| | |
|
| | | //RefByteArray faceImages = new RefByteArray();
|
| | | //ArrayList<NativeImgIdx> faceImagesIdx = getFaceImages(cameraIdx, faceImages);
|
| | |
| | | // c = faceImagesIdx.size();
|
| | | //Log.i("@@@", "RtspFaceNative.faceCallBack, getFaceImages, cameraIdx=" + cameraIdx + ", count=" + c);
|
| | |
|
| | | ArrayList<NativeImg> faceImages = getFaceImages(cameraIdx);
|
| | | ArrayList<NativeImg> faceImages = getFaceImages(cameraInOrOut);
|
| | | int c = 0;
|
| | | if (faceImages != null)
|
| | | c = faceImages.size();
|
| | | Log.i("@@@", "RtspFaceNative.faceCallBack, getFaceImages, cameraIdx=" + cameraIdx + ", count=" + c);
|
| | | Log.i("@@@", "RtspFaceNative.faceCallBack, getFaceImages, cameraIdx=" + cameraInOrOut + ", count=" + c);
|
| | |
|
| | | for (int i = 0; i < c; i++)
|
| | | {
|
| | | Log.i("@@@", "cameraIdx=" + cameraIdx +
|
| | | Log.i("@@@", "cameraIdx=" + cameraInOrOut +
|
| | | ", i=" + i +
|
| | | ", size=" + faceImages.get(i).size+
|
| | | ", w=" + faceImages.get(i).width +
|
| | |
| | | bitmap.copyPixelsFromBuffer(byteBuffer);
|
| | | bitmapList.add(bitmap);
|
| | | }
|
| | | SurveillanceMng.getInstance().addBitmap(bitmapList, faceListPb.arr, s);
|
| | | SurveillanceMng.getInstance().addBitmap(bitmapList, faceListPb.arr, s, cameraInOrOut+"");
|
| | |
|
| | | }catch(Exception e){
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | releaseFace(cameraIdx);
|
| | | releaseFace(cameraInOrOut);
|
| | | }
|
| | |
|
| | | }
|