|
|
|
@ -5,7 +5,7 @@ import android.media.AudioManager; |
|
|
|
|
import android.media.AudioTrack; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 视频播放器 |
|
|
|
|
* VideoPlayer: using FFmpeg filter |
|
|
|
|
* Created by frank on 2018/2/1 |
|
|
|
|
*/ |
|
|
|
|
public class VideoPlayer { |
|
|
|
@ -15,17 +15,22 @@ public class VideoPlayer { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public native int play(String filePath, Object surface); |
|
|
|
|
|
|
|
|
|
public native void setPlayRate(float playRate); |
|
|
|
|
|
|
|
|
|
public native int filter(String filePath, Object surface, String filterType); |
|
|
|
|
|
|
|
|
|
public native void again(); |
|
|
|
|
|
|
|
|
|
public native void release(); |
|
|
|
|
|
|
|
|
|
public native void playAudio(boolean play); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 创建AudioTrack对象,供JNI调用 |
|
|
|
|
* Create an AudioTrack instance for JNI calling |
|
|
|
|
* |
|
|
|
|
* @param sampleRate sampleRate |
|
|
|
|
* @param channels channels |
|
|
|
|
* @param channels channel layout |
|
|
|
|
* @return AudioTrack |
|
|
|
|
*/ |
|
|
|
|
public AudioTrack createAudioTrack(int sampleRate, int channels) { |
|
|
|
|