content: package com.ws.ffmpegandroidavfilter;
  import android.Manifest;
  import android.os.Build;
  import android.os.Bundle;
  import android.support.v7.app.AppCompatActivity;
  import android.view.SurfaceHolder;
  import android.view.SurfaceView;
  
  
  
  public class MainActivity extends AppCompatActivity implements SurfaceHolder.Callback {
  
      static {
          System.loadLibrary("native-lib");
      }
  
      SurfaceHolder surfaceHolder;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          SurfaceView surfaceView = (SurfaceView) findViewById(R.id.surface_view);
          surfaceHolder = surfaceView.getHolder();
          surfaceHolder.addCallback(this);
  
          if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
              requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 5);
          }
      }
  
  
      @Override
      public void surfaceCreated(SurfaceHolder holder) {
          new Thread(new Runnable() {
              @Override
              public void run() {
                  play(surfaceHolder.getSurface());
              }
          }).start();
      }
  
      @Override
      public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
  
      }
  
      @Override
      public void surfaceDestroyed(SurfaceHolder holder) {
  
      }
  
      public native int play(Object surface);
  }
  