From 1812b5525e2fe9933274c8172399dbd503f77ce2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E7=81=BF=E8=BE=89?= <122565648@qq.com> Date: Sun, 22 Mar 2020 21:41:06 +0800 Subject: [PATCH] Load ffmpeg other info --- .../ffmpeg/invoker/demo/MainActivity.java | 25 ++++++-- app/src/main/res/layout/activity_main.xml | 46 ++++++++++++- library/src/main/cpp/ffmpeg-invoker.c | 64 +++++++++++++++++++ library/src/main/cpp/ffmpeg-invoker.h | 9 +++ .../xch168/ffmpeg/invoker/FFmpegInvoker.java | 3 + 5 files changed, 142 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/github/xch168/ffmpeg/invoker/demo/MainActivity.java b/app/src/main/java/com/github/xch168/ffmpeg/invoker/demo/MainActivity.java index b07f7a2..b4458c1 100644 --- a/app/src/main/java/com/github/xch168/ffmpeg/invoker/demo/MainActivity.java +++ b/app/src/main/java/com/github/xch168/ffmpeg/invoker/demo/MainActivity.java @@ -3,6 +3,7 @@ package com.github.xch168.ffmpeg.invoker.demo; import android.os.Build; import android.os.Bundle; import android.text.method.ScrollingMovementMethod; +import android.view.View; import android.widget.TextView; import androidx.appcompat.app.AppCompatActivity; @@ -11,6 +12,7 @@ import com.github.xch168.ffmpeg.invoker.FFmpegInvoker; public class MainActivity extends AppCompatActivity { + private TextView mConfigView; @Override protected void onCreate(Bundle savedInstanceState) { @@ -20,9 +22,9 @@ public class MainActivity extends AppCompatActivity { TextView tv = findViewById(R.id.tv_cpu_abi); tv.setText("CPU_ABI: " + getCpuAbi()); - TextView configView = findViewById(R.id.tv_config_info); - configView.setMovementMethod(ScrollingMovementMethod.getInstance()); - configView.setText(getConfigInfo()); + mConfigView = findViewById(R.id.tv_config_info); + mConfigView.setMovementMethod(ScrollingMovementMethod.getInstance()); + } private String getCpuAbi() { @@ -33,6 +35,22 @@ public class MainActivity extends AppCompatActivity { } } + public void getFFmpegConfigInfo(View view) { + mConfigView.setText(getConfigInfo()); + } + + public void getFFmpegCodecInfo(View view) { + mConfigView.setText(FFmpegInvoker.getAVCodecInfo()); + } + + public void getFFmpegFormatInfo(View view) { + mConfigView.setText(FFmpegInvoker.getAVFormatInfo()); + } + + public void getFFmpegFilterInfo(View view) { + mConfigView.setText(FFmpegInvoker.getAVFilterInfo()); + } + private String getConfigInfo() { String configInfo = FFmpegInvoker.getConfigInfo(); String[] configItems = configInfo.split(" "); @@ -42,5 +60,4 @@ public class MainActivity extends AppCompatActivity { } return configInfoBuilder.toString(); } - } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 3b58c09..d28a3c3 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -15,12 +15,56 @@ app:layout_constraintTop_toTopOf="parent" android:layout_marginTop="20dp"/> +