From d53b1e0d18c75420fd7bd7b37178c50d40f2a779 Mon Sep 17 00:00:00 2001 From: houxiao <houxiao@454eff88-639b-444f-9e54-f578c98de674> Date: 星期二, 18 四月 2017 14:54:41 +0800 Subject: [PATCH] bugfix getFaceListImage --- VisitFace/RtspNativeCodec/app/src/main/java/com/example/nativecodec/NativeCodec.java | 20 +++++++++++++------- 1 files changed, 13 insertions(+), 7 deletions(-) diff --git a/VisitFace/RtspNativeCodec/app/src/main/java/com/example/nativecodec/NativeCodec.java b/VisitFace/RtspNativeCodec/app/src/main/java/com/example/nativecodec/NativeCodec.java index e6fd85f..459eeb1 100644 --- a/VisitFace/RtspNativeCodec/app/src/main/java/com/example/nativecodec/NativeCodec.java +++ b/VisitFace/RtspNativeCodec/app/src/main/java/com/example/nativecodec/NativeCodec.java @@ -17,7 +17,7 @@ package com.example.nativecodec; import android.app.Activity; -import android.content.res.AssetManager; +import android.graphics.PixelFormat; import android.graphics.SurfaceTexture; import android.os.Bundle; import android.util.Log; @@ -33,9 +33,7 @@ import android.widget.RadioButton; import android.widget.Spinner; -import com.bsk.zhangbo.demoforbsk.util.RtspFaceNative; - -import java.io.IOException; +import cn.com.basic.face.util.RtspFaceNative; public class NativeCodec extends Activity { static final String TAG = "NativeCodec"; @@ -54,6 +52,8 @@ boolean mCreated = false; boolean mIsPlaying = false; + + /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { @@ -61,6 +61,7 @@ setContentView(R.layout.main); RtspFaceNative.init(); + RtspFaceNative.setLocalIP("192.168.1.10"); mGLView1 = (MyGLSurfaceView) findViewById(R.id.glsurfaceview1); @@ -192,9 +193,12 @@ //mCreated = createStreamingMediaPlayer(getResources().getAssets(), mSourceString); //#todo ok - mCreated = RtspFaceNative.createPlayer(1, "rtsp://admin:admin12345@192.168.1.70:554/h264/ch1/main/av_stream"); - mCreated = RtspFaceNative.createPlayer(2, "rtsp://admin:admin12345@192.168.1.70:554/h264/ch1/sub/av_stream"); + mCreated = RtspFaceNative.createPlayer(1, "rtsp://admin:admin12345@192.168.1.70:554/h264/ch1/sub/av_stream"); + //mCreated = RtspFaceNative.createPlayer(2, "rtsp://admin:admin12345@192.168.1.70:554/h264/ch1/sub/av_stream"); //mCreated = createPlayer(1, "rtsp://192.168.1.56:8554"); + + RtspFaceNative.setFaceCallback(1, "cn/com/basic/face/util/RtspFaceNative", "faceCallBack"); + //RtspFaceNative.setFaceCallback(2, "cn/com/basic/face/util/RtspFaceNative", "faceCallBack"); //byte[] arr = new byte[5]; //arr[0] = 3; arr[1] = 4; arr[2] = 5; @@ -307,7 +311,7 @@ /** Load jni .so on initialization */ static { System.loadLibrary("rtspface"); - //System.loadLibrary("opencv_java3"); + System.loadLibrary("opencv_java3"); } // VideoSink abstracts out the difference between Surface and SurfaceTexture @@ -336,6 +340,7 @@ void useAsSinkForNative() { Surface s = mSurfaceHolder.getSurface(); Log.i("@@@", "setting surface " + s); + //mSurfaceHolder1.setFormat(PixelFormat.RGBA_8888); RtspFaceNative.setSurface(1, s); } @@ -357,6 +362,7 @@ void useAsSinkForNative() { SurfaceTexture st = mMyGLSurfaceView.getSurfaceTexture(); Surface s = new Surface(st); + //setEGLConfigChooser(8, 8, 8, 8, 0, 0); RtspFaceNative.setSurface(2, s); s.release(); } -- Gitblit v1.8.0