| | |
| | | import android.graphics.PixelFormat; |
| | | import android.graphics.SurfaceTexture; |
| | | import android.graphics.drawable.Drawable; |
| | | import android.media.MediaCodecInfo; |
| | | import android.os.Bundle; |
| | | import android.util.Log; |
| | | import android.util.Xml; |
| | |
| | | |
| | | import cn.com.basic.face.util.NativeImg; |
| | | import cn.com.basic.face.util.RtspFaceNative; |
| | | |
| | | import static java.lang.Thread.sleep; |
| | | |
| | | public class NativeCodec extends Activity { |
| | | static final String TAG = "NativeCodec"; |
| | |
| | | //Runtime.getRuntime().exec(new String[]{"/system/bin/su","-c", cmd}); |
| | | |
| | | RtspFaceNative.init(); |
| | | for (int i=0 ;i < 32; i+=2){ |
| | | RtspFaceNative.setFaceLabel(1, i, "中文名字"); |
| | | RtspFaceNative.setFaceLabel(1, i+1, "abcd"); |
| | | RtspFaceNative.setFaceLabel(2, i, "中文名字"); |
| | | RtspFaceNative.setFaceLabel(2, i+1, "abcd"); |
| | | } |
| | | //for (int i=0 ;i < 32; i+=2){ |
| | | // RtspFaceNative.setFaceLabel(1, i, "中文名字"); |
| | | // RtspFaceNative.setFaceLabel(1, i+1, "abcd"); |
| | | // RtspFaceNative.setFaceLabel(2, i, "中文名字"); |
| | | // RtspFaceNative.setFaceLabel(2, i+1, "abcd"); |
| | | //} |
| | | |
| | | RtspFaceNative.setLocalIP("192.168.1.82"); |
| | | RtspFaceNative.setLocalIP("192.168.1.93"); |
| | | |
| | | mGLView1 = (MyGLSurfaceView) findViewById(R.id.glsurfaceview1); |
| | | |
| | |
| | | //mCreated = createStreamingMediaPlayer(getResources().getAssets(), mSourceString); |
| | | //#todo ok |
| | | //mCreated = RtspFaceNative.createPlayer(1, "rtsp://admin:admin@192.168.1.188:554/cam/realmonitor?channel=1&subtype=2"); |
| | | mCreated = RtspFaceNative.createPlayer(1, "rtsp://admin:admin12345@192.168.1.202:554/h264/ch1/main/av_stream"); |
| | | //mCreated = RtspFaceNative.createPlayer(2, "rtsp://admin:admin12345@192.168.1.202:554/h264/ch1/main/av_stream"); |
| | | //mCreated = RtspFaceNative.createPlayer(2, "rtsp://Admin:1234@192.168.1.22/h264"); |
| | | //mCreated = RtspFaceNative.createPlayer(2, "rtsp://admin:a1234567@192.168.1.201:554/h264/ch1/main/av_stream"); |
| | | //mCreated = createPlayer(1, "rtsp://192.168.1.56:8554"); |
| | | mCreated = RtspFaceNative.createPlayer(1, "rtsp://admin:a1234567@192.168.1.201:554/h264/ch1/main/av_stream"); |
| | | //mCreated = RtspFaceNative.createPlayer(1, "rtsp://192.168.1.94:8554"); |
| | | |
| | | //byte[] arr = new byte[5]; |
| | | //arr[0] = 3; arr[1] = 4; arr[2] = 5; |
| | | //RtspFaceNative.getFaceList(1, arr); |
| | | |
| | | } |
| | | } |
| | | if (mCreated) { |
| | |
| | | //setPlayingStreamingMediaPlayer(mIsPlaying); |
| | | } |
| | | } |
| | | |
| | | }); |
| | | |
| | | |
| | | // native MediaPlayer rewind |
| | | ((Button) findViewById(R.id.rewind_native)).setOnClickListener(new View.OnClickListener() { |
| | |
| | | |
| | | /** Load jni .so on initialization */ |
| | | static { |
| | | System.loadLibrary("rtspface"); |
| | | //System.loadLibrary("rtspface_client"); |
| | | System.loadLibrary("rtspface_server"); |
| | | //System.loadLibrary("opencv_java3"); |
| | | } |
| | | |