fix bug when long runing in background
[rtmpclient.git] / app / src / main / java / ai / suanzi / rtmpclient / Ffmpeg.java
index f3ec401..7d9bb80 100644 (file)
@@ -3,9 +3,14 @@ package ai.suanzi.rtmpclient;
 public class Ffmpeg {
 
     static {
-        System.loadLibrary("x264");
-        System.loadLibrary("postproc");
+        String arch = System.getProperty("os.arch");
+        if (arch.equals("i686")){
+            System.loadLibrary("x264");
+        }
         System.loadLibrary("avutil");
+
+        System.loadLibrary("postproc");
+
         System.loadLibrary("swresample");
         System.loadLibrary("swscale");
         System.loadLibrary("avcodec");
@@ -16,4 +21,12 @@ public class Ffmpeg {
     }
 
     public native String getVersion();
+    public native int init(int width, int height);
+    public native int flush();
+    public native int close();
+    public native int process(byte[] data);
+    public native int play(Object surface, String fname);
+    public native int push(Object surface);
+    public native int preview(Object surface);
+    public native String getPerfectDevice();
 }