| | |
| | | * Created by houxiao on 2017/3/21 0021.
|
| | | */
|
| | |
|
| | | class NativeImgIdx {
|
| | | public int offset;
|
| | | public int size;
|
| | | public int type;
|
| | | public int width;
|
| | | public int height;
|
| | | }
|
| | |
|
| | | class RefByteArray
|
| | | {
|
| | | public byte[] arr;
|
| | | }
|
| | |
|
| | | public class RtspFaceNative {
|
| | |
|
| | | //cn.com.basic.face.util.RtspFaceNative
|
| | |
| | | public static native boolean setFaceCallback(int cameraIdx, String className, String funcName);
|
| | | public static native void lockFace(int cameraIdx);
|
| | | public static native void releaseFace(int cameraIdx);
|
| | | public static native int getFaceList(int cameraIdx, byte[] faceListPb);
|
| | | public static native ArrayList<NativeImgIdx> getFaceImages(int cameraIdx, byte[] faceImages);
|
| | | public static native int getFaceList(int cameraIdx, RefByteArray faceListPb);
|
| | | public static native ArrayList<NativeImgIdx> getFaceImages(int cameraIdx, RefByteArray faceImages);
|
| | |
|
| | | public static void faceCallBack(int cameraIdx, int count)
|
| | | {
|
| | | Log.i("@@@", "RtspFaceNative.faceCallBack, cameraIdx=" + cameraIdx + ", count=" + count);
|
| | |
|
| | | // something else
|
| | | if (count <= 0)
|
| | | return;
|
| | |
|
| | | lockFace(cameraIdx);
|
| | |
|
| | | byte[] faceListPb = new byte[1024 * 1024 * 1];
|
| | | RefByteArray faceListPb = new RefByteArray();
|
| | | int s = getFaceList(cameraIdx, faceListPb);
|
| | | Log.i("@@@", "RtspFaceNative.faceCallBack, getFaceList, cameraIdx=" + cameraIdx + ", size=" + s);
|
| | |
|
| | | byte[] faceImages = new byte[1024 * 1024 * 1];
|
| | | RefByteArray faceImages = new RefByteArray();
|
| | | ArrayList<NativeImgIdx> faceImagesIdx = getFaceImages(cameraIdx, faceImages);
|
| | | int c = faceImagesIdx.size();
|
| | | int c = 0;
|
| | | if (faceImagesIdx != null)
|
| | | c = faceImagesIdx.size();
|
| | | Log.i("@@@", "RtspFaceNative.faceCallBack, getFaceImages, cameraIdx=" + cameraIdx + ", count=" + c);
|
| | |
|
| | | releaseFace(cameraIdx);
|