Skip to content

Commit

Permalink
Merge pull request #45 from lincollincol/ffmpeg_kit_compatibility
Browse files Browse the repository at this point in the history
FFmpeg kit compatibility
  • Loading branch information
lincollincol authored Aug 2, 2022
2 parents 843fa38 + 4519645 commit a1b5193
Show file tree
Hide file tree
Showing 21 changed files with 26 additions and 27 deletions.
9 changes: 3 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
compileSdkVersion 32
ndkVersion "21.1.6352462"

android.ndkVersion "21.1.6352462"

defaultConfig {
minSdkVersion 21
targetSdkVersion 30
targetSdkVersion 32
versionCode 1
versionName "2.1.3"
project.archivesBaseName = "Amplituda"
Expand Down Expand Up @@ -51,4 +48,4 @@ android {

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
}
}
39 changes: 20 additions & 19 deletions app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,32 @@ set(ffmpeg_DIR ${CMAKE_SOURCE_DIR}/ffmpeg)

include_directories(${ffmpeg_DIR}/${ANDROID_ABI}/include)

add_library(avutil SHARED IMPORTED)
set_target_properties(avutil PROPERTIES IMPORTED_LOCATION
${ffmpeg_DIR}/${ANDROID_ABI}/lib/libavutil.so)
add_library(amplituda-avutil SHARED IMPORTED)
set_target_properties(amplituda-avutil PROPERTIES IMPORTED_LOCATION
${ffmpeg_DIR}/${ANDROID_ABI}/lib/libavutil-amplituda.so)

add_library(avformat SHARED IMPORTED)
set_target_properties(avformat PROPERTIES IMPORTED_LOCATION
${ffmpeg_DIR}/${ANDROID_ABI}/lib/libavformat.so)
add_library(amplituda-avformat SHARED IMPORTED)
set_target_properties(amplituda-avformat PROPERTIES IMPORTED_LOCATION
${ffmpeg_DIR}/${ANDROID_ABI}/lib/libavformat-amplituda.so)

add_library(avcodec SHARED IMPORTED)
set_target_properties(avcodec PROPERTIES IMPORTED_LOCATION
${ffmpeg_DIR}/${ANDROID_ABI}/lib/libavcodec.so)
add_library(amplituda-avcodec SHARED IMPORTED)
set_target_properties(amplituda-avcodec PROPERTIES IMPORTED_LOCATION
${ffmpeg_DIR}/${ANDROID_ABI}/lib/libavcodec-amplituda.so)

add_library(swresample SHARED IMPORTED)
set_target_properties(swresample PROPERTIES IMPORTED_LOCATION
${ffmpeg_DIR}/${ANDROID_ABI}/lib/libswresample.so)
add_library(amplituda-swresample SHARED IMPORTED)
set_target_properties(amplituda-swresample PROPERTIES IMPORTED_LOCATION
${ffmpeg_DIR}/${ANDROID_ABI}/lib/libswresample-amplituda.so)

add_library(native-lib SHARED native-lib.cpp)
set_target_properties(native-lib PROPERTIES LINKER_LANGUAGE CXX)
add_library(amplituda-native-lib SHARED amplituda-native-lib.cpp)
set_target_properties(amplituda-native-lib PROPERTIES LINKER_LANGUAGE CXX)

#find_library( log-lib log )

target_link_libraries(native-lib
avutil
avformat
avcodec
swresample
target_link_libraries(
amplituda-native-lib
amplituda-avutil
amplituda-avformat
amplituda-avcodec
amplituda-swresample
# ${log-lib}
)
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion app/src/main/java/linc/com/amplituda/Amplituda.java
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ private synchronized void updateProgressOperation(
* NDK part
*/
static {
System.loadLibrary("native-lib");
System.loadLibrary("amplituda-native-lib");
}

native AmplitudaResultJNI amplitudesFromAudioJNI(
Expand Down
3 changes: 2 additions & 1 deletion example/src/main/java/linc/com/example/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ protected void onCreate(Bundle savedInstanceState) {
Amplituda amplituda = new Amplituda(this);

amplituda.processAudio(
"/storage/emulated/0/Music/Linc - Amplituda.mp3",
// "/storage/emulated/0/Music/Linc - Amplituda.mp3",
"/storage/9016-4EF8/MUSIC/Palace - Heaven Up There.mp3",
Compress.withParams(Compress.AVERAGE, 1),
new AmplitudaProgressListener() {
@Override
Expand Down

0 comments on commit a1b5193

Please sign in to comment.