From 8b1ced6e0dd04490bce859459a0f1c5476951b70 Mon Sep 17 00:00:00 2001 From: xufulong <839789740@qq.com> Date: Mon, 6 Apr 2020 21:54:19 +0800 Subject: [PATCH] translate VideoPlayer into English translate VideoPlayer into English --- .../java/com/frank/ffmpeg/VideoPlayer.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/frank/ffmpeg/VideoPlayer.java b/app/src/main/java/com/frank/ffmpeg/VideoPlayer.java index 20fc676..5a76cce 100644 --- a/app/src/main/java/com/frank/ffmpeg/VideoPlayer.java +++ b/app/src/main/java/com/frank/ffmpeg/VideoPlayer.java @@ -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,27 +15,32 @@ 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){ + public AudioTrack createAudioTrack(int sampleRate, int channels) { int audioFormat = AudioFormat.ENCODING_PCM_16BIT; int channelConfig; - if(channels == 1){ + if (channels == 1) { channelConfig = AudioFormat.CHANNEL_OUT_MONO; - }else if(channels == 2){ + } else if (channels == 2) { channelConfig = AudioFormat.CHANNEL_OUT_STEREO; - }else{ + } else { channelConfig = AudioFormat.CHANNEL_OUT_STEREO; }