Skip to content

Commit

Permalink
Update to build with latest ffmpeg-kit; disable forced debuggability
Browse files Browse the repository at this point in the history
  • Loading branch information
artdeell committed Jan 5, 2025
1 parent 6712d48 commit a278847
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 11 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ builds only on linux because i dont like windows
# Also you need to install build-essential, nasm and autogen. If you encounter errors during building check build.log in the ffmpeg-kit directory and install the necessary packages
./scripts/setup_environ.sh
./scripts/build_libs.sh
./gradlew assemble
# To build release, edit app/build.gradle with your own signing config.
./gradlew assembleDebug
```
13 changes: 6 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

android {
namespace 'net.kdt.pojavlaunch.ffmpeg'
compileSdk 33
compileSdk 34
signingConfigs {
release {
storeFile file("rel_signature.jks")
Expand All @@ -15,16 +15,15 @@ android {
}
defaultConfig {
applicationId "net.kdt.pojavlaunch.ffmpeg"
minSdk 21
targetSdk 33
versionCode 1
versionName "1.0"
minSdk 24
targetSdk 34
versionCode 2
versionName "1.1"
}

buildTypes {
release {
signingConfig signingConfigs.release
debuggable true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
Expand All @@ -37,4 +36,4 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: '*.jar')
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Apr 25 19:44:56 MSK 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
4 changes: 3 additions & 1 deletion scripts/build_libs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ if [ ! -e ./ffmpeg-kit ]; then
exit 1
fi
cd ffmpeg-kit
./android.sh --api-level=21 --enable-gpl --enable-shine --enable-x264 --enable-x265 --enable-libtheora --enable-opus --enable-libvorbis --enable-twolame
./android.sh --api-level=24 --enable-gpl --enable-shine --enable-x264 --enable-x265 --enable-libtheora --enable-opus --enable-libvorbis --enable-twolame
function copy_libs {
if [ -e ../app/libs/lib/$1/ ]; then
rm -r ../app/libs/lib/$1/*
else
mkdir ../app/libs/lib/$1/
fi
cp -t ../app/libs/lib/$1/ prebuilt/$2/ffmpeg/bin/* prebuilt/$2/ffmpeg/lib/*
mv ../app/libs/lib/$1/ffmpeg ../app/libs/lib/$1/libffmpeg.so
mv ../app/libs/lib/$1/ffprobe ../app/libs/lib/$1/libffprobe.so
cp android/libs/$1/libc++_shared.so ../app/libs/lib/$1/
}

Expand Down
49 changes: 48 additions & 1 deletion scripts/ffmpeg_enable_executable.diff
Original file line number Diff line number Diff line change
@@ -1,5 +1,52 @@
diff --git a/android/ffmpeg-kit-android-lib/src/main/cpp/fftools_ffmpeg_mux_init.c b/android/ffmpeg-kit-android-lib/src/main/cpp/fftools_ffmpeg_mux_init.c
index 522f8b8..1ede776 100644
--- a/android/ffmpeg-kit-android-lib/src/main/cpp/fftools_ffmpeg_mux_init.c
+++ b/android/ffmpeg-kit-android-lib/src/main/cpp/fftools_ffmpeg_mux_init.c
@@ -284,9 +284,9 @@ static int enc_stats_init(OutputStream *ost, EncStats *es, int pre,
static const struct {
enum EncStatsType type;
const char *str;
- int pre_only:1;
- int post_only:1;
- int need_input_data:1;
+ unsigned int pre_only:1;
+ unsigned int post_only:1;
+ unsigned int need_input_data:1;
} fmt_specs[] = {
{ ENC_STATS_FILE_IDX, "fidx" },
{ ENC_STATS_STREAM_IDX, "sidx" },
diff --git a/android/jni/Android.mk b/android/jni/Android.mk
index ee65090..e98bfe2 100644
--- a/android/jni/Android.mk
+++ b/android/jni/Android.mk
@@ -91,9 +91,9 @@ ifeq ($(MY_ARMV7_NEON), true)
LOCAL_CFLAGS := $(MY_CFLAGS)
LOCAL_LDLIBS := $(MY_LDLIBS)
LOCAL_SHARED_LIBRARIES := libavcodec_neon libavfilter_neon libswscale_neon libavformat_neon libavutil_neon libswresample_neon libavdevice_neon
- ifeq ($(APP_STL), c++_shared)
- LOCAL_SHARED_LIBRARIES += c++_shared # otherwise NDK will not add the library for packaging
- endif
+# ifeq ($(APP_STL), c++_shared)
+# LOCAL_SHARED_LIBRARIES += c++_shared # otherwise NDK will not add the library for packaging
+# endif
LOCAL_ARM_NEON := true
include $(BUILD_SHARED_LIBRARY)

@@ -113,9 +113,9 @@ ifeq ($(MY_BUILD_GENERIC_FFMPEG_KIT), true)
LOCAL_CFLAGS := $(MY_CFLAGS)
LOCAL_LDLIBS := $(MY_LDLIBS)
LOCAL_SHARED_LIBRARIES := libavfilter libavformat libavcodec libavutil libswresample libavdevice libswscale
- ifeq ($(APP_STL), c++_shared)
- LOCAL_SHARED_LIBRARIES += c++_shared # otherwise NDK will not add the library for packaging
- endif
+# ifeq ($(APP_STL), c++_shared)
+# LOCAL_SHARED_LIBRARIES += c++_shared # otherwise NDK will not add the library for packaging
+# endif
LOCAL_ARM_NEON := ${MY_ARM_NEON}
include $(BUILD_SHARED_LIBRARY)

diff --git a/scripts/android/ffmpeg.sh b/scripts/android/ffmpeg.sh
index e2af2ac..078371a 100755
index 8b311fd..a127a2c 100755
--- a/scripts/android/ffmpeg.sh
+++ b/scripts/android/ffmpeg.sh
@@ -446,7 +446,7 @@ fi
Expand Down

0 comments on commit a278847

Please sign in to comment.