fix bug when long runing in background
[rtmpclient.git] / app / src / main / java / ai / suanzi / rtmpclient / Ffmpeg.java
1 package ai.suanzi.rtmpclient;
2
3 public class Ffmpeg {
4
5     static {
6         String arch = System.getProperty("os.arch");
7         if (arch.equals("i686")){
8             System.loadLibrary("x264");
9         }
10         System.loadLibrary("avutil");
11
12         System.loadLibrary("postproc");
13
14         System.loadLibrary("swresample");
15         System.loadLibrary("swscale");
16         System.loadLibrary("avcodec");
17         System.loadLibrary("avdevice");
18         System.loadLibrary("avfilter");
19         System.loadLibrary("avformat");
20         System.loadLibrary("ffmpeg-jni");
21     }
22
23     public native String getVersion();
24     public native int init(int width, int height);
25     public native int flush();
26     public native int close();
27     public native int process(byte[] data);
28     public native int play(Object surface, String fname);
29     public native int push(Object surface);
30     public native int preview(Object surface);
31     public native String getPerfectDevice();
32 }