translate FFmpeg into English

translate FFmpeg into English
pull/112/head
xufulong 5 years ago
parent 2f5f77703e
commit a207c04350
  1. 21
      app/src/main/java/com/frank/ffmpeg/FFmpegCmd.java

@ -4,6 +4,10 @@ import android.text.TextUtils;
import com.frank.ffmpeg.listener.OnHandleListener;
/**
* The JNI interface of handling FFmpeg command
* Created by frank on 2018/1/23
*/
public class FFmpegCmd {
static {
@ -14,7 +18,11 @@ public class FFmpegCmd {
private final static int RESULT_ERROR = 0;
//开子线程调用native方法进行音视频处理
/**
* Execute FFmpeg command
* @param commands the String array of command
* @param onHandleListener the callback for executing command
*/
public static void execute(final String[] commands, final OnHandleListener onHandleListener) {
new Thread(new Runnable() {
@Override
@ -22,7 +30,7 @@ public class FFmpegCmd {
if (onHandleListener != null) {
onHandleListener.onBegin();
}
//调用ffmpeg进行处理
//call JNI interface to execute FFmpeg cmd
int result = handle(commands);
if (onHandleListener != null) {
onHandleListener.onEnd(result, null);
@ -32,10 +40,12 @@ public class FFmpegCmd {
}
/**
* 使用FastStart把Moov移动到Mdat前面
* Using FastStart to moov box in front of mdat box
*
* @param inputFile inputFile
* @param outputFile outputFile
* @return 是否操作成功
* @return the result of moving moov box in front of mdat box
* 0 for success, -1 for fail
*/
public int moveMoovAhead(String inputFile, String outputFile) {
if (TextUtils.isEmpty(inputFile) || TextUtils.isEmpty(outputFile)) {
@ -46,6 +56,7 @@ public class FFmpegCmd {
/**
* execute probe cmd internal
*
* @param commands commands
* @param onHandleListener onHandleListener
*/
@ -56,7 +67,7 @@ public class FFmpegCmd {
if (onHandleListener != null) {
onHandleListener.onBegin();
}
//execute ffprobe
//call JNI interface to execute FFprobe cmd
String result = handleProbe(commands);
int resultCode = !TextUtils.isEmpty(result) ? RESULT_SUCCESS : RESULT_ERROR;
if (onHandleListener != null) {

Loading…
Cancel
Save