| | |
| | | import android.widget.RadioButton; |
| | | import android.widget.Spinner; |
| | | |
| | | import com.bsk.zhangbo.demoforbsk.util.RtspFaceNative; |
| | | |
| | | import java.io.IOException; |
| | | |
| | | public class NativeCodec extends Activity { |
| | |
| | | super.onCreate(icicle); |
| | | setContentView(R.layout.main); |
| | | |
| | | init(); |
| | | RtspFaceNative.init(); |
| | | |
| | | mGLView1 = (MyGLSurfaceView) findViewById(R.id.glsurfaceview1); |
| | | |
| | |
| | | } |
| | | if (mSourceString != null) { |
| | | |
| | | setSurface(1, mSurfaceHolder1.getSurface()); |
| | | RtspFaceNative.setSurface(1, mSurfaceHolder1.getSurface()); |
| | | mGLView1VideoSink.useAsSinkForNative(); |
| | | |
| | | //mCreated = createStreamingMediaPlayer(getResources().getAssets(), mSourceString); |
| | | mCreated = createPlayer(1, "rtsp://admin:admin12345@192.168.1.70:554/h264/ch1/main/av_stream"); |
| | | mCreated = createPlayer(2, "rtsp://admin:admin12345@192.168.1.70:554/h264/ch1/main/av_stream"); |
| | | //#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/main/av_stream"); |
| | | //mCreated = createPlayer(1, "rtsp://192.168.1.56:8554"); |
| | | |
| | | byte[] arr = new byte[5]; |
| | | arr[0] = 3; arr[1] = 4; arr[2] = 5; |
| | | RtspFaceNative.getFaceList(1, arr); |
| | | |
| | | } |
| | | } |
| | |
| | | @Override |
| | | protected void onDestroy() |
| | | { |
| | | shutdown(1); |
| | | shutdown(2); |
| | | RtspFaceNative.shutdown(1); |
| | | RtspFaceNative.shutdown(2); |
| | | mCreated = false; |
| | | super.onDestroy(); |
| | | } |
| | |
| | | //public static native void setSurface(Surface surface); |
| | | //public static native void rewindStreamingMediaPlayer(); |
| | | |
| | | |
| | | public static native void init(); |
| | | public static native void setSurface(int cameraIdx, Surface surface); |
| | | public static native boolean createPlayer(int cameraIdx, String uri); |
| | | public static native void shutdown(int cameraIdx); |
| | | |
| | | //public static native void init(); |
| | | //public static native void setSurface(int cameraIdx, Surface surface); |
| | | //public static native boolean createPlayer(int cameraIdx, String uri); |
| | | //public static native void shutdown(int cameraIdx); |
| | | //// typedef void (* Java_com_example_nativecodec_NativeCodec_FaceCallback_func)(int cameraIdx, int count); |
| | | //public static native boolean setFaceCallback(int cameraIdx, String func); |
| | | //public static native void lockFace(int cameraIdx); |
| | | //public static native void releaseFace(int cameraIdx); |
| | | //public static native boolean getFaceList(int cameraIdx, byte[] faceListPb); |
| | | //public static native boolean getFaceImages(int cameraIdx, byte[] faceImagesIdx, byte[] faceImages); |
| | | |
| | | /** Load jni .so on initialization */ |
| | | static { |
| | |
| | | void useAsSinkForNative() { |
| | | Surface s = mSurfaceHolder.getSurface(); |
| | | Log.i("@@@", "setting surface " + s); |
| | | setSurface(1, s); |
| | | RtspFaceNative.setSurface(1, s); |
| | | } |
| | | |
| | | } |
| | |
| | | void useAsSinkForNative() { |
| | | SurfaceTexture st = mMyGLSurfaceView.getSurfaceTexture(); |
| | | Surface s = new Surface(st); |
| | | setSurface(2, s); |
| | | RtspFaceNative.setSurface(2, s); |
| | | s.release(); |
| | | } |
| | | |