ffmpeg 实现视频播放

mSurfaceView = findViewById(R.id.surfaceView);
        mSurfaceView.getHolder().setFormat(PixelFormat.RGBA_8888);
        surface = mSurfaceView.getHolder().getSurface();
        mSurfaceView.getHolder().addCallback(this);
public native void playVideo(Surface surface,String path);
@Override
    public void surfaceCreated(@NonNull SurfaceHolder holder) {
        Log.e("TAG","surfaceCreated");
        new Thread(){
            @Override
            public void run() {
                super.run();
                playVideo(surface, filePath);
            }
        }.start();

    }
extern "C"
JNIEXPORT void JNICALL
Java_com_example_ffmpeg_MainActivity_playVideo(JNIEnv *env, jobject thiz, jobject surface,
                                               jstring videoPath) {
    // TODO: implement play()
    const

你可能感兴趣的:(ffmpeg,音视频播放,音视频,ffmpeg)