Compare commits
63 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dd35c6131a | |||
| e0d7b9cad6 | |||
| 8b3692267f | |||
| ac4893216c | |||
| 23b701a556 | |||
| 69b2fa6e03 | |||
| c2870db53c | |||
| cccd72d96a | |||
| 5472992f83 | |||
| 0107986bdf | |||
| a3887fda89 | |||
| e76ae61e2b | |||
| b4a75138e2 | |||
| 5b3db7db41 | |||
| b5f7531dff | |||
| 3a2ebf15f0 | |||
| 0f61b7e0bf | |||
| 2456c963e6 | |||
| d124a16627 | |||
| 1434d0c300 | |||
| 5fc5c86749 | |||
| 2e969093e8 | |||
| f7526b861e | |||
| 71ec510992 | |||
| 738b93cb42 | |||
| dd695b64f0 | |||
| 882e3303c7 | |||
| 2a68ce3a5b | |||
| c0b471b312 | |||
| 31e3b2b836 | |||
| 8f94235dc0 | |||
| 0b1ceb031f | |||
| 7a2cea646b | |||
| b18006fceb | |||
| 16c335981e | |||
| 2db0de4d8e | |||
| 38fd55e605 | |||
| 801377f739 | |||
| 143347c530 | |||
| cdf1532e1d | |||
| e99bec4622 | |||
| fcb298b91a | |||
| cd58ea32c1 | |||
| 850da3004d | |||
| 73285ef20a | |||
| 027d9ac753 | |||
| e27ab37249 | |||
| 92248f3f33 | |||
| b3d0c650fb | |||
| 19fc09e378 | |||
| cbb059aa1f | |||
| debd06db88 | |||
| c2b2226e16 | |||
| 299f176e45 | |||
| 8650308bfb | |||
| 3005a673cd | |||
| 3a91363d1d | |||
| 2fc9e360ad | |||
| 4ffd9b31f2 | |||
| c92b236b5c | |||
| 4a2d1221e3 | |||
| 7e8b90a2fb | |||
| 852d148727 |
@@ -1,8 +1,8 @@
|
||||
# MobileFFmpeg [](https://gitter.im/mobile-ffmpeg/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)   
|
||||
# MobileFFmpeg [](https://gitter.im/mobile-ffmpeg/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)   
|
||||
|
||||
FFmpeg for Android and IOS
|
||||
|
||||
<img src="https://github.com/tanersener/mobile-ffmpeg/blob/dev-v3.x/docs/assets/mobile-ffmpeg-logo-v7.png" width="320">
|
||||
<img src="https://github.com/tanersener/mobile-ffmpeg/blob/master/docs/assets/mobile-ffmpeg-logo-v7.png" width="320">
|
||||
|
||||
### 1. Features
|
||||
- Use binaries available at `Github`/`JCenter`/`CocoaPods` or build your own version with external libraries you need
|
||||
@@ -98,7 +98,7 @@ There are eight different binary packages. Below you can see which system librar
|
||||
1. Add MobileFFmpeg dependency from `jcenter()`
|
||||
```
|
||||
dependencies {
|
||||
implementation 'com.arthenica:mobile-ffmpeg-full:4.2'
|
||||
implementation 'com.arthenica:mobile-ffmpeg-full:4.2.1'
|
||||
}
|
||||
```
|
||||
|
||||
@@ -174,7 +174,7 @@ There are eight different binary packages. Below you can see which system librar
|
||||
#### 2.2 IOS
|
||||
1. Add MobileFFmpeg pod to your `Podfile`
|
||||
```
|
||||
pod 'mobile-ffmpeg-full', '~> 4.2'
|
||||
pod 'mobile-ffmpeg-full', '~> 4.2.1'
|
||||
```
|
||||
|
||||
2. Execute commands.
|
||||
@@ -261,27 +261,27 @@ execution, video encoding, accessing https, encoding audio, burning subtitles an
|
||||
|
||||
### 3. Versions
|
||||
|
||||
`MobileFFmpeg` uses the same version number as `FFmpeg` since `v4.2`. Before that, `MobileFFmpeg` version of a release and `FFmpeg` version included in that release was different, as shown in the following table.
|
||||
`MobileFFmpeg` version number is aligned with `FFmpeg` since `v4.2`. Before that `MobileFFmpeg` version of a release and `FFmpeg` version included in that release was different.
|
||||
|
||||
| | v1.0 | v1.1 | v1.2 | v2.0 | v2.1 | v2.2 | v3.0 | v3.1 | v4.2 |
|
||||
| :----: | :----: | :----: | :----: | :----: | :----: | :----: | :----: | :----: | :----: |
|
||||
| FFmpeg | 3.4.2 | 3.4.2 | 3.4.4 | 4.0.1 | 4.0.2 | 4.0.3 | 4.1-dev-1517 | v4.1-10 | v4.2-dev-480 |
|
||||
| packages | min<br/>full | min<br/>min-gpl<br/>https<br/>https-gpl<br/>full<br/>full-gpl | min<br/>min-gpl<br/>https<br/>https-gpl<br/>full<br/>full-gpl | min<br/>min-gpl<br/>https<br/>https-gpl<br/>full<br/>full-gpl | min<br/>min-gpl<br/>https<br/>https-gpl<br/>audio<br/>video<br/>full<br/>full-gpl | min<br/>min-gpl<br/>https<br/>https-gpl<br/>audio<br/>video<br/>full<br/>full-gpl | min<br/>min-gpl<br/>https<br/>https-gpl<br/>audio<br/>video<br/>full<br/>full-gpl | min<br/>min-gpl<br/>https<br/>https-gpl<br/>audio<br/>video<br/>full<br/>full-gpl | min<br/>min-gpl<br/>https<br/>https-gpl<br/>audio<br/>video<br/>full<br/>full-gpl |
|
||||
| | v2.0 | v2.1 | v2.2 | v3.0 | v3.1 | v4.2 |v4.2.1 |
|
||||
| :----: | :----: | :----: | :----: | :----: | :----: | :----: |:----: |
|
||||
| FFmpeg | 4.0.1 | 4.0.2 | 4.0.3 | 4.1-dev-1517 | v4.1-10 | v4.2-dev-480 | v4.2-dev-1156 |
|
||||
| Includes LTS Variant | - | - | - | - | - | X | - |
|
||||
|
||||
### 4. LTS Releases
|
||||
|
||||
Starting from `v4.2`, `MobileFFmpeg` binaries are published in two different variants: `Main Release` and `LTS Release`.
|
||||
|
||||
- Main releases include complete functionality of the library and support the latest SDK/API features
|
||||
- Main releases are published every 3 months. They include complete functionality of the library and support the latest SDK/API features.
|
||||
|
||||
- LTS releases are customized to support a wide range of devices. They are built using older API/SDK versions, so some features are not available for them
|
||||
- LTS releases are published every 6 months. These releases are customized to support a wide range of devices. They are built using older API/SDK versions, so some features are not available for them.
|
||||
|
||||
This table shows the differences between two variants.
|
||||
|
||||
| | Main Release | LTS Release |
|
||||
| :----: | :----: | :----: |
|
||||
| Android API Level | 24 | 21 |
|
||||
| Android Camera Access | x | - |
|
||||
| Android Camera Access | Yes | - |
|
||||
| Android Architectures | arm-v7a-neon<br/>arm64-v8a<br/>x86<br/>x86-64</br> | arm-v7a<br/>arm-v7a-neon<br/>arm64-v8a<br/>x86<br/>x86-64</br> |
|
||||
| IOS SDK | 12.1 | 9.3 |
|
||||
| Xcode Support | 10.1 | 7.3.1 |
|
||||
@@ -292,7 +292,7 @@ This table shows the differences between two variants.
|
||||
1. Use your package manager (apt, yum, dnf, brew, etc.) to install the following packages.
|
||||
|
||||
```
|
||||
autoconf automake libtool pkg-config curl cmake gcc gperf texinfo yasm nasm bison autogen patch
|
||||
autoconf automake libtool pkg-config curl cmake gcc gperf texinfo yasm nasm bison autogen patch git
|
||||
```
|
||||
Some of these packages are not mandatory for the default build.
|
||||
Please visit [Android Prerequisites](https://github.com/tanersener/mobile-ffmpeg/wiki/Android-Prerequisites) and
|
||||
@@ -300,7 +300,7 @@ Please visit [Android Prerequisites](https://github.com/tanersener/mobile-ffmpeg
|
||||
|
||||
2. Android builds require these additional packages.
|
||||
- **Android SDK 5.0 Lollipop (API Level 21)** or later
|
||||
- **Android NDK r17c** or later with LLDB and CMake
|
||||
- **Android NDK r19** or later with LLDB and CMake
|
||||
|
||||
3. IOS builds need these extra packages and tools.
|
||||
- **IOS SDK 8.0.x** or later
|
||||
@@ -354,7 +354,7 @@ prebuilt binaries with `-gpl` postfix are used then MobileFFmpeg is subject to t
|
||||
|
||||
Source code of FFmpeg and external libraries is included in compliance with their individual licenses.
|
||||
|
||||
`strip-frameworks.sh` script included and distributed is published under the [Apache License version 2.0](https://www.apache.org/licenses/LICENSE-2.0).
|
||||
`strip-frameworks.sh` script included and distributed (until v4.x) is published under the [Apache License version 2.0](https://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
||||
In test applications, fonts embedded are licensed under the [SIL Open Font License](https://opensource.org/licenses/OFL-1.1); other digital assets are published in the public domain.
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ skip_library() {
|
||||
}
|
||||
|
||||
enable_debug() {
|
||||
export MOBILE_FFMPEG_DEBUG="-DDEBUG -g"
|
||||
export MOBILE_FFMPEG_DEBUG="-g"
|
||||
|
||||
BUILD_TYPE_ID+="debug "
|
||||
}
|
||||
@@ -459,9 +459,19 @@ print_enabled_libraries() {
|
||||
|
||||
build_application_mk() {
|
||||
if [[ ! -z ${MOBILE_FFMPEG_LTS_BUILD} ]]; then
|
||||
local LTS_BUILD__FLAG="-DMOBILE_FFMPEG_LTS "
|
||||
local LTS_BUILD_FLAG="-DMOBILE_FFMPEG_LTS "
|
||||
fi
|
||||
|
||||
if [[ ${ENABLED_LIBRARIES[$LIBRARY_X265]} -eq 1 ]] || [[ ${ENABLED_LIBRARIES[$LIBRARY_TESSERACT]} -eq 1 ]]; then
|
||||
local APP_STL="c++_shared"
|
||||
else
|
||||
local APP_STL="none"
|
||||
|
||||
${SED_INLINE} 's/c++_shared //g' ${BASEDIR}/android/jni/Android.mk 1>>${BASEDIR}/build.log 2>&1
|
||||
fi
|
||||
|
||||
local BUILD_DATE="-DMOBILE_FFMPEG_BUILD_DATE=$(date +%Y%m%d 2>>${BASEDIR}/build.log)"
|
||||
|
||||
rm -f ${BASEDIR}/android/jni/Application.mk
|
||||
|
||||
cat > "${BASEDIR}/android/jni/Application.mk" << EOF
|
||||
@@ -469,11 +479,11 @@ APP_OPTIM := release
|
||||
|
||||
APP_ABI := ${ANDROID_ARCHITECTURES}
|
||||
|
||||
APP_STL := c++_shared
|
||||
APP_STL := ${APP_STL}
|
||||
|
||||
APP_PLATFORM := android-${API}
|
||||
|
||||
APP_CFLAGS := -O3 -DANDROID ${LTS_BUILD__FLAG}-Wall -Wno-deprecated-declarations -Wno-pointer-sign -Wno-switch -Wno-unused-result -Wno-unused-variable
|
||||
APP_CFLAGS := -O3 -DANDROID ${LTS_BUILD_FLAG}${BUILD_DATE} -Wall -Wno-deprecated-declarations -Wno-pointer-sign -Wno-switch -Wno-unused-result -Wno-unused-variable
|
||||
EOF
|
||||
}
|
||||
|
||||
@@ -483,6 +493,7 @@ EOF
|
||||
DETECTED_NDK_VERSION=$(grep -Eo Revision.* ${ANDROID_NDK_ROOT}/source.properties | sed 's/Revision//g;s/=//g;s/ //g')
|
||||
|
||||
echo -e "\nINFO: Using Android NDK v${DETECTED_NDK_VERSION} provided at ${ANDROID_NDK_ROOT}\n" 1>>${BASEDIR}/build.log 2>&1
|
||||
echo -e "INFO: Build options: $@\n" 1>>${BASEDIR}/build.log 2>&1
|
||||
|
||||
# CLEAR OLD NATIVE LIBS
|
||||
rm -rf ${BASEDIR}/android/libs 1>>${BASEDIR}/build.log 2>&1
|
||||
@@ -492,6 +503,7 @@ GPL_ENABLED="no"
|
||||
DISPLAY_HELP=""
|
||||
BUILD_LTS=""
|
||||
BUILD_TYPE_ID=""
|
||||
BUILD_VERSION=$(git describe --tags 2>>${BASEDIR}/build.log)
|
||||
|
||||
while [ ! $# -eq 0 ]
|
||||
do
|
||||
@@ -578,7 +590,7 @@ if [[ -z ${ANDROID_NDK_ROOT} ]]; then
|
||||
fi
|
||||
|
||||
echo -e "Building mobile-ffmpeg ${BUILD_TYPE_ID}library for Android\n"
|
||||
echo -e -n "INFO: Building mobile-ffmpeg ${BUILD_TYPE_ID}library for Android: " 1>>${BASEDIR}/build.log 2>&1
|
||||
echo -e -n "INFO: Building mobile-ffmpeg ${BUILD_VERSION} ${BUILD_TYPE_ID}library for Android: " 1>>${BASEDIR}/build.log 2>&1
|
||||
echo -e `date` 1>>${BASEDIR}/build.log 2>&1
|
||||
|
||||
# PERFORM THIS CHECK ONLY ON LTS
|
||||
@@ -613,9 +625,6 @@ do
|
||||
fi
|
||||
done
|
||||
|
||||
# CLEANING PREVIOUSLY COPIED c++_shared.so FILES
|
||||
rm -rf ${BASEDIR}/prebuilt/android-cpp-shared 1>>${BASEDIR}/build.log 2>&1
|
||||
|
||||
for run_arch in {0..4}
|
||||
do
|
||||
if [[ ${ENABLED_ARCHITECTURES[$run_arch]} -eq 1 ]]; then
|
||||
@@ -623,19 +632,6 @@ do
|
||||
export TOOLCHAIN=$(get_toolchain)
|
||||
export TOOLCHAIN_ARCH=$(get_toolchain_arch)
|
||||
|
||||
create_toolchain || exit 1
|
||||
|
||||
# COPY libc++_shared.so FROM EACH TOOLCHAIN
|
||||
mkdir -p ${BASEDIR}/prebuilt/android-cpp-shared/${TOOLCHAIN_ARCH}
|
||||
|
||||
if [[ $run_arch -eq 0 ]] || [[ $run_arch -eq 1 ]]; then
|
||||
cp ${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/$(get_target_host)/lib/armv7-a/libc++_shared.so ${BASEDIR}/prebuilt/android-cpp-shared/${TOOLCHAIN_ARCH} 1>>${BASEDIR}/build.log 2>&1
|
||||
elif [[ $run_arch -eq 4 ]]; then
|
||||
cp ${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/$(get_target_host)/lib64/libc++_shared.so ${BASEDIR}/prebuilt/android-cpp-shared/${TOOLCHAIN_ARCH} 1>>${BASEDIR}/build.log 2>&1
|
||||
else
|
||||
cp ${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/$(get_target_host)/lib/libc++_shared.so ${BASEDIR}/prebuilt/android-cpp-shared/${TOOLCHAIN_ARCH} 1>>${BASEDIR}/build.log 2>&1
|
||||
fi
|
||||
|
||||
. ${BASEDIR}/build/main-android.sh "${ENABLED_LIBRARIES[@]}" || exit 1
|
||||
|
||||
# CLEAR FLAGS
|
||||
@@ -701,7 +697,7 @@ if [[ ! -z ${ANDROID_ARCHITECTURES} ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cp ${BASEDIR}/android/app/build/outputs/aar/mobile-ffmpeg-*.aar ${MOBILE_FFMPEG_AAR}/mobile-ffmpeg.aar 1>>${BASEDIR}/build.log 2>&1
|
||||
cp ${BASEDIR}/android/app/build/outputs/aar/mobile-ffmpeg.aar ${MOBILE_FFMPEG_AAR}/mobile-ffmpeg.aar 1>>${BASEDIR}/build.log 2>&1
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "failed\n"
|
||||
|
||||
@@ -38,7 +38,7 @@ PROJECT_NAME = "MobileFFmpeg Android API"
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = 4.2
|
||||
PROJECT_NUMBER = 4.2.1
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdkVersion 27
|
||||
compileSdkVersion 28
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 27
|
||||
versionCode 240420
|
||||
versionName "4.2"
|
||||
targetSdkVersion 28
|
||||
versionCode 240421
|
||||
versionName "4.2.1"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
project.archivesBaseName = "mobile-ffmpeg"
|
||||
}
|
||||
@@ -53,7 +53,7 @@ afterEvaluate {
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation 'com.android.support:appcompat-v7:27.1.1'
|
||||
implementation 'com.android.support:appcompat-v7:28.0.0'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
||||
|
||||
@@ -3,9 +3,7 @@
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"/>
|
||||
</manifest>
|
||||
|
||||
@@ -191,7 +191,7 @@ void show_help_options(const OptionDef *options, const char *msg, int req_flags,
|
||||
continue;
|
||||
|
||||
if (first) {
|
||||
printf("%s\n", msg);
|
||||
av_log(NULL, AV_LOG_INFO, "%s\n", msg);
|
||||
first = 0;
|
||||
}
|
||||
av_strlcpy(buf, po->name, sizeof(buf));
|
||||
@@ -199,9 +199,9 @@ void show_help_options(const OptionDef *options, const char *msg, int req_flags,
|
||||
av_strlcat(buf, " ", sizeof(buf));
|
||||
av_strlcat(buf, po->argname, sizeof(buf));
|
||||
}
|
||||
printf("-%-17s %s\n", buf, po->help);
|
||||
av_log(NULL, AV_LOG_INFO, "-%-17s %s\n", buf, po->help);
|
||||
}
|
||||
printf("\n");
|
||||
av_log(NULL, AV_LOG_INFO, "\n");
|
||||
}
|
||||
|
||||
void show_help_children(const AVClass *class, int flags)
|
||||
@@ -209,7 +209,7 @@ void show_help_children(const AVClass *class, int flags)
|
||||
const AVClass *child = NULL;
|
||||
if (class->option) {
|
||||
av_opt_show2(&class, NULL, flags, 0);
|
||||
printf("\n");
|
||||
av_log(NULL, AV_LOG_INFO, "\n");
|
||||
}
|
||||
|
||||
while ((child = av_opt_child_class_next(class, child)))
|
||||
@@ -1214,12 +1214,12 @@ int show_buildconf(void *optctx, const char *opt, const char *arg)
|
||||
int show_license(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
#if CONFIG_NONFREE
|
||||
printf(
|
||||
av_log(NULL, AV_LOG_INFO,
|
||||
"This version of %s has nonfree parts compiled in.\n"
|
||||
"Therefore it is not legally redistributable.\n",
|
||||
program_name );
|
||||
#elif CONFIG_GPLV3
|
||||
printf(
|
||||
av_log(NULL, AV_LOG_INFO,
|
||||
"%s is free software; you can redistribute it and/or modify\n"
|
||||
"it under the terms of the GNU General Public License as published by\n"
|
||||
"the Free Software Foundation; either version 3 of the License, or\n"
|
||||
@@ -1234,7 +1234,7 @@ int show_license(void *optctx, const char *opt, const char *arg)
|
||||
"along with %s. If not, see <http://www.gnu.org/licenses/>.\n",
|
||||
program_name, program_name, program_name );
|
||||
#elif CONFIG_GPL
|
||||
printf(
|
||||
av_log(NULL, AV_LOG_INFO,
|
||||
"%s is free software; you can redistribute it and/or modify\n"
|
||||
"it under the terms of the GNU General Public License as published by\n"
|
||||
"the Free Software Foundation; either version 2 of the License, or\n"
|
||||
@@ -1250,7 +1250,7 @@ int show_license(void *optctx, const char *opt, const char *arg)
|
||||
"Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n",
|
||||
program_name, program_name, program_name );
|
||||
#elif CONFIG_LGPLV3
|
||||
printf(
|
||||
av_log(NULL, AV_LOG_INFO,
|
||||
"%s is free software; you can redistribute it and/or modify\n"
|
||||
"it under the terms of the GNU Lesser General Public License as published by\n"
|
||||
"the Free Software Foundation; either version 3 of the License, or\n"
|
||||
@@ -1265,7 +1265,7 @@ int show_license(void *optctx, const char *opt, const char *arg)
|
||||
"along with %s. If not, see <http://www.gnu.org/licenses/>.\n",
|
||||
program_name, program_name, program_name );
|
||||
#else
|
||||
printf(
|
||||
av_log(NULL, AV_LOG_INFO,
|
||||
"%s is free software; you can redistribute it and/or\n"
|
||||
"modify it under the terms of the GNU Lesser General Public\n"
|
||||
"License as published by the Free Software Foundation; either\n"
|
||||
@@ -1301,7 +1301,7 @@ static int show_formats_devices(void *optctx, const char *opt, const char *arg,
|
||||
const char *last_name;
|
||||
int is_dev;
|
||||
|
||||
printf("%s\n"
|
||||
av_log(NULL, AV_LOG_INFO, "%s\n"
|
||||
" D. = Demuxing supported\n"
|
||||
" .E = Muxing supported\n"
|
||||
" --\n", device_only ? "Devices:" : "File formats:");
|
||||
@@ -1346,7 +1346,7 @@ static int show_formats_devices(void *optctx, const char *opt, const char *arg,
|
||||
break;
|
||||
last_name = name;
|
||||
|
||||
printf(" %s%s %-15s %s\n",
|
||||
av_log(NULL, AV_LOG_INFO, " %s%s %-15s %s\n",
|
||||
decode ? "D" : " ",
|
||||
encode ? "E" : " ",
|
||||
name,
|
||||
@@ -1379,97 +1379,97 @@ int show_devices(void *optctx, const char *opt, const char *arg)
|
||||
if (codec->field) { \
|
||||
const type *p = codec->field; \
|
||||
\
|
||||
printf(" Supported " list_name ":"); \
|
||||
av_log(NULL, AV_LOG_INFO, " Supported " list_name ":"); \
|
||||
while (*p != term) { \
|
||||
get_name(*p); \
|
||||
printf(" %s", name); \
|
||||
av_log(NULL, AV_LOG_INFO, " %s", name); \
|
||||
p++; \
|
||||
} \
|
||||
printf("\n"); \
|
||||
av_log(NULL, AV_LOG_INFO, "\n"); \
|
||||
} \
|
||||
|
||||
static void print_codec(const AVCodec *c)
|
||||
{
|
||||
int encoder = av_codec_is_encoder(c);
|
||||
|
||||
printf("%s %s [%s]:\n", encoder ? "Encoder" : "Decoder", c->name,
|
||||
av_log(NULL, AV_LOG_INFO, "%s %s [%s]:\n", encoder ? "Encoder" : "Decoder", c->name,
|
||||
c->long_name ? c->long_name : "");
|
||||
|
||||
printf(" General capabilities: ");
|
||||
av_log(NULL, AV_LOG_INFO, " General capabilities: ");
|
||||
if (c->capabilities & AV_CODEC_CAP_DRAW_HORIZ_BAND)
|
||||
printf("horizband ");
|
||||
av_log(NULL, AV_LOG_INFO, "horizband ");
|
||||
if (c->capabilities & AV_CODEC_CAP_DR1)
|
||||
printf("dr1 ");
|
||||
av_log(NULL, AV_LOG_INFO, "dr1 ");
|
||||
if (c->capabilities & AV_CODEC_CAP_TRUNCATED)
|
||||
printf("trunc ");
|
||||
av_log(NULL, AV_LOG_INFO, "trunc ");
|
||||
if (c->capabilities & AV_CODEC_CAP_DELAY)
|
||||
printf("delay ");
|
||||
av_log(NULL, AV_LOG_INFO, "delay ");
|
||||
if (c->capabilities & AV_CODEC_CAP_SMALL_LAST_FRAME)
|
||||
printf("small ");
|
||||
av_log(NULL, AV_LOG_INFO, "small ");
|
||||
if (c->capabilities & AV_CODEC_CAP_SUBFRAMES)
|
||||
printf("subframes ");
|
||||
av_log(NULL, AV_LOG_INFO, "subframes ");
|
||||
if (c->capabilities & AV_CODEC_CAP_EXPERIMENTAL)
|
||||
printf("exp ");
|
||||
av_log(NULL, AV_LOG_INFO, "exp ");
|
||||
if (c->capabilities & AV_CODEC_CAP_CHANNEL_CONF)
|
||||
printf("chconf ");
|
||||
av_log(NULL, AV_LOG_INFO, "chconf ");
|
||||
if (c->capabilities & AV_CODEC_CAP_PARAM_CHANGE)
|
||||
printf("paramchange ");
|
||||
av_log(NULL, AV_LOG_INFO, "paramchange ");
|
||||
if (c->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE)
|
||||
printf("variable ");
|
||||
av_log(NULL, AV_LOG_INFO, "variable ");
|
||||
if (c->capabilities & (AV_CODEC_CAP_FRAME_THREADS |
|
||||
AV_CODEC_CAP_SLICE_THREADS |
|
||||
AV_CODEC_CAP_AUTO_THREADS))
|
||||
printf("threads ");
|
||||
av_log(NULL, AV_LOG_INFO, "threads ");
|
||||
if (c->capabilities & AV_CODEC_CAP_AVOID_PROBING)
|
||||
printf("avoidprobe ");
|
||||
av_log(NULL, AV_LOG_INFO, "avoidprobe ");
|
||||
if (c->capabilities & AV_CODEC_CAP_INTRA_ONLY)
|
||||
printf("intraonly ");
|
||||
av_log(NULL, AV_LOG_INFO, "intraonly ");
|
||||
if (c->capabilities & AV_CODEC_CAP_LOSSLESS)
|
||||
printf("lossless ");
|
||||
av_log(NULL, AV_LOG_INFO, "lossless ");
|
||||
if (c->capabilities & AV_CODEC_CAP_HARDWARE)
|
||||
printf("hardware ");
|
||||
av_log(NULL, AV_LOG_INFO, "hardware ");
|
||||
if (c->capabilities & AV_CODEC_CAP_HYBRID)
|
||||
printf("hybrid ");
|
||||
av_log(NULL, AV_LOG_INFO, "hybrid ");
|
||||
if (!c->capabilities)
|
||||
printf("none");
|
||||
printf("\n");
|
||||
av_log(NULL, AV_LOG_INFO, "none");
|
||||
av_log(NULL, AV_LOG_INFO, "\n");
|
||||
|
||||
if (c->type == AVMEDIA_TYPE_VIDEO ||
|
||||
c->type == AVMEDIA_TYPE_AUDIO) {
|
||||
printf(" Threading capabilities: ");
|
||||
av_log(NULL, AV_LOG_INFO, " Threading capabilities: ");
|
||||
switch (c->capabilities & (AV_CODEC_CAP_FRAME_THREADS |
|
||||
AV_CODEC_CAP_SLICE_THREADS |
|
||||
AV_CODEC_CAP_AUTO_THREADS)) {
|
||||
case AV_CODEC_CAP_FRAME_THREADS |
|
||||
AV_CODEC_CAP_SLICE_THREADS: printf("frame and slice"); break;
|
||||
case AV_CODEC_CAP_FRAME_THREADS: printf("frame"); break;
|
||||
case AV_CODEC_CAP_SLICE_THREADS: printf("slice"); break;
|
||||
case AV_CODEC_CAP_AUTO_THREADS : printf("auto"); break;
|
||||
default: printf("none"); break;
|
||||
AV_CODEC_CAP_SLICE_THREADS: av_log(NULL, AV_LOG_INFO, "frame and slice"); break;
|
||||
case AV_CODEC_CAP_FRAME_THREADS: av_log(NULL, AV_LOG_INFO, "frame"); break;
|
||||
case AV_CODEC_CAP_SLICE_THREADS: av_log(NULL, AV_LOG_INFO, "slice"); break;
|
||||
case AV_CODEC_CAP_AUTO_THREADS : av_log(NULL, AV_LOG_INFO, "auto"); break;
|
||||
default: av_log(NULL, AV_LOG_INFO, "none"); break;
|
||||
}
|
||||
printf("\n");
|
||||
av_log(NULL, AV_LOG_INFO, "\n");
|
||||
}
|
||||
|
||||
if (avcodec_get_hw_config(c, 0)) {
|
||||
printf(" Supported hardware devices: ");
|
||||
av_log(NULL, AV_LOG_INFO, " Supported hardware devices: ");
|
||||
for (int i = 0;; i++) {
|
||||
const AVCodecHWConfig *config = avcodec_get_hw_config(c, i);
|
||||
if (!config)
|
||||
break;
|
||||
printf("%s ", av_hwdevice_get_type_name(config->device_type));
|
||||
av_log(NULL, AV_LOG_INFO, "%s ", av_hwdevice_get_type_name(config->device_type));
|
||||
}
|
||||
printf("\n");
|
||||
av_log(NULL, AV_LOG_INFO, "\n");
|
||||
}
|
||||
|
||||
if (c->supported_framerates) {
|
||||
const AVRational *fps = c->supported_framerates;
|
||||
|
||||
printf(" Supported framerates:");
|
||||
av_log(NULL, AV_LOG_INFO, " Supported framerates:");
|
||||
while (fps->num) {
|
||||
printf(" %d/%d", fps->num, fps->den);
|
||||
av_log(NULL, AV_LOG_INFO, " %d/%d", fps->num, fps->den);
|
||||
fps++;
|
||||
}
|
||||
printf("\n");
|
||||
av_log(NULL, AV_LOG_INFO, "\n");
|
||||
}
|
||||
PRINT_CODEC_SUPPORTED(c, pix_fmts, enum AVPixelFormat, "pixel formats",
|
||||
AV_PIX_FMT_NONE, GET_PIX_FMT_NAME);
|
||||
@@ -1544,12 +1544,12 @@ static void print_codecs_for_id(enum AVCodecID id, int encoder)
|
||||
{
|
||||
const AVCodec *codec = NULL;
|
||||
|
||||
printf(" (%s: ", encoder ? "encoders" : "decoders");
|
||||
av_log(NULL, AV_LOG_INFO, " (%s: ", encoder ? "encoders" : "decoders");
|
||||
|
||||
while ((codec = next_codec_for_id(id, codec, encoder)))
|
||||
printf("%s ", codec->name);
|
||||
av_log(NULL, AV_LOG_INFO, "%s ", codec->name);
|
||||
|
||||
printf(")");
|
||||
av_log(NULL, AV_LOG_INFO, ")");
|
||||
}
|
||||
|
||||
int show_codecs(void *optctx, const char *opt, const char *arg)
|
||||
@@ -1557,7 +1557,7 @@ int show_codecs(void *optctx, const char *opt, const char *arg)
|
||||
const AVCodecDescriptor **codecs;
|
||||
unsigned i, nb_codecs = get_codecs_sorted(&codecs);
|
||||
|
||||
printf("Codecs:\n"
|
||||
av_log(NULL, AV_LOG_INFO, "Codecs:\n"
|
||||
" D..... = Decoding supported\n"
|
||||
" .E.... = Encoding supported\n"
|
||||
" ..V... = Video codec\n"
|
||||
@@ -1574,16 +1574,16 @@ int show_codecs(void *optctx, const char *opt, const char *arg)
|
||||
if (strstr(desc->name, "_deprecated"))
|
||||
continue;
|
||||
|
||||
printf(" ");
|
||||
printf(avcodec_find_decoder(desc->id) ? "D" : ".");
|
||||
printf(avcodec_find_encoder(desc->id) ? "E" : ".");
|
||||
av_log(NULL, AV_LOG_INFO, " ");
|
||||
av_log(NULL, AV_LOG_INFO, avcodec_find_decoder(desc->id) ? "D" : ".");
|
||||
av_log(NULL, AV_LOG_INFO, avcodec_find_encoder(desc->id) ? "E" : ".");
|
||||
|
||||
printf("%c", get_media_type_char(desc->type));
|
||||
printf((desc->props & AV_CODEC_PROP_INTRA_ONLY) ? "I" : ".");
|
||||
printf((desc->props & AV_CODEC_PROP_LOSSY) ? "L" : ".");
|
||||
printf((desc->props & AV_CODEC_PROP_LOSSLESS) ? "S" : ".");
|
||||
av_log(NULL, AV_LOG_INFO, "%c", get_media_type_char(desc->type));
|
||||
av_log(NULL, AV_LOG_INFO, (desc->props & AV_CODEC_PROP_INTRA_ONLY) ? "I" : ".");
|
||||
av_log(NULL, AV_LOG_INFO, (desc->props & AV_CODEC_PROP_LOSSY) ? "L" : ".");
|
||||
av_log(NULL, AV_LOG_INFO, (desc->props & AV_CODEC_PROP_LOSSLESS) ? "S" : ".");
|
||||
|
||||
printf(" %-20s %s", desc->name, desc->long_name ? desc->long_name : "");
|
||||
av_log(NULL, AV_LOG_INFO, " %-20s %s", desc->name, desc->long_name ? desc->long_name : "");
|
||||
|
||||
/* print decoders/encoders when there's more than one or their
|
||||
* names are different from codec name */
|
||||
@@ -1601,7 +1601,7 @@ int show_codecs(void *optctx, const char *opt, const char *arg)
|
||||
}
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
av_log(NULL, AV_LOG_INFO, "\n");
|
||||
}
|
||||
av_free(codecs);
|
||||
return 0;
|
||||
@@ -1612,7 +1612,7 @@ static void print_codecs(int encoder)
|
||||
const AVCodecDescriptor **codecs;
|
||||
unsigned i, nb_codecs = get_codecs_sorted(&codecs);
|
||||
|
||||
printf("%s:\n"
|
||||
av_log(NULL, AV_LOG_INFO, "%s:\n"
|
||||
" V..... = Video\n"
|
||||
" A..... = Audio\n"
|
||||
" S..... = Subtitle\n"
|
||||
@@ -1628,18 +1628,18 @@ static void print_codecs(int encoder)
|
||||
const AVCodec *codec = NULL;
|
||||
|
||||
while ((codec = next_codec_for_id(desc->id, codec, encoder))) {
|
||||
printf(" %c", get_media_type_char(desc->type));
|
||||
printf((codec->capabilities & AV_CODEC_CAP_FRAME_THREADS) ? "F" : ".");
|
||||
printf((codec->capabilities & AV_CODEC_CAP_SLICE_THREADS) ? "S" : ".");
|
||||
printf((codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL) ? "X" : ".");
|
||||
printf((codec->capabilities & AV_CODEC_CAP_DRAW_HORIZ_BAND)?"B" : ".");
|
||||
printf((codec->capabilities & AV_CODEC_CAP_DR1) ? "D" : ".");
|
||||
av_log(NULL, AV_LOG_INFO, " %c", get_media_type_char(desc->type));
|
||||
av_log(NULL, AV_LOG_INFO, (codec->capabilities & AV_CODEC_CAP_FRAME_THREADS) ? "F" : ".");
|
||||
av_log(NULL, AV_LOG_INFO, (codec->capabilities & AV_CODEC_CAP_SLICE_THREADS) ? "S" : ".");
|
||||
av_log(NULL, AV_LOG_INFO, (codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL) ? "X" : ".");
|
||||
av_log(NULL, AV_LOG_INFO, (codec->capabilities & AV_CODEC_CAP_DRAW_HORIZ_BAND)?"B" : ".");
|
||||
av_log(NULL, AV_LOG_INFO, (codec->capabilities & AV_CODEC_CAP_DR1) ? "D" : ".");
|
||||
|
||||
printf(" %-20s %s", codec->name, codec->long_name ? codec->long_name : "");
|
||||
av_log(NULL, AV_LOG_INFO, " %-20s %s", codec->name, codec->long_name ? codec->long_name : "");
|
||||
if (strcmp(codec->name, desc->name))
|
||||
printf(" (codec %s)", desc->name);
|
||||
av_log(NULL, AV_LOG_INFO, " (codec %s)", desc->name);
|
||||
|
||||
printf("\n");
|
||||
av_log(NULL, AV_LOG_INFO, "\n");
|
||||
}
|
||||
}
|
||||
av_free(codecs);
|
||||
@@ -1662,10 +1662,10 @@ int show_bsfs(void *optctx, const char *opt, const char *arg)
|
||||
const AVBitStreamFilter *bsf = NULL;
|
||||
void *opaque = NULL;
|
||||
|
||||
printf("Bitstream filters:\n");
|
||||
av_log(NULL, AV_LOG_INFO, "Bitstream filters:\n");
|
||||
while ((bsf = av_bsf_iterate(&opaque)))
|
||||
printf("%s\n", bsf->name);
|
||||
printf("\n");
|
||||
av_log(NULL, AV_LOG_INFO, "%s\n", bsf->name);
|
||||
av_log(NULL, AV_LOG_INFO, "\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1674,13 +1674,13 @@ int show_protocols(void *optctx, const char *opt, const char *arg)
|
||||
void *opaque = NULL;
|
||||
const char *name;
|
||||
|
||||
printf("Supported file protocols:\n"
|
||||
av_log(NULL, AV_LOG_INFO, "Supported file protocols:\n"
|
||||
"Input:\n");
|
||||
while ((name = avio_enum_protocols(&opaque, 0)))
|
||||
printf(" %s\n", name);
|
||||
printf("Output:\n");
|
||||
av_log(NULL, AV_LOG_INFO, " %s\n", name);
|
||||
av_log(NULL, AV_LOG_INFO, "Output:\n");
|
||||
while ((name = avio_enum_protocols(&opaque, 1)))
|
||||
printf(" %s\n", name);
|
||||
av_log(NULL, AV_LOG_INFO, " %s\n", name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1693,7 +1693,7 @@ int show_filters(void *optctx, const char *opt, const char *arg)
|
||||
int i, j;
|
||||
const AVFilterPad *pad;
|
||||
|
||||
printf("Filters:\n"
|
||||
av_log(NULL, AV_LOG_INFO, "Filters:\n"
|
||||
" T.. = Timeline support\n"
|
||||
" .S. = Slice threading\n"
|
||||
" ..C = Command support\n"
|
||||
@@ -1719,14 +1719,14 @@ int show_filters(void *optctx, const char *opt, const char *arg)
|
||||
( i && (filter->flags & AVFILTER_FLAG_DYNAMIC_OUTPUTS))) ? 'N' : '|';
|
||||
}
|
||||
*descr_cur = 0;
|
||||
printf(" %c%c%c %-17s %-10s %s\n",
|
||||
av_log(NULL, AV_LOG_INFO, " %c%c%c %-17s %-10s %s\n",
|
||||
filter->flags & AVFILTER_FLAG_SUPPORT_TIMELINE ? 'T' : '.',
|
||||
filter->flags & AVFILTER_FLAG_SLICE_THREADS ? 'S' : '.',
|
||||
filter->process_command ? 'C' : '.',
|
||||
filter->name, descr, filter->description);
|
||||
}
|
||||
#else
|
||||
printf("No filters available: libavfilter disabled\n");
|
||||
av_log(NULL, AV_LOG_INFO, "No filters available: libavfilter disabled\n");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
@@ -1737,10 +1737,10 @@ int show_colors(void *optctx, const char *opt, const char *arg)
|
||||
const uint8_t *rgb;
|
||||
int i;
|
||||
|
||||
printf("%-32s #RRGGBB\n", "name");
|
||||
av_log(NULL, AV_LOG_INFO, "%-32s #RRGGBB\n", "name");
|
||||
|
||||
for (i = 0; (name = av_get_known_color_name(i, &rgb)); i++)
|
||||
printf("%-32s #%02x%02x%02x\n", name, rgb[0], rgb[1], rgb[2]);
|
||||
av_log(NULL, AV_LOG_INFO, "%-32s #%02x%02x%02x\n", name, rgb[0], rgb[1], rgb[2]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1749,7 +1749,7 @@ int show_pix_fmts(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
const AVPixFmtDescriptor *pix_desc = NULL;
|
||||
|
||||
printf("Pixel formats:\n"
|
||||
av_log(NULL, AV_LOG_INFO, "Pixel formats:\n"
|
||||
"I.... = Supported Input format for conversion\n"
|
||||
".O... = Supported Output format for conversion\n"
|
||||
"..H.. = Hardware accelerated format\n"
|
||||
@@ -1765,7 +1765,7 @@ int show_pix_fmts(void *optctx, const char *opt, const char *arg)
|
||||
|
||||
while ((pix_desc = av_pix_fmt_desc_next(pix_desc))) {
|
||||
enum AVPixelFormat av_unused pix_fmt = av_pix_fmt_desc_get_id(pix_desc);
|
||||
printf("%c%c%c%c%c %-16s %d %2d\n",
|
||||
av_log(NULL, AV_LOG_INFO, "%c%c%c%c%c %-16s %d %2d\n",
|
||||
sws_isSupportedInput (pix_fmt) ? 'I' : '.',
|
||||
sws_isSupportedOutput(pix_fmt) ? 'O' : '.',
|
||||
pix_desc->flags & AV_PIX_FMT_FLAG_HWACCEL ? 'H' : '.',
|
||||
@@ -1784,24 +1784,24 @@ int show_layouts(void *optctx, const char *opt, const char *arg)
|
||||
uint64_t layout, j;
|
||||
const char *name, *descr;
|
||||
|
||||
printf("Individual channels:\n"
|
||||
av_log(NULL, AV_LOG_INFO, "Individual channels:\n"
|
||||
"NAME DESCRIPTION\n");
|
||||
for (i = 0; i < 63; i++) {
|
||||
name = av_get_channel_name((uint64_t)1 << i);
|
||||
if (!name)
|
||||
continue;
|
||||
descr = av_get_channel_description((uint64_t)1 << i);
|
||||
printf("%-14s %s\n", name, descr);
|
||||
av_log(NULL, AV_LOG_INFO, "%-14s %s\n", name, descr);
|
||||
}
|
||||
printf("\nStandard channel layouts:\n"
|
||||
av_log(NULL, AV_LOG_INFO, "\nStandard channel layouts:\n"
|
||||
"NAME DECOMPOSITION\n");
|
||||
for (i = 0; !av_get_standard_channel_layout(i, &layout, &name); i++) {
|
||||
if (name) {
|
||||
printf("%-14s ", name);
|
||||
av_log(NULL, AV_LOG_INFO, "%-14s ", name);
|
||||
for (j = 1; j; j <<= 1)
|
||||
if ((layout & j))
|
||||
printf("%s%s", (layout & (j - 1)) ? "+" : "", av_get_channel_name(j));
|
||||
printf("\n");
|
||||
av_log(NULL, AV_LOG_INFO, "%s%s", (layout & (j - 1)) ? "+" : "", av_get_channel_name(j));
|
||||
av_log(NULL, AV_LOG_INFO, "\n");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@@ -1812,7 +1812,7 @@ int show_sample_fmts(void *optctx, const char *opt, const char *arg)
|
||||
int i;
|
||||
char fmt_str[128];
|
||||
for (i = -1; i < AV_SAMPLE_FMT_NB; i++)
|
||||
printf("%s\n", av_get_sample_fmt_string(fmt_str, sizeof(fmt_str), i));
|
||||
av_log(NULL, AV_LOG_INFO, "%s\n", av_get_sample_fmt_string(fmt_str, sizeof(fmt_str), i));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1860,10 +1860,10 @@ static void show_help_demuxer(const char *name)
|
||||
return;
|
||||
}
|
||||
|
||||
printf("Demuxer %s [%s]:\n", fmt->name, fmt->long_name);
|
||||
av_log(NULL, AV_LOG_INFO, "Demuxer %s [%s]:\n", fmt->name, fmt->long_name);
|
||||
|
||||
if (fmt->extensions)
|
||||
printf(" Common extensions: %s.\n", fmt->extensions);
|
||||
av_log(NULL, AV_LOG_INFO, " Common extensions: %s.\n", fmt->extensions);
|
||||
|
||||
if (fmt->priv_class)
|
||||
show_help_children(fmt->priv_class, AV_OPT_FLAG_DECODING_PARAM);
|
||||
@@ -1879,23 +1879,23 @@ static void show_help_muxer(const char *name)
|
||||
return;
|
||||
}
|
||||
|
||||
printf("Muxer %s [%s]:\n", fmt->name, fmt->long_name);
|
||||
av_log(NULL, AV_LOG_INFO, "Muxer %s [%s]:\n", fmt->name, fmt->long_name);
|
||||
|
||||
if (fmt->extensions)
|
||||
printf(" Common extensions: %s.\n", fmt->extensions);
|
||||
av_log(NULL, AV_LOG_INFO, " Common extensions: %s.\n", fmt->extensions);
|
||||
if (fmt->mime_type)
|
||||
printf(" Mime type: %s.\n", fmt->mime_type);
|
||||
av_log(NULL, AV_LOG_INFO, " Mime type: %s.\n", fmt->mime_type);
|
||||
if (fmt->video_codec != AV_CODEC_ID_NONE &&
|
||||
(desc = avcodec_descriptor_get(fmt->video_codec))) {
|
||||
printf(" Default video codec: %s.\n", desc->name);
|
||||
av_log(NULL, AV_LOG_INFO, " Default video codec: %s.\n", desc->name);
|
||||
}
|
||||
if (fmt->audio_codec != AV_CODEC_ID_NONE &&
|
||||
(desc = avcodec_descriptor_get(fmt->audio_codec))) {
|
||||
printf(" Default audio codec: %s.\n", desc->name);
|
||||
av_log(NULL, AV_LOG_INFO, " Default audio codec: %s.\n", desc->name);
|
||||
}
|
||||
if (fmt->subtitle_codec != AV_CODEC_ID_NONE &&
|
||||
(desc = avcodec_descriptor_get(fmt->subtitle_codec))) {
|
||||
printf(" Default subtitle codec: %s.\n", desc->name);
|
||||
av_log(NULL, AV_LOG_INFO, " Default subtitle codec: %s.\n", desc->name);
|
||||
}
|
||||
|
||||
if (fmt->priv_class)
|
||||
@@ -1917,40 +1917,40 @@ static void show_help_filter(const char *name)
|
||||
return;
|
||||
}
|
||||
|
||||
printf("Filter %s\n", f->name);
|
||||
av_log(NULL, AV_LOG_INFO, "Filter %s\n", f->name);
|
||||
if (f->description)
|
||||
printf(" %s\n", f->description);
|
||||
av_log(NULL, AV_LOG_INFO, " %s\n", f->description);
|
||||
|
||||
if (f->flags & AVFILTER_FLAG_SLICE_THREADS)
|
||||
printf(" slice threading supported\n");
|
||||
av_log(NULL, AV_LOG_INFO, " slice threading supported\n");
|
||||
|
||||
printf(" Inputs:\n");
|
||||
av_log(NULL, AV_LOG_INFO, " Inputs:\n");
|
||||
count = avfilter_pad_count(f->inputs);
|
||||
for (i = 0; i < count; i++) {
|
||||
printf(" #%d: %s (%s)\n", i, avfilter_pad_get_name(f->inputs, i),
|
||||
av_log(NULL, AV_LOG_INFO, " #%d: %s (%s)\n", i, avfilter_pad_get_name(f->inputs, i),
|
||||
media_type_string(avfilter_pad_get_type(f->inputs, i)));
|
||||
}
|
||||
if (f->flags & AVFILTER_FLAG_DYNAMIC_INPUTS)
|
||||
printf(" dynamic (depending on the options)\n");
|
||||
av_log(NULL, AV_LOG_INFO, " dynamic (depending on the options)\n");
|
||||
else if (!count)
|
||||
printf(" none (source filter)\n");
|
||||
av_log(NULL, AV_LOG_INFO, " none (source filter)\n");
|
||||
|
||||
printf(" Outputs:\n");
|
||||
av_log(NULL, AV_LOG_INFO, " Outputs:\n");
|
||||
count = avfilter_pad_count(f->outputs);
|
||||
for (i = 0; i < count; i++) {
|
||||
printf(" #%d: %s (%s)\n", i, avfilter_pad_get_name(f->outputs, i),
|
||||
av_log(NULL, AV_LOG_INFO, " #%d: %s (%s)\n", i, avfilter_pad_get_name(f->outputs, i),
|
||||
media_type_string(avfilter_pad_get_type(f->outputs, i)));
|
||||
}
|
||||
if (f->flags & AVFILTER_FLAG_DYNAMIC_OUTPUTS)
|
||||
printf(" dynamic (depending on the options)\n");
|
||||
av_log(NULL, AV_LOG_INFO, " dynamic (depending on the options)\n");
|
||||
else if (!count)
|
||||
printf(" none (sink filter)\n");
|
||||
av_log(NULL, AV_LOG_INFO, " none (sink filter)\n");
|
||||
|
||||
if (f->priv_class)
|
||||
show_help_children(f->priv_class, AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM |
|
||||
AV_OPT_FLAG_AUDIO_PARAM);
|
||||
if (f->flags & AVFILTER_FLAG_SUPPORT_TIMELINE)
|
||||
printf("This filter has support for timeline through the 'enable' option.\n");
|
||||
av_log(NULL, AV_LOG_INFO, "This filter has support for timeline through the 'enable' option.\n");
|
||||
#else
|
||||
av_log(NULL, AV_LOG_ERROR, "Build without libavfilter; "
|
||||
"can not to satisfy request\n");
|
||||
@@ -1970,7 +1970,7 @@ static void show_help_bsf(const char *name)
|
||||
return;
|
||||
}
|
||||
|
||||
printf("Bit stream filter %s\n", bsf->name);
|
||||
av_log(NULL, AV_LOG_INFO, "Bit stream filter %s\n", bsf->name);
|
||||
PRINT_CODEC_SUPPORTED(bsf, codec_ids, enum AVCodecID, "codecs",
|
||||
AV_CODEC_ID_NONE, GET_CODEC_NAME);
|
||||
if (bsf->priv_class)
|
||||
@@ -2206,20 +2206,20 @@ static int print_device_sources(AVInputFormat *fmt, AVDictionary *opts)
|
||||
if (!fmt || !fmt->priv_class || !AV_IS_INPUT_DEVICE(fmt->priv_class->category))
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
printf("Auto-detected sources for %s:\n", fmt->name);
|
||||
av_log(NULL, AV_LOG_INFO, "Auto-detected sources for %s:\n", fmt->name);
|
||||
if (!fmt->get_device_list) {
|
||||
ret = AVERROR(ENOSYS);
|
||||
printf("Cannot list sources. Not implemented.\n");
|
||||
av_log(NULL, AV_LOG_INFO, "Cannot list sources. Not implemented.\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if ((ret = avdevice_list_input_sources(fmt, NULL, opts, &device_list)) < 0) {
|
||||
printf("Cannot list sources.\n");
|
||||
av_log(NULL, AV_LOG_INFO, "Cannot list sources.\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
for (i = 0; i < device_list->nb_devices; i++) {
|
||||
printf("%s %s [%s]\n", device_list->default_device == i ? "*" : " ",
|
||||
av_log(NULL, AV_LOG_INFO, "%s %s [%s]\n", device_list->default_device == i ? "*" : " ",
|
||||
device_list->devices[i]->device_name, device_list->devices[i]->device_description);
|
||||
}
|
||||
|
||||
@@ -2236,20 +2236,20 @@ static int print_device_sinks(AVOutputFormat *fmt, AVDictionary *opts)
|
||||
if (!fmt || !fmt->priv_class || !AV_IS_OUTPUT_DEVICE(fmt->priv_class->category))
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
printf("Auto-detected sinks for %s:\n", fmt->name);
|
||||
av_log(NULL, AV_LOG_INFO, "Auto-detected sinks for %s:\n", fmt->name);
|
||||
if (!fmt->get_device_list) {
|
||||
ret = AVERROR(ENOSYS);
|
||||
printf("Cannot list sinks. Not implemented.\n");
|
||||
av_log(NULL, AV_LOG_INFO, "Cannot list sinks. Not implemented.\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if ((ret = avdevice_list_output_sinks(fmt, NULL, opts, &device_list)) < 0) {
|
||||
printf("Cannot list sinks.\n");
|
||||
av_log(NULL, AV_LOG_INFO, "Cannot list sinks.\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
for (i = 0; i < device_list->nb_devices; i++) {
|
||||
printf("%s %s [%s]\n", device_list->default_device == i ? "*" : " ",
|
||||
av_log(NULL, AV_LOG_INFO, "%s %s [%s]\n", device_list->default_device == i ? "*" : " ",
|
||||
device_list->devices[i]->device_name, device_list->devices[i]->device_description);
|
||||
}
|
||||
|
||||
@@ -2275,7 +2275,7 @@ static int show_sinks_sources_parse_arg(const char *arg, char **dev, AVDictionar
|
||||
}
|
||||
}
|
||||
} else
|
||||
printf("\nDevice name is not provided.\n"
|
||||
av_log(NULL, AV_LOG_INFO, "\nDevice name is not provided.\n"
|
||||
"You can pass devicename[,opt1=val1[,opt2=val2...]] as an argument.\n\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,10 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* CHANGES 03.2019
|
||||
* --------------------------------------------------------
|
||||
* - config.h include removed
|
||||
*
|
||||
* CHANGES 08.2018
|
||||
* --------------------------------------------------------
|
||||
* - fftools_ prefix added to file name and include guards
|
||||
@@ -35,7 +39,6 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavfilter/avfilter.h"
|
||||
#include "libavformat/avformat.h"
|
||||
@@ -358,6 +361,7 @@ typedef struct OptionParseContext {
|
||||
* Parse an options group and write results into optctx.
|
||||
*
|
||||
* @param optctx an app-specific options context. NULL for global options group
|
||||
* @param g option group
|
||||
*/
|
||||
int parse_optgroup(void *optctx, OptionGroup *g);
|
||||
|
||||
|
||||
@@ -1102,6 +1102,7 @@ static void do_video_out(OutputFile *of,
|
||||
|
||||
if (!ost->filters_script &&
|
||||
!ost->filters &&
|
||||
(nb_filtergraphs == 0 || !filtergraphs[0]->graph_desc) &&
|
||||
next_picture &&
|
||||
ist &&
|
||||
lrintf(next_picture->pkt_duration * av_q2d(ist->st->time_base) / av_q2d(enc->time_base)) > 0) {
|
||||
@@ -1219,6 +1220,8 @@ static void do_video_out(OutputFile *of,
|
||||
/* duplicates frame if needed */
|
||||
for (i = 0; i < nb_frames; i++) {
|
||||
AVFrame *in_picture;
|
||||
int forced_keyframe = 0;
|
||||
double pts_time;
|
||||
av_init_packet(&pkt);
|
||||
pkt.data = NULL;
|
||||
pkt.size = 0;
|
||||
@@ -1233,17 +1236,9 @@ static void do_video_out(OutputFile *of,
|
||||
|
||||
in_picture->pts = ost->sync_opts;
|
||||
|
||||
#if 1
|
||||
if (!check_recording_time(ost))
|
||||
#else
|
||||
if (ost->frame_number >= ost->max_frames)
|
||||
#endif
|
||||
return;
|
||||
|
||||
{
|
||||
int forced_keyframe = 0;
|
||||
double pts_time;
|
||||
|
||||
if (enc->flags & (AV_CODEC_FLAG_INTERLACED_DCT | AV_CODEC_FLAG_INTERLACED_ME) &&
|
||||
ost->top_field_first >= 0)
|
||||
in_picture->top_field_first = !!ost->top_field_first;
|
||||
@@ -1315,6 +1310,8 @@ static void do_video_out(OutputFile *of,
|
||||
ret = avcodec_send_frame(enc, in_picture);
|
||||
if (ret < 0)
|
||||
goto error;
|
||||
// Make sure Closed Captions will not be duplicated
|
||||
av_frame_remove_side_data(in_picture, AV_FRAME_DATA_A53_CC);
|
||||
|
||||
while (1) {
|
||||
ret = avcodec_receive_packet(enc, &pkt);
|
||||
@@ -1351,7 +1348,6 @@ static void do_video_out(OutputFile *of,
|
||||
fprintf(ost->logfile, "%s", enc->stats_out);
|
||||
}
|
||||
}
|
||||
}
|
||||
ost->sync_opts++;
|
||||
/*
|
||||
* For video, number of frames in == number of packets out.
|
||||
@@ -1515,8 +1511,6 @@ static int reap_filters(int flush)
|
||||
av_rescale_q(filtered_frame->pts, filter_tb, enc->time_base) -
|
||||
av_rescale_q(start_time, AV_TIME_BASE_Q, enc->time_base);
|
||||
}
|
||||
//if (ost->source_index >= 0)
|
||||
// *filtered_frame= *input_streams[ost->source_index]->decoded_frame; //for me_threshold
|
||||
|
||||
switch (av_buffersink_get_type(filter)) {
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
@@ -2247,9 +2241,6 @@ static int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame)
|
||||
|
||||
/* determine if the parameters for this input changed */
|
||||
need_reinit = ifilter->format != frame->format;
|
||||
if (!!ifilter->hw_frames_ctx != !!frame->hw_frames_ctx ||
|
||||
(ifilter->hw_frames_ctx && ifilter->hw_frames_ctx->data != frame->hw_frames_ctx->data))
|
||||
need_reinit = 1;
|
||||
|
||||
switch (ifilter->ist->st->codecpar->codec_type) {
|
||||
case AVMEDIA_TYPE_AUDIO:
|
||||
@@ -2263,6 +2254,13 @@ static int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!ifilter->ist->reinit_filters && fg->graph)
|
||||
need_reinit = 0;
|
||||
|
||||
if (!!ifilter->hw_frames_ctx != !!frame->hw_frames_ctx ||
|
||||
(ifilter->hw_frames_ctx && ifilter->hw_frames_ctx->data != frame->hw_frames_ctx->data))
|
||||
need_reinit = 1;
|
||||
|
||||
if (need_reinit) {
|
||||
ret = ifilter_parameters_from_frame(ifilter, frame);
|
||||
if (ret < 0)
|
||||
@@ -2427,14 +2425,12 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output,
|
||||
ist->samples_decoded += decoded_frame->nb_samples;
|
||||
ist->frames_decoded++;
|
||||
|
||||
#if 1
|
||||
/* increment next_dts to use for the case where the input stream does not
|
||||
have timestamps or there are multiple frames in the packet */
|
||||
ist->next_pts += ((int64_t)AV_TIME_BASE * decoded_frame->nb_samples) /
|
||||
avctx->sample_rate;
|
||||
ist->next_dts += ((int64_t)AV_TIME_BASE * decoded_frame->nb_samples) /
|
||||
avctx->sample_rate;
|
||||
#endif
|
||||
|
||||
if (decoded_frame->pts != AV_NOPTS_VALUE) {
|
||||
decoded_frame_tb = ist->st->time_base;
|
||||
@@ -2894,7 +2890,7 @@ static void print_sdp(void)
|
||||
av_sdp_create(avc, j, sdp, sizeof(sdp));
|
||||
|
||||
if (!sdp_filename) {
|
||||
printf("SDP:\n%s\n", sdp);
|
||||
av_log(NULL, AV_LOG_INFO, "SDP:\n%s\n", sdp);
|
||||
fflush(stdout);
|
||||
} else {
|
||||
if (avio_open2(&sdp_pb, sdp_filename, AVIO_FLAG_WRITE, &int_cb, NULL) < 0) {
|
||||
@@ -3457,7 +3453,7 @@ static int init_output_stream_encode(OutputStream *ost)
|
||||
"if you want a different framerate.\n",
|
||||
ost->file_index, ost->index);
|
||||
}
|
||||
// ost->frame_rate = ist->st->avg_frame_rate.num ? ist->st->avg_frame_rate : (AVRational){25, 1};
|
||||
|
||||
if (ost->enc->supported_framerates && !ost->force_fps) {
|
||||
int idx = av_find_nearest_q_idx(ost->frame_rate, ost->enc->supported_framerates);
|
||||
ost->frame_rate = ost->enc->supported_framerates[idx];
|
||||
@@ -4588,7 +4584,10 @@ static int process_input(int file_index)
|
||||
pkt_dts + AV_TIME_BASE/10 < FFMAX(ist->pts, ist->dts)) {
|
||||
ifile->ts_offset -= delta;
|
||||
av_log(NULL, AV_LOG_DEBUG,
|
||||
"timestamp discontinuity %"PRId64", new offset= %"PRId64"\n",
|
||||
"timestamp discontinuity for stream #%d:%d "
|
||||
"(id=%d, type=%s): %"PRId64", new offset= %"PRId64"\n",
|
||||
ist->file_index, ist->st->index, ist->st->id,
|
||||
av_get_media_type_string(ist->dec_ctx->codec_type),
|
||||
delta, ifile->ts_offset);
|
||||
pkt.dts -= av_rescale_q(delta, AV_TIME_BASE_Q, ist->st->time_base);
|
||||
if (pkt.pts != AV_NOPTS_VALUE)
|
||||
@@ -5041,11 +5040,6 @@ int execute(int argc, char **argv)
|
||||
exit_program(1);
|
||||
}
|
||||
|
||||
// if (nb_input_files == 0) {
|
||||
// av_log(NULL, AV_LOG_FATAL, "At least one input file must be specified\n");
|
||||
// exit_program(1);
|
||||
// }
|
||||
|
||||
for (i = 0; i < nb_output_files; i++) {
|
||||
if (strcmp(output_files[i]->ctx->oformat->name, "rtp"))
|
||||
want_sdp = 0;
|
||||
|
||||
@@ -17,6 +17,10 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* CHANGES 03.2019
|
||||
* --------------------------------------------------------
|
||||
* - config.h include removed
|
||||
*
|
||||
* CHANGES 08.2018
|
||||
* --------------------------------------------------------
|
||||
* - fftools_ prefix added to file name and include guards
|
||||
@@ -31,8 +35,6 @@
|
||||
#ifndef FFTOOLS_FFMPEG_H
|
||||
#define FFTOOLS_FFMPEG_H
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
|
||||
@@ -301,10 +301,17 @@ static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
|
||||
exit_program(1);
|
||||
}
|
||||
ist = input_streams[input_files[file_idx]->ist_index + st->index];
|
||||
if (ist->user_set_discard == AVDISCARD_ALL) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Stream specifier '%s' in filtergraph description %s "
|
||||
"matches a disabled input stream.\n", p, fg->graph_desc);
|
||||
exit_program(1);
|
||||
}
|
||||
} else {
|
||||
/* find the first unused stream of corresponding type */
|
||||
for (i = 0; i < nb_input_streams; i++) {
|
||||
ist = input_streams[i];
|
||||
if (ist->user_set_discard == AVDISCARD_ALL)
|
||||
continue;
|
||||
if (ist->dec_ctx->codec_type == type && ist->discard)
|
||||
break;
|
||||
}
|
||||
@@ -740,6 +747,7 @@ static int sub2video_prepare(InputStream *ist, InputFilter *ifilter)
|
||||
if (!ist->sub2video.frame)
|
||||
return AVERROR(ENOMEM);
|
||||
ist->sub2video.last_pts = INT64_MIN;
|
||||
ist->sub2video.end_pts = INT64_MIN;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -183,13 +183,13 @@ static int show_hwaccels(void *optctx, const char *opt, const char *arg)
|
||||
enum AVHWDeviceType type = AV_HWDEVICE_TYPE_NONE;
|
||||
int i;
|
||||
|
||||
printf("Hardware acceleration methods:\n");
|
||||
av_log(NULL, AV_LOG_INFO, "Hardware acceleration methods:\n");
|
||||
while ((type = av_hwdevice_iterate_types(type)) !=
|
||||
AV_HWDEVICE_TYPE_NONE)
|
||||
printf("%s\n", av_hwdevice_get_type_name(type));
|
||||
av_log(NULL, AV_LOG_INFO, "%s\n", av_hwdevice_get_type_name(type));
|
||||
for (i = 0; hwaccels[i].name; i++)
|
||||
printf("%s\n", hwaccels[i].name);
|
||||
printf("\n");
|
||||
av_log(NULL, AV_LOG_INFO, "%s\n", hwaccels[i].name);
|
||||
av_log(NULL, AV_LOG_INFO, "\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
OptionsContext *o = optctx;
|
||||
StreamMap *m = NULL;
|
||||
int i, negative = 0, file_idx;
|
||||
int i, negative = 0, file_idx, disabled = 0;
|
||||
int sync_file_idx = -1, sync_stream_idx = 0;
|
||||
char *p, *sync;
|
||||
char *map;
|
||||
@@ -313,6 +313,11 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
|
||||
"match any streams.\n", arg);
|
||||
exit_program(1);
|
||||
}
|
||||
if (input_streams[input_files[sync_file_idx]->ist_index + sync_stream_idx]->user_set_discard == AVDISCARD_ALL) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Sync stream specification in map %s matches a disabled input "
|
||||
"stream.\n", arg);
|
||||
exit_program(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -349,6 +354,10 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
|
||||
if (check_stream_specifier(input_files[file_idx]->ctx, input_files[file_idx]->ctx->streams[i],
|
||||
*p == ':' ? p + 1 : p) <= 0)
|
||||
continue;
|
||||
if (input_streams[input_files[file_idx]->ist_index + i]->user_set_discard == AVDISCARD_ALL) {
|
||||
disabled = 1;
|
||||
continue;
|
||||
}
|
||||
GROW_ARRAY(o->stream_maps, o->nb_stream_maps);
|
||||
m = &o->stream_maps[o->nb_stream_maps - 1];
|
||||
|
||||
@@ -368,6 +377,10 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
|
||||
if (!m) {
|
||||
if (allow_unused) {
|
||||
av_log(NULL, AV_LOG_VERBOSE, "Stream map '%s' matches no streams; ignoring.\n", arg);
|
||||
} else if (disabled) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Stream map '%s' matches disabled streams.\n"
|
||||
"To ignore this, add a trailing '?' to the map.\n", arg);
|
||||
exit_program(1);
|
||||
} else {
|
||||
av_log(NULL, AV_LOG_FATAL, "Stream map '%s' matches no streams.\n"
|
||||
"To ignore this, add a trailing '?' to the map.\n", arg);
|
||||
@@ -447,7 +460,8 @@ static int opt_map_channel(void *optctx, const char *opt, const char *arg)
|
||||
/* allow trailing ? to map_channel */
|
||||
if ((allow_unused = strchr(mapchan, '?')))
|
||||
*allow_unused = 0;
|
||||
if (m->channel_idx < 0 || m->channel_idx >= st->codecpar->channels) {
|
||||
if (m->channel_idx < 0 || m->channel_idx >= st->codecpar->channels ||
|
||||
input_streams[input_files[m->file_idx]->ist_index + m->stream_idx]->user_set_discard == AVDISCARD_ALL) {
|
||||
if (allow_unused) {
|
||||
av_log(NULL, AV_LOG_VERBOSE, "mapchan: invalid audio channel #%d.%d.%d\n",
|
||||
m->file_idx, m->stream_idx, m->channel_idx);
|
||||
@@ -495,11 +509,11 @@ static int opt_init_hw_device(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
if (!strcmp(arg, "list")) {
|
||||
enum AVHWDeviceType type = AV_HWDEVICE_TYPE_NONE;
|
||||
printf("Supported hardware device types:\n");
|
||||
av_log(NULL, AV_LOG_INFO, "Supported hardware device types:\n");
|
||||
while ((type = av_hwdevice_iterate_types(type)) !=
|
||||
AV_HWDEVICE_TYPE_NONE)
|
||||
printf("%s\n", av_hwdevice_get_type_name(type));
|
||||
printf("\n");
|
||||
av_log(NULL, AV_LOG_INFO, "%s\n", av_hwdevice_get_type_name(type));
|
||||
av_log(NULL, AV_LOG_INFO, "\n");
|
||||
exit_program(0);
|
||||
} else {
|
||||
return hw_device_init_from_string(arg, NULL);
|
||||
@@ -756,6 +770,13 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
|
||||
|
||||
MATCH_PER_STREAM_OPT(discard, str, discard_str, ic, st);
|
||||
ist->user_set_discard = AVDISCARD_NONE;
|
||||
|
||||
if ((o->video_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) ||
|
||||
(o->audio_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) ||
|
||||
(o->subtitle_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) ||
|
||||
(o->data_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_DATA))
|
||||
ist->user_set_discard = AVDISCARD_ALL;
|
||||
|
||||
if (discard_str && av_opt_eval_int(&cc, discard_opt, discard_str, &ist->user_set_discard) < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error parsing discard %s.\n",
|
||||
discard_str);
|
||||
@@ -1670,6 +1691,8 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
|
||||
|
||||
MATCH_PER_STREAM_OPT(filter_scripts, str, ost->filters_script, oc, st);
|
||||
MATCH_PER_STREAM_OPT(filters, str, ost->filters, oc, st);
|
||||
if (o->nb_filters > 1)
|
||||
av_log(NULL, AV_LOG_ERROR, "Only '-vf %s' read, ignoring remaining -vf options: Use ',' to separate filters\n", ost->filters);
|
||||
|
||||
if (!ost->stream_copy) {
|
||||
const char *p = NULL;
|
||||
@@ -1851,6 +1874,8 @@ static OutputStream *new_audio_stream(OptionsContext *o, AVFormatContext *oc, in
|
||||
|
||||
MATCH_PER_STREAM_OPT(filter_scripts, str, ost->filters_script, oc, st);
|
||||
MATCH_PER_STREAM_OPT(filters, str, ost->filters, oc, st);
|
||||
if (o->nb_filters > 1)
|
||||
av_log(NULL, AV_LOG_ERROR, "Only '-af %s' read, ignoring remaining -af options: Use ',' to separate filters\n", ost->filters);
|
||||
|
||||
if (!ost->stream_copy) {
|
||||
char *sample_fmt = NULL;
|
||||
@@ -2184,6 +2209,8 @@ static int open_output_file(OptionsContext *o, const char *filename)
|
||||
int new_area;
|
||||
ist = input_streams[i];
|
||||
new_area = ist->st->codecpar->width * ist->st->codecpar->height + 100000000*!!ist->st->codec_info_nb_frames;
|
||||
if (ist->user_set_discard == AVDISCARD_ALL)
|
||||
continue;
|
||||
if((qcr!=MKTAG('A', 'P', 'I', 'C')) && (ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC))
|
||||
new_area = 1;
|
||||
if (ist->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO &&
|
||||
@@ -2205,6 +2232,8 @@ static int open_output_file(OptionsContext *o, const char *filename)
|
||||
int score;
|
||||
ist = input_streams[i];
|
||||
score = ist->st->codecpar->channels + 100000000*!!ist->st->codec_info_nb_frames;
|
||||
if (ist->user_set_discard == AVDISCARD_ALL)
|
||||
continue;
|
||||
if (ist->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&
|
||||
score > best_score) {
|
||||
best_score = score;
|
||||
@@ -2226,6 +2255,8 @@ static int open_output_file(OptionsContext *o, const char *filename)
|
||||
AVCodec const *output_codec =
|
||||
avcodec_find_encoder(oc->oformat->subtitle_codec);
|
||||
int input_props = 0, output_props = 0;
|
||||
if (input_streams[i]->user_set_discard == AVDISCARD_ALL)
|
||||
continue;
|
||||
if (output_codec)
|
||||
output_descriptor = avcodec_descriptor_get(output_codec->id);
|
||||
if (input_descriptor)
|
||||
@@ -2247,6 +2278,8 @@ static int open_output_file(OptionsContext *o, const char *filename)
|
||||
if (!o->data_disable ) {
|
||||
enum AVCodecID codec_id = av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_DATA);
|
||||
for (i = 0; codec_id != AV_CODEC_ID_NONE && i < nb_input_streams; i++) {
|
||||
if (input_streams[i]->user_set_discard == AVDISCARD_ALL)
|
||||
continue;
|
||||
if (input_streams[i]->st->codecpar->codec_type == AVMEDIA_TYPE_DATA
|
||||
&& input_streams[i]->st->codecpar->codec_id == codec_id )
|
||||
new_data_stream(o, oc, i);
|
||||
@@ -2285,6 +2318,11 @@ loop_end:
|
||||
int src_idx = input_files[map->file_index]->ist_index + map->stream_index;
|
||||
|
||||
ist = input_streams[input_files[map->file_index]->ist_index + map->stream_index];
|
||||
if (ist->user_set_discard == AVDISCARD_ALL) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Stream #%d:%d is disabled and cannot be mapped.\n",
|
||||
map->file_index, map->stream_index);
|
||||
exit_program(1);
|
||||
}
|
||||
if(o->subtitle_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE)
|
||||
continue;
|
||||
if(o-> audio_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO)
|
||||
@@ -3150,7 +3188,7 @@ void show_help_default(const char *opt, const char *arg)
|
||||
|
||||
show_usage();
|
||||
|
||||
printf("Getting help:\n"
|
||||
av_log(NULL, AV_LOG_INFO, "Getting help:\n"
|
||||
" -h -- print basic options\n"
|
||||
" -h long -- print more options\n"
|
||||
" -h full -- print all options (including all format and codec specific options, very long)\n"
|
||||
@@ -3188,7 +3226,7 @@ void show_help_default(const char *opt, const char *arg)
|
||||
OPT_EXPERT | OPT_AUDIO, OPT_VIDEO, 0);
|
||||
show_help_options(options, "Subtitle options:",
|
||||
OPT_SUBTITLE, 0, 0);
|
||||
printf("\n");
|
||||
av_log(NULL, AV_LOG_INFO, "\n");
|
||||
|
||||
if (show_avoptions) {
|
||||
int flags = AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_ENCODING_PARAM;
|
||||
|
||||
@@ -18,6 +18,11 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* CHANGES 02.2019
|
||||
* --------------------------------------------------------
|
||||
* - JavaVM registered via av_jni_set_java_vm()
|
||||
* - registerNewNativeFFmpegPipe() method added
|
||||
*
|
||||
* CHANGES 10.2018
|
||||
* --------------------------------------------------------
|
||||
* - getBuildConf method added
|
||||
@@ -32,8 +37,11 @@
|
||||
*/
|
||||
|
||||
#include <pthread.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "libavcodec/jni.h"
|
||||
#include "libavutil/bprint.h"
|
||||
#include "mobileffmpeg.h"
|
||||
#include "fftools_ffmpeg.h"
|
||||
@@ -234,6 +242,9 @@ void monitorNotify() {
|
||||
|
||||
/**
|
||||
* Adds log data to the end of callback data list.
|
||||
*
|
||||
* @param level log level
|
||||
* @param data log data
|
||||
*/
|
||||
void logCallbackDataAdd(int level, const char *data) {
|
||||
|
||||
@@ -345,10 +356,10 @@ struct CallbackData *callbackDataRemove() {
|
||||
/**
|
||||
* Callback function for FFmpeg logs.
|
||||
*
|
||||
* \param pointer to AVClass struct
|
||||
* \param level
|
||||
* \param format
|
||||
* \param arguments
|
||||
* @param ptr pointer to AVClass struct
|
||||
* @param level log level
|
||||
* @param format format string
|
||||
* @param vargs arguments
|
||||
*/
|
||||
void mobileffmpeg_log_callback_function(void *ptr, int level, const char* format, va_list vargs) {
|
||||
char line[LOG_LINE_SIZE];
|
||||
@@ -381,13 +392,13 @@ void mobileffmpeg_log_callback_function(void *ptr, int level, const char* format
|
||||
/**
|
||||
* Callback function for FFmpeg statistics.
|
||||
*
|
||||
* \param frameNumber last processed frame number
|
||||
* \param fps frames processed per second
|
||||
* \param quality quality of the output stream (video only)
|
||||
* \param size size in bytes
|
||||
* \param time processed output duration
|
||||
* \param bitrate output bit rate in kbits/s
|
||||
* \param speed processing speed = processed duration / operation duration
|
||||
* @param frameNumber last processed frame number
|
||||
* @param fps frames processed per second
|
||||
* @param quality quality of the output stream (video only)
|
||||
* @param size size in bytes
|
||||
* @param time processed output duration
|
||||
* @param bitrate output bit rate in kbits/s
|
||||
* @param speed processing speed = processed duration / operation duration
|
||||
*/
|
||||
void mobileffmpeg_statistics_callback_function(int frameNumber, float fps, float quality, int64_t size, int time, double bitrate, double speed) {
|
||||
statisticsCallbackDataAdd(frameNumber, fps, quality, size, time, bitrate, speed);
|
||||
@@ -462,9 +473,9 @@ void *callbackThreadFunction() {
|
||||
/**
|
||||
* Called when 'mobileffmpeg' native library is loaded.
|
||||
*
|
||||
* \param vm pointer to the running virtual machine
|
||||
* \param reserved reserved
|
||||
* \return JNI version needed by 'mobileffmpeg' library
|
||||
* @param vm pointer to the running virtual machine
|
||||
* @param reserved reserved
|
||||
* @return JNI version needed by 'mobileffmpeg' library
|
||||
*/
|
||||
jint JNI_OnLoad(JavaVM *vm, void *reserved) {
|
||||
JNIEnv *env;
|
||||
@@ -500,6 +511,8 @@ jint JNI_OnLoad(JavaVM *vm, void *reserved) {
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
av_jni_set_java_vm(vm, NULL);
|
||||
|
||||
configClass = (jclass) ((*env)->NewGlobalRef(env, localConfigClass));
|
||||
|
||||
redirectionEnabled = 0;
|
||||
@@ -516,9 +529,9 @@ jint JNI_OnLoad(JavaVM *vm, void *reserved) {
|
||||
/**
|
||||
* Sets log level.
|
||||
*
|
||||
* \param env pointer to native method interface
|
||||
* \param reference to the class on which this method is invoked
|
||||
* \param log level
|
||||
* @param env pointer to native method interface
|
||||
* @param object reference to the class on which this method is invoked
|
||||
* @param level log level
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_com_arthenica_mobileffmpeg_Config_setNativeLogLevel(JNIEnv *env, jclass object, jint level) {
|
||||
av_log_set_level(level);
|
||||
@@ -527,8 +540,8 @@ JNIEXPORT void JNICALL Java_com_arthenica_mobileffmpeg_Config_setNativeLogLevel(
|
||||
/**
|
||||
* Returns current log level.
|
||||
*
|
||||
* \param env pointer to native method interface
|
||||
* \param reference to the class on which this method is invoked
|
||||
* @param env pointer to native method interface
|
||||
* @param object reference to the class on which this method is invoked
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_com_arthenica_mobileffmpeg_Config_getNativeLogLevel(JNIEnv *env, jclass object) {
|
||||
return av_log_get_level();
|
||||
@@ -537,8 +550,8 @@ JNIEXPORT jint JNICALL Java_com_arthenica_mobileffmpeg_Config_getNativeLogLevel(
|
||||
/**
|
||||
* Enables log and statistics redirection.
|
||||
*
|
||||
* \param env pointer to native method interface
|
||||
* \param reference to the class on which this method is invoked
|
||||
* @param env pointer to native method interface
|
||||
* @param object reference to the class on which this method is invoked
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_com_arthenica_mobileffmpeg_Config_enableNativeRedirection(JNIEnv *env, jclass object) {
|
||||
mutexLock();
|
||||
@@ -564,8 +577,8 @@ JNIEXPORT void JNICALL Java_com_arthenica_mobileffmpeg_Config_enableNativeRedire
|
||||
/**
|
||||
* Disables log and statistics redirection.
|
||||
*
|
||||
* \param env pointer to native method interface
|
||||
* \param reference to the class on which this method is invoked
|
||||
* @param env pointer to native method interface
|
||||
* @param object reference to the class on which this method is invoked
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_com_arthenica_mobileffmpeg_Config_disableNativeRedirection(JNIEnv *env, jclass object) {
|
||||
|
||||
@@ -588,9 +601,9 @@ JNIEXPORT void JNICALL Java_com_arthenica_mobileffmpeg_Config_disableNativeRedir
|
||||
/**
|
||||
* Returns FFmpeg version bundled within the library natively.
|
||||
*
|
||||
* \param env pointer to native method interface
|
||||
* \param object reference to the class on which this method is invoked
|
||||
* \return FFmpeg version string
|
||||
* @param env pointer to native method interface
|
||||
* @param object reference to the class on which this method is invoked
|
||||
* @return FFmpeg version string
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL Java_com_arthenica_mobileffmpeg_Config_getNativeFFmpegVersion(JNIEnv *env, jclass object) {
|
||||
return (*env)->NewStringUTF(env, FFMPEG_VERSION);
|
||||
@@ -599,9 +612,9 @@ JNIEXPORT jstring JNICALL Java_com_arthenica_mobileffmpeg_Config_getNativeFFmpeg
|
||||
/**
|
||||
* Returns MobileFFmpeg library version natively.
|
||||
*
|
||||
* \param env pointer to native method interface
|
||||
* \param object reference to the class on which this method is invoked
|
||||
* \return MobileFFmpeg version string
|
||||
* @param env pointer to native method interface
|
||||
* @param object reference to the class on which this method is invoked
|
||||
* @return MobileFFmpeg version string
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL Java_com_arthenica_mobileffmpeg_Config_getNativeVersion(JNIEnv *env, jclass object) {
|
||||
return (*env)->NewStringUTF(env, MOBILE_FFMPEG_VERSION);
|
||||
@@ -610,10 +623,10 @@ JNIEXPORT jstring JNICALL Java_com_arthenica_mobileffmpeg_Config_getNativeVersio
|
||||
/**
|
||||
* Synchronously executes FFmpeg command natively with arguments provided.
|
||||
*
|
||||
* \param env pointer to native method interface
|
||||
* \param object reference to the class on which this method is invoked
|
||||
* \param stringArray reference to the object holding FFmpeg command arguments
|
||||
* \return zero on successful execution, non-zero on error
|
||||
* @param env pointer to native method interface
|
||||
* @param object reference to the class on which this method is invoked
|
||||
* @param stringArray reference to the object holding FFmpeg command arguments
|
||||
* @return zero on successful execution, non-zero on error
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_com_arthenica_mobileffmpeg_Config_nativeExecute(JNIEnv *env, jclass object, jobjectArray stringArray) {
|
||||
jstring *tempArray = NULL;
|
||||
@@ -665,8 +678,8 @@ JNIEXPORT jint JNICALL Java_com_arthenica_mobileffmpeg_Config_nativeExecute(JNIE
|
||||
/**
|
||||
* Cancels an ongoing operation natively.
|
||||
*
|
||||
* \param env pointer to native method interface
|
||||
* \param object reference to the class on which this method is invoked
|
||||
* @param env pointer to native method interface
|
||||
* @param object reference to the class on which this method is invoked
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_com_arthenica_mobileffmpeg_Config_nativeCancel(JNIEnv *env, jclass object) {
|
||||
cancel_operation();
|
||||
@@ -675,10 +688,37 @@ JNIEXPORT void JNICALL Java_com_arthenica_mobileffmpeg_Config_nativeCancel(JNIEn
|
||||
/**
|
||||
* Returns build configuration for FFmpeg.
|
||||
*
|
||||
* \param env pointer to native method interface
|
||||
* \param object reference to the class on which this method is invoked
|
||||
* \return build configuration string
|
||||
* @param env pointer to native method interface
|
||||
* @param object reference to the class on which this method is invoked
|
||||
* @return build configuration string
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL Java_com_arthenica_mobileffmpeg_Config_getNativeBuildConf(JNIEnv *env, jclass object) {
|
||||
return (*env)->NewStringUTF(env, FFMPEG_CONFIGURATION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates natively a new named pipe to use in FFmpeg operations.
|
||||
*
|
||||
* @param env pointer to native method interface
|
||||
* @param object reference to the class on which this method is invoked
|
||||
* @param ffmpegPipePath full path of ffmpeg pipe
|
||||
* @return zero on successful creation, non-zero on error
|
||||
*/
|
||||
JNIEXPORT int JNICALL Java_com_arthenica_mobileffmpeg_Config_registerNewNativeFFmpegPipe(JNIEnv *env, jclass object, jstring ffmpegPipePath) {
|
||||
const char *ffmpegPipePathString = (*env)->GetStringUTFChars(env, ffmpegPipePath, 0);
|
||||
|
||||
return mkfifo(ffmpegPipePathString, S_IRWXU | S_IRWXG | S_IROTH);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns MobileFFmpeg library build date natively.
|
||||
*
|
||||
* @param env pointer to native method interface
|
||||
* @param object reference to the class on which this method is invoked
|
||||
* @return MobileFFmpeg library build date
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL Java_com_arthenica_mobileffmpeg_Config_getNativeBuildDate(JNIEnv *env, jclass object) {
|
||||
char buildDate[10];
|
||||
sprintf(buildDate, "%d", MOBILE_FFMPEG_BUILD_DATE);
|
||||
return (*env)->NewStringUTF(env, buildDate);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "libavutil/ffversion.h"
|
||||
|
||||
/** Library version string */
|
||||
#define MOBILE_FFMPEG_VERSION "4.2"
|
||||
#define MOBILE_FFMPEG_VERSION "4.2.1"
|
||||
|
||||
/** Defines tag used for Android logging. */
|
||||
#define LIB_NAME "mobile-ffmpeg"
|
||||
@@ -110,4 +110,18 @@ JNIEXPORT void JNICALL Java_com_arthenica_mobileffmpeg_Config_nativeCancel(JNIEn
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL Java_com_arthenica_mobileffmpeg_Config_getNativeBuildConf(JNIEnv *, jclass);
|
||||
|
||||
/*
|
||||
* Class: com_arthenica_mobileffmpeg_Config
|
||||
* Method: registerNewNativeFFmpegPipe
|
||||
* Signature: (Ljava/lang/String)I;
|
||||
*/
|
||||
JNIEXPORT int JNICALL Java_com_arthenica_mobileffmpeg_Config_registerNewNativeFFmpegPipe(JNIEnv *env, jclass object, jstring ffmpegPipePath);
|
||||
|
||||
/*
|
||||
* Class: com_arthenica_mobileffmpeg_Config
|
||||
* Method: getNativeBuildDate
|
||||
* Signature: ()Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL Java_com_arthenica_mobileffmpeg_Config_getNativeBuildDate(JNIEnv *env, jclass object);
|
||||
|
||||
#endif /* MOBILE_FFMPEG_H */
|
||||
@@ -32,9 +32,9 @@ JNINativeMethod abiDetectMethods[] = {
|
||||
/**
|
||||
* Called when 'abidetect' native library is loaded.
|
||||
*
|
||||
* \param vm pointer to the running virtual machine
|
||||
* \param reserved reserved
|
||||
* \return JNI version needed by 'abidetect' library
|
||||
* @param vm pointer to the running virtual machine
|
||||
* @param reserved reserved
|
||||
* @return JNI version needed by 'abidetect' library
|
||||
*/
|
||||
jint JNI_OnLoad(JavaVM *vm, void *reserved) {
|
||||
JNIEnv *env;
|
||||
@@ -60,9 +60,9 @@ jint JNI_OnLoad(JavaVM *vm, void *reserved) {
|
||||
/**
|
||||
* Returns loaded ABI name.
|
||||
*
|
||||
* \param env pointer to native method interface
|
||||
* \param object reference to the class on which this method is invoked
|
||||
* \return loaded ABI name as UTF string
|
||||
* @param env pointer to native method interface
|
||||
* @param object reference to the class on which this method is invoked
|
||||
* @return loaded ABI name as UTF string
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL Java_com_arthenica_mobileffmpeg_AbiDetect_getNativeAbi(JNIEnv *env, jclass object) {
|
||||
|
||||
@@ -83,9 +83,9 @@ JNIEXPORT jstring JNICALL Java_com_arthenica_mobileffmpeg_AbiDetect_getNativeAbi
|
||||
/**
|
||||
* Returns ABI name of the running cpu.
|
||||
*
|
||||
* \param env pointer to native method interface
|
||||
* \param object reference to the class on which this method is invoked
|
||||
* \return ABI name of the running cpu as UTF string
|
||||
* @param env pointer to native method interface
|
||||
* @param object reference to the class on which this method is invoked
|
||||
* @return ABI name of the running cpu as UTF string
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL Java_com_arthenica_mobileffmpeg_AbiDetect_getNativeCpuAbi(JNIEnv *env, jclass object) {
|
||||
AndroidCpuFamily family = android_getCpuFamily();
|
||||
@@ -117,9 +117,9 @@ JNIEXPORT jstring JNICALL Java_com_arthenica_mobileffmpeg_AbiDetect_getNativeCpu
|
||||
/**
|
||||
* Returns whether MobileFFmpeg release is a long term release or not.
|
||||
*
|
||||
* \param env pointer to native method interface
|
||||
* \param object reference to the class on which this method is invoked
|
||||
* \return YES or NO
|
||||
* @param env pointer to native method interface
|
||||
* @param object reference to the class on which this method is invoked
|
||||
* @return YES or NO
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_com_arthenica_mobileffmpeg_AbiDetect_isNativeLTSBuild(JNIEnv *env, jclass object) {
|
||||
#if defined(MOBILE_FFMPEG_LTS)
|
||||
|
||||
@@ -31,6 +31,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import static com.arthenica.mobileffmpeg.FFmpeg.getBuildDate;
|
||||
import static com.arthenica.mobileffmpeg.FFmpeg.getVersion;
|
||||
|
||||
/**
|
||||
@@ -64,6 +65,8 @@ public class Config {
|
||||
*/
|
||||
public static final String TAG = "mobile-ffmpeg";
|
||||
|
||||
public static final String MOBILE_FFMPEG_PIPE_PREFIX = "mf_pipe_";
|
||||
|
||||
private static LogCallback logCallbackFunction;
|
||||
|
||||
private static Level activeLogLevel;
|
||||
@@ -76,6 +79,8 @@ public class Config {
|
||||
|
||||
private static boolean runningSystemCommand;
|
||||
|
||||
private static int lastCreatedPipeIndex;
|
||||
|
||||
static {
|
||||
|
||||
Log.i(Config.TAG, "Loading mobile-ffmpeg.");
|
||||
@@ -111,7 +116,7 @@ public class Config {
|
||||
System.loadLibrary("mobileffmpeg");
|
||||
}
|
||||
|
||||
Log.i(Config.TAG, String.format("Loaded mobile-ffmpeg-%s-%s-%s.", getPackageName(), AbiDetect.getAbi(), getVersion()));
|
||||
Log.i(Config.TAG, String.format("Loaded mobile-ffmpeg-%s-%s-%s-%s.", getPackageName(), AbiDetect.getAbi(), getVersion(), getBuildDate()));
|
||||
|
||||
/* NATIVE LOG LEVEL IS RECEIVED ONLY ON STARTUP */
|
||||
activeLogLevel = Level.from(getNativeLogLevel());
|
||||
@@ -124,6 +129,7 @@ public class Config {
|
||||
systemCommandOutputReference.set(new StringBuffer());
|
||||
|
||||
runningSystemCommand = false;
|
||||
lastCreatedPipeIndex = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -411,6 +417,45 @@ public class Config {
|
||||
return Packages.getExternalLibraries();
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Creates a new named pipe to use in <code>FFmpeg</code> operations.
|
||||
*
|
||||
* <p>Please note that creator is responsible of closing created pipes.
|
||||
*
|
||||
* @param context application context to access application data
|
||||
* @return the full path of named pipe
|
||||
*/
|
||||
public static String registerNewFFmpegPipe(final Context context) {
|
||||
|
||||
// PIPES ARE CREATED UNDER THE CACHE DIRECTORY
|
||||
final File cacheDir = context.getCacheDir();
|
||||
|
||||
final String newFFmpegPipePath = cacheDir + File.separator + MOBILE_FFMPEG_PIPE_PREFIX + (++lastCreatedPipeIndex);
|
||||
|
||||
// FIRST CLOSE OLD PIPES WITH THE SAME NAME
|
||||
closeFFmpegPipe(newFFmpegPipePath);
|
||||
|
||||
int rc = registerNewNativeFFmpegPipe(newFFmpegPipePath);
|
||||
if (rc == 0) {
|
||||
return newFFmpegPipePath;
|
||||
} else {
|
||||
Log.e(TAG, String.format("Failed to register new FFmpeg pipe %s. Operation failed with rc=%d.", newFFmpegPipePath, rc));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Closes a previously created <code>FFmpeg</code> pipe.
|
||||
*
|
||||
* @param ffmpegPipePath full path of ffmpeg pipe
|
||||
*/
|
||||
public static void closeFFmpegPipe(final String ffmpegPipePath) {
|
||||
File file = new File(ffmpegPipePath);
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes system command. System command is not logged to output.
|
||||
*
|
||||
@@ -524,4 +569,21 @@ public class Config {
|
||||
*/
|
||||
native static String getNativeBuildConf();
|
||||
|
||||
/**
|
||||
* <p>Creates natively a new named pipe to use in <code>FFmpeg</code> operations.
|
||||
*
|
||||
* <p>Please note that creator is responsible of closing created pipes.
|
||||
*
|
||||
* @param ffmpegPipePath full path of ffmpeg pipe
|
||||
* @return zero on successful creation, non-zero on error
|
||||
*/
|
||||
native static int registerNewNativeFFmpegPipe(final String ffmpegPipePath);
|
||||
|
||||
/**
|
||||
* <p>Returns MobileFFmpeg library build date natively.
|
||||
*
|
||||
* @return MobileFFmpeg library build date
|
||||
*/
|
||||
native static String getNativeBuildDate();
|
||||
|
||||
}
|
||||
|
||||
@@ -192,4 +192,13 @@ public class FFmpeg {
|
||||
return AbiDetect.isNativeLTSBuild();
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Returns MobileFFmpeg library build date.
|
||||
*
|
||||
* @return MobileFFmpeg library build date
|
||||
*/
|
||||
public static String getBuildDate() {
|
||||
return Config.getNativeBuildDate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -189,14 +189,14 @@ public class MediaInformationParser {
|
||||
pEnd = count(part2, ")");
|
||||
}
|
||||
|
||||
streamInformation.setFullFormat(part2.toLowerCase().trim());
|
||||
streamInformation.setFormat(part2.replaceAll("\\(.*\\)", "").toLowerCase().trim());
|
||||
streamInformation.setFullFormat(part2.toLowerCase(Locale.getDefault()).trim());
|
||||
streamInformation.setFormat(part2.replaceAll("\\(.*\\)", "").toLowerCase(Locale.getDefault()).trim());
|
||||
}
|
||||
|
||||
lastUsedPart++;
|
||||
String videoDimensionPart = safeGet(parts, lastUsedPart);
|
||||
if (videoDimensionPart != null) {
|
||||
String videoLayout = videoDimensionPart.toLowerCase().trim();
|
||||
String videoLayout = videoDimensionPart.toLowerCase(Locale.getDefault()).trim();
|
||||
Pair<Long, Long> dimensions = parseVideoDimensions(videoLayout);
|
||||
streamInformation.setWidth(dimensions.getFirst());
|
||||
streamInformation.setHeight(dimensions.getSecond());
|
||||
@@ -205,7 +205,7 @@ public class MediaInformationParser {
|
||||
}
|
||||
|
||||
for (int i = lastUsedPart + 1; i < parts.length; i++) {
|
||||
String part = parts[i].replaceAll("\\(.*\\)", "").toLowerCase();
|
||||
String part = parts[i].replaceAll("\\(.*\\)", "").toLowerCase(Locale.getDefault());
|
||||
|
||||
if (part.contains("kb/s")) {
|
||||
streamInformation.setBitrate(toLongObject(part.replaceAll("kb/s", "").trim()));
|
||||
@@ -225,13 +225,13 @@ public class MediaInformationParser {
|
||||
streamInformation.setSampleRate(parseAudioStreamSampleRate(part2));
|
||||
}
|
||||
if (part3 != null) {
|
||||
streamInformation.setChannelLayout(part3.toLowerCase().trim());
|
||||
streamInformation.setChannelLayout(part3.toLowerCase(Locale.getDefault()).trim());
|
||||
}
|
||||
if (part4 != null) {
|
||||
streamInformation.setSampleFormat(part4.toLowerCase().trim());
|
||||
streamInformation.setSampleFormat(part4.toLowerCase(Locale.getDefault()).trim());
|
||||
}
|
||||
if (part5 != null) {
|
||||
streamInformation.setBitrate(toLongObject(part5.toLowerCase().replaceAll("\\(.*\\)", "").replaceAll("kb/s", "").trim()));
|
||||
streamInformation.setBitrate(toLongObject(part5.toLowerCase(Locale.getDefault()).replaceAll("\\(.*\\)", "").replaceAll("kb/s", "").trim()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -245,7 +245,7 @@ public class MediaInformationParser {
|
||||
Long height = null;
|
||||
|
||||
if (input != null) {
|
||||
final String[] dimensions = input.toLowerCase().replaceAll("\\[.*\\]", "").trim().split("x");
|
||||
final String[] dimensions = input.toLowerCase(Locale.getDefault()).replaceAll("\\[.*\\]", "").trim().split("x");
|
||||
width = toLongObject(safeGet(dimensions, 0));
|
||||
height = toLongObject(safeGet(dimensions, 1));
|
||||
}
|
||||
@@ -257,7 +257,7 @@ public class MediaInformationParser {
|
||||
if (input != null) {
|
||||
String[] parts = input.replaceAll("\\[", "").replaceAll("\\]", "").split(" ");
|
||||
for (int i = 0; i < parts.length; i++) {
|
||||
if (parts[i].toLowerCase().equals("sar")) {
|
||||
if (parts[i].toLowerCase(Locale.getDefault()).equals("sar")) {
|
||||
return safeGet(parts, i + 1);
|
||||
}
|
||||
}
|
||||
@@ -270,7 +270,7 @@ public class MediaInformationParser {
|
||||
if (input != null) {
|
||||
String[] parts = input.replaceAll("\\[", "").replaceAll("\\]", "").split(" ");
|
||||
for (int i = 0; i < parts.length; i++) {
|
||||
if (parts[i].toLowerCase().equals("dar")) {
|
||||
if (parts[i].toLowerCase(Locale.getDefault()).equals("dar")) {
|
||||
return safeGet(parts, i + 1);
|
||||
}
|
||||
}
|
||||
@@ -284,7 +284,7 @@ public class MediaInformationParser {
|
||||
boolean khz = false;
|
||||
boolean mhz = false;
|
||||
|
||||
String lowerCase = input.toLowerCase();
|
||||
String lowerCase = input.toLowerCase(Locale.getDefault());
|
||||
if (lowerCase.contains("khz")) {
|
||||
khz = true;
|
||||
}
|
||||
@@ -312,9 +312,9 @@ public class MediaInformationParser {
|
||||
|
||||
static String parseStreamType(final String input) {
|
||||
if (input != null) {
|
||||
if (input.toLowerCase().contains("audio:")) {
|
||||
if (input.toLowerCase(Locale.getDefault()).contains("audio:")) {
|
||||
return "audio";
|
||||
} else if (input.toLowerCase().contains("video:")) {
|
||||
} else if (input.toLowerCase(Locale.getDefault()).contains("video:")) {
|
||||
return "video";
|
||||
}
|
||||
}
|
||||
@@ -324,7 +324,7 @@ public class MediaInformationParser {
|
||||
|
||||
static String parseStreamCodec(final String input) {
|
||||
if (input != null) {
|
||||
return input.toLowerCase()
|
||||
return input.toLowerCase(Locale.getDefault())
|
||||
.replaceAll("\\(.*\\)", "")
|
||||
.replaceAll("video:", "")
|
||||
.replaceAll("audio:", "")
|
||||
@@ -336,7 +336,7 @@ public class MediaInformationParser {
|
||||
|
||||
static String parseStreamFullCodec(final String input) {
|
||||
if (input != null) {
|
||||
return input.toLowerCase()
|
||||
return input.toLowerCase(Locale.getDefault())
|
||||
.replaceAll("video:", "")
|
||||
.replaceAll("audio:", "")
|
||||
.trim();
|
||||
|
||||
@@ -97,7 +97,6 @@ class Packages {
|
||||
final boolean gnutls = externalLibraryList.contains("gnutls");
|
||||
final boolean xvid = externalLibraryList.contains("xvid");
|
||||
|
||||
boolean min = false;
|
||||
boolean minGpl = false;
|
||||
boolean https = false;
|
||||
boolean httpsGpl = false;
|
||||
@@ -125,8 +124,6 @@ class Packages {
|
||||
} else {
|
||||
if (gnutls) {
|
||||
https = true;
|
||||
} else {
|
||||
min = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 66 KiB |
@@ -1,14 +1,12 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.2.1'
|
||||
|
||||
classpath 'com.android.tools.build:gradle:3.3.2'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
/Application.mk
|
||||
/Android.mk.tmp
|
||||
|
||||
@@ -1,18 +1,26 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 27
|
||||
signingConfigs {
|
||||
localConfig {
|
||||
keyAlias 'androiddebugkey'
|
||||
storeFile file(System.getProperty("user.home") + '/.android/debug.keystore')
|
||||
storePassword 'android'
|
||||
keyPassword 'android'
|
||||
}
|
||||
}
|
||||
compileSdkVersion 28
|
||||
defaultConfig {
|
||||
applicationId "com.arthenica.mobileffmpeg.test"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 27
|
||||
versionCode 240420
|
||||
versionName "4.2"
|
||||
targetSdkVersion 28
|
||||
versionCode 240421
|
||||
versionName "4.2.1"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
debug {
|
||||
minifyEnabled true
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
@@ -39,13 +47,14 @@ android.applicationVariants.all { variant ->
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation 'com.arthenica:mobile-ffmpeg-full:4.2'
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation 'com.arthenica:mobile-ffmpeg-full:4.2.1'
|
||||
// implementation project(':app')
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
||||
implementation 'com.android.support:support-v4:27.1.1'
|
||||
implementation 'com.android.support:design:27.1.1'
|
||||
implementation 'com.android.support:appcompat-v7:27.1.1'
|
||||
implementation 'com.android.support:support-v4:28.0.0'
|
||||
implementation 'com.android.support:design:28.0.0'
|
||||
implementation 'com.android.support:appcompat-v7:28.0.0'
|
||||
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -5,17 +5,8 @@
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
-keep class com.arthenica.mobileffmpeg.Config {
|
||||
native <methods>;
|
||||
void log(int, byte[]);
|
||||
void statistics(int, float, float, long , int, double, double);
|
||||
}
|
||||
|
||||
@@ -18,8 +18,7 @@
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:largeHeap="true"
|
||||
android:theme="@style/AppTheme"
|
||||
tools:replace="android:icon">
|
||||
android:theme="@style/AppTheme">
|
||||
<activity android:name="com.arthenica.mobileffmpeg.test.MainActivity"
|
||||
android:theme="@style/AppTheme">
|
||||
<intent-filter>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018 Taner Sener
|
||||
* Copyright (c) 2018-2019 Taner Sener
|
||||
*
|
||||
* This file is part of MobileFFmpeg.
|
||||
*
|
||||
@@ -27,6 +27,7 @@ import android.content.pm.PackageManager;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Color;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.v4.app.ActivityCompat;
|
||||
@@ -40,9 +41,7 @@ import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.arthenica.mobileffmpeg.Config;
|
||||
import com.arthenica.mobileffmpeg.FFmpeg;
|
||||
import com.arthenica.mobileffmpeg.util.RunCallback;
|
||||
import com.arthenica.mobileffmpeg.util.AsynchronousTaskService;
|
||||
import com.arthenica.mobileffmpeg.util.AsyncCommandTask;
|
||||
import com.arthenica.mobileffmpeg.util.RunCallback;
|
||||
|
||||
import java.io.File;
|
||||
@@ -53,7 +52,6 @@ import java.util.HashMap;
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
@@ -66,8 +64,6 @@ public class MainActivity extends AppCompatActivity {
|
||||
Manifest.permission.CAMERA
|
||||
};
|
||||
|
||||
protected static final AsynchronousTaskService asynchronousTaskService = new AsynchronousTaskService();
|
||||
|
||||
protected static final Queue<Callable> actionQueue = new ConcurrentLinkedQueue<>();
|
||||
|
||||
protected static final Handler handler = new Handler();
|
||||
@@ -113,7 +109,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
final ViewPager viewPager = findViewById(R.id.pager);
|
||||
viewPager.setAdapter(new PagerAdapter(getSupportFragmentManager(), this, 6));
|
||||
viewPager.setAdapter(new PagerAdapter(getSupportFragmentManager(), this, 7));
|
||||
|
||||
waitForUIAction();
|
||||
|
||||
@@ -157,21 +153,10 @@ public class MainActivity extends AppCompatActivity {
|
||||
*
|
||||
* @param runCallback callback function to receive result of this execution
|
||||
* @param arguments FFmpeg command options/arguments
|
||||
* @return <code>Future</code> instance of asynchronous operation started
|
||||
*/
|
||||
public static Future executeAsync(final RunCallback runCallback, final String arguments) {
|
||||
return asynchronousTaskService.runAsynchronously(new Callable<Integer>() {
|
||||
|
||||
@Override
|
||||
public Integer call() {
|
||||
int returnCode = FFmpeg.execute(arguments, " ");
|
||||
if (runCallback != null) {
|
||||
runCallback.apply(returnCode);
|
||||
}
|
||||
|
||||
return returnCode;
|
||||
}
|
||||
});
|
||||
public static void executeAsync(final RunCallback runCallback, final String arguments) {
|
||||
final AsyncCommandTask asyncCommandTask = new AsyncCommandTask(runCallback);
|
||||
asyncCommandTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, arguments);
|
||||
}
|
||||
|
||||
public static void waitForUIAction() {
|
||||
|
||||
@@ -55,6 +55,9 @@ public class PagerAdapter extends FragmentPagerAdapter {
|
||||
case 5: {
|
||||
return VidStabTabFragment.newInstance(mainActivity);
|
||||
}
|
||||
case 6: {
|
||||
return PipeTabFragment.newInstance(mainActivity);
|
||||
}
|
||||
default: {
|
||||
return null;
|
||||
}
|
||||
@@ -87,6 +90,9 @@ public class PagerAdapter extends FragmentPagerAdapter {
|
||||
case 5: {
|
||||
return mainActivity.getString(R.string.vidstab_tab);
|
||||
}
|
||||
case 6: {
|
||||
return mainActivity.getString(R.string.pipe_tab);
|
||||
}
|
||||
default: {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,282 @@
|
||||
/*
|
||||
* Copyright (c) 2018 Taner Sener
|
||||
*
|
||||
* This file is part of MobileFFmpeg.
|
||||
*
|
||||
* MobileFFmpeg is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* MobileFFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with MobileFFmpeg. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.arthenica.mobileffmpeg.test;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.media.MediaPlayer;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.MediaController;
|
||||
import android.widget.TextView;
|
||||
import android.widget.VideoView;
|
||||
|
||||
import com.arthenica.mobileffmpeg.Config;
|
||||
import com.arthenica.mobileffmpeg.LogCallback;
|
||||
import com.arthenica.mobileffmpeg.LogMessage;
|
||||
import com.arthenica.mobileffmpeg.Statistics;
|
||||
import com.arthenica.mobileffmpeg.StatisticsCallback;
|
||||
import com.arthenica.mobileffmpeg.util.AsyncCatImageTask;
|
||||
import com.arthenica.mobileffmpeg.util.RunCallback;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
import static com.arthenica.mobileffmpeg.FFmpeg.RETURN_CODE_SUCCESS;
|
||||
import static com.arthenica.mobileffmpeg.test.MainActivity.TAG;
|
||||
|
||||
public class PipeTabFragment extends Fragment {
|
||||
|
||||
private MainActivity mainActivity;
|
||||
private VideoView videoView;
|
||||
private AlertDialog progressDialog;
|
||||
private Statistics statistics;
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull final LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_pipe_tab, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
if (getView() != null) {
|
||||
View createButton = getView().findViewById(R.id.createButton);
|
||||
if (createButton != null) {
|
||||
createButton.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
createVideo();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
videoView = getView().findViewById(R.id.videoPlayerFrame);
|
||||
}
|
||||
|
||||
progressDialog = mainActivity.createProgressDialog("Creating video");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUserVisibleHint(boolean isVisibleToUser) {
|
||||
super.setUserVisibleHint(isVisibleToUser);
|
||||
if (isVisibleToUser) {
|
||||
setActive();
|
||||
}
|
||||
}
|
||||
|
||||
public void setMainActivity(MainActivity mainActivity) {
|
||||
this.mainActivity = mainActivity;
|
||||
}
|
||||
|
||||
public static PipeTabFragment newInstance(final MainActivity mainActivity) {
|
||||
final PipeTabFragment fragment = new PipeTabFragment();
|
||||
fragment.setMainActivity(mainActivity);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
public void enableLogCallback() {
|
||||
Config.enableLogCallback(new LogCallback() {
|
||||
|
||||
@Override
|
||||
public void apply(LogMessage message) {
|
||||
Log.d(MainActivity.TAG, message.getText());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void enableStatisticsCallback() {
|
||||
Config.enableStatisticsCallback(new StatisticsCallback() {
|
||||
|
||||
@Override
|
||||
public void apply(final Statistics newStatistics) {
|
||||
MainActivity.addUIAction(new Callable() {
|
||||
|
||||
@Override
|
||||
public Object call() {
|
||||
PipeTabFragment.this.statistics = newStatistics;
|
||||
updateProgressDialog();
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void startAsyncCatImageProcess(final String imagePath, final String namedPipePath) {
|
||||
AsyncCatImageTask asyncTask = new AsyncCatImageTask();
|
||||
asyncTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, imagePath, namedPipePath);
|
||||
}
|
||||
|
||||
public void createVideo() {
|
||||
final File image1File = new File(mainActivity.getCacheDir(), "colosseum.jpg");
|
||||
final File image2File = new File(mainActivity.getCacheDir(), "pyramid.jpg");
|
||||
final File image3File = new File(mainActivity.getCacheDir(), "tajmahal.jpg");
|
||||
final File videoFile = getVideoFile();
|
||||
|
||||
String pipe1 = Config.registerNewFFmpegPipe(mainActivity);
|
||||
String pipe2 = Config.registerNewFFmpegPipe(mainActivity);
|
||||
String pipe3 = Config.registerNewFFmpegPipe(mainActivity);
|
||||
|
||||
try {
|
||||
|
||||
// IF VIDEO IS PLAYING STOP PLAYBACK
|
||||
videoView.stopPlayback();
|
||||
|
||||
if (videoFile.exists()) {
|
||||
videoFile.delete();
|
||||
}
|
||||
|
||||
Log.d(TAG, "Testing PIPE with 'mpeg4' codec");
|
||||
|
||||
showProgressDialog();
|
||||
|
||||
mainActivity.resourceToFile(R.drawable.colosseum, image1File);
|
||||
mainActivity.resourceToFile(R.drawable.pyramid, image2File);
|
||||
mainActivity.resourceToFile(R.drawable.tajmahal, image3File);
|
||||
|
||||
final String ffmpegCommand = Video.generateCreateVideoWithPipesScript(pipe1, pipe2, pipe3, videoFile.getAbsolutePath());
|
||||
|
||||
Log.d(TAG, String.format("FFmpeg process started with arguments\n'%s'", ffmpegCommand));
|
||||
|
||||
MainActivity.executeAsync(new RunCallback() {
|
||||
|
||||
@Override
|
||||
public void apply(final int returnCode) {
|
||||
Log.d(TAG, String.format("FFmpeg process exited with rc %d", returnCode));
|
||||
|
||||
hideProgressDialog();
|
||||
|
||||
MainActivity.addUIAction(new Callable() {
|
||||
|
||||
@Override
|
||||
public Object call() {
|
||||
if (returnCode == RETURN_CODE_SUCCESS) {
|
||||
Log.d(TAG, "Create completed successfully; playing video.");
|
||||
playVideo();
|
||||
} else {
|
||||
Popup.show(mainActivity, "Create failed. Please check log for the details.");
|
||||
Log.d(TAG, String.format("Create failed with rc=%d", returnCode));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
}, ffmpegCommand);
|
||||
|
||||
// START ASYNC PROCESSES AFTER INITIATING FFMPEG COMMAND
|
||||
startAsyncCatImageProcess(image1File.getAbsolutePath(), pipe1);
|
||||
startAsyncCatImageProcess(image2File.getAbsolutePath(), pipe2);
|
||||
startAsyncCatImageProcess(image3File.getAbsolutePath(), pipe3);
|
||||
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG, "Create video failed", e);
|
||||
Popup.show(mainActivity, "Create video failed");
|
||||
}
|
||||
}
|
||||
|
||||
protected void playVideo() {
|
||||
MediaController mediaController = new MediaController(mainActivity);
|
||||
mediaController.setAnchorView(videoView);
|
||||
videoView.setVideoURI(Uri.parse("file://" + getVideoFile().getAbsolutePath()));
|
||||
videoView.setMediaController(mediaController);
|
||||
videoView.requestFocus();
|
||||
videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
|
||||
|
||||
@Override
|
||||
public void onPrepared(MediaPlayer mp) {
|
||||
videoView.setBackgroundColor(0x00000000);
|
||||
}
|
||||
});
|
||||
videoView.setOnErrorListener(new MediaPlayer.OnErrorListener() {
|
||||
|
||||
@Override
|
||||
public boolean onError(MediaPlayer mp, int what, int extra) {
|
||||
videoView.stopPlayback();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
videoView.start();
|
||||
}
|
||||
|
||||
protected File getVideoFile() {
|
||||
return new File(mainActivity.getFilesDir(), "video.mp4");
|
||||
}
|
||||
|
||||
public void setActive() {
|
||||
Log.i(MainActivity.TAG, "Pipe Tab Activated");
|
||||
enableLogCallback();
|
||||
enableStatisticsCallback();
|
||||
Popup.show(mainActivity, Tooltip.PIPE_TEST_TOOLTIP_TEXT);
|
||||
}
|
||||
|
||||
protected void showProgressDialog() {
|
||||
|
||||
// CLEAN STATISTICS
|
||||
statistics = null;
|
||||
Config.resetStatistics();
|
||||
|
||||
progressDialog.show();
|
||||
}
|
||||
|
||||
protected void updateProgressDialog() {
|
||||
if (statistics == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
int timeInMilliseconds = this.statistics.getTime();
|
||||
if (timeInMilliseconds > 0) {
|
||||
int totalVideoDuration = 9000;
|
||||
|
||||
String completePercentage = new BigDecimal(timeInMilliseconds).multiply(new BigDecimal(100)).divide(new BigDecimal(totalVideoDuration), 0, BigDecimal.ROUND_HALF_UP).toString();
|
||||
|
||||
TextView textView = progressDialog.findViewById(R.id.progressDialogText);
|
||||
if (textView != null) {
|
||||
textView.setText(String.format("Creating video: %% %s", completePercentage));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void hideProgressDialog() {
|
||||
progressDialog.dismiss();
|
||||
|
||||
MainActivity.addUIAction(new Callable() {
|
||||
|
||||
@Override
|
||||
public Object call() {
|
||||
PipeTabFragment.this.progressDialog = mainActivity.createProgressDialog("Creating video");
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -39,4 +39,7 @@ public interface Tooltip {
|
||||
// VID.STAB TEST
|
||||
String VIDSTAB_TEST_TOOLTIP_TEXT = "Click the button to stabilize video. Original video will play above and stabilized video will play below";
|
||||
|
||||
// PIPE TEST
|
||||
String PIPE_TEST_TOOLTIP_TEXT = "Click the button to create a video using pipe redirection. Created video will play inside the frame below";
|
||||
|
||||
}
|
||||
|
||||
@@ -20,13 +20,34 @@
|
||||
package com.arthenica.mobileffmpeg.test;
|
||||
|
||||
/**
|
||||
* <p>Generates an FFmpeg command to create a 640x427 video from provided images.
|
||||
* <p>Generates FFmpeg scripts to create videos from provided images.
|
||||
*
|
||||
* @author Taner Sener
|
||||
*/
|
||||
public class Video {
|
||||
|
||||
public static String generateEncodeVideoScript(final String image1Path, final String image2Path, final String image3Path, final String videoFilePath, final String videoCodec, final String customOptions) {
|
||||
static String generateCreateVideoWithPipesScript(final String image1Pipe, final String image2Pipe, final String image3Pipe, final String videoFilePath) {
|
||||
return
|
||||
"-hide_banner -y -i " + image1Pipe + " " +
|
||||
"-i " + image2Pipe + " " +
|
||||
"-i " + image3Pipe + " " +
|
||||
"-filter_complex " +
|
||||
"[0:v]loop=loop=-1:size=1:start=0,setpts=PTS-STARTPTS,scale=w=\'if(gte(iw/ih,640/427),min(iw,640),-1)\':h=\'if(gte(iw/ih,640/427),-1,min(ih,427))\',scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=sar=1/1,split=2[stream1out1][stream1out2];" +
|
||||
"[1:v]loop=loop=-1:size=1:start=0,setpts=PTS-STARTPTS,scale=w=\'if(gte(iw/ih,640/427),min(iw,640),-1)\':h=\'if(gte(iw/ih,640/427),-1,min(ih,427))\',scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=sar=1/1,split=2[stream2out1][stream2out2];" +
|
||||
"[2:v]loop=loop=-1:size=1:start=0,setpts=PTS-STARTPTS,scale=w=\'if(gte(iw/ih,640/427),min(iw,640),-1)\':h=\'if(gte(iw/ih,640/427),-1,min(ih,427))\',scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=sar=1/1,split=2[stream3out1][stream3out2];" +
|
||||
"[stream1out1]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=3,select=lte(n\\,90)[stream1overlaid];" +
|
||||
"[stream1out2]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=1,select=lte(n\\,30)[stream1ending];" +
|
||||
"[stream2out1]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=2,select=lte(n\\,60)[stream2overlaid];" +
|
||||
"[stream2out2]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=1,select=lte(n\\,30),split=2[stream2starting][stream2ending];" +
|
||||
"[stream3out1]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=2,select=lte(n\\,60)[stream3overlaid];" +
|
||||
"[stream3out2]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=1,select=lte(n\\,30)[stream3starting];" +
|
||||
"[stream2starting][stream1ending]blend=all_expr=\'if(gte(X,(W/2)*T/1)*lte(X,W-(W/2)*T/1),B,A)\':shortest=1[stream2blended];" +
|
||||
"[stream3starting][stream2ending]blend=all_expr=\'if(gte(X,(W/2)*T/1)*lte(X,W-(W/2)*T/1),B,A)\':shortest=1[stream3blended];" +
|
||||
"[stream1overlaid][stream2blended][stream2overlaid][stream3blended][stream3overlaid]concat=n=5:v=1:a=0,scale=w=640:h=424,format=yuv420p[video]" +
|
||||
" -map [video] -vsync 2 -async 1 -c:v mpeg4 -r 30 " + videoFilePath;
|
||||
}
|
||||
|
||||
static String generateEncodeVideoScript(final String image1Path, final String image2Path, final String image3Path, final String videoFilePath, final String videoCodec, final String customOptions) {
|
||||
return
|
||||
"-hide_banner -y -loop 1 -i " + image1Path + " " +
|
||||
"-loop 1 -i " + image2Path + " " +
|
||||
@@ -47,7 +68,7 @@ public class Video {
|
||||
" -map [video] -vsync 2 -async 1 " + customOptions + "-c:v " + videoCodec.toLowerCase() + " -r 30 " + videoFilePath;
|
||||
}
|
||||
|
||||
public static String generateShakingVideoScript(final String image1Path, final String image2Path, final String image3Path, final String videoFilePath) {
|
||||
static String generateShakingVideoScript(final String image1Path, final String image2Path, final String image3Path, final String videoFilePath) {
|
||||
return
|
||||
"-hide_banner -y -loop 1 -i " + image1Path + " " +
|
||||
"-loop 1 -i " + image2Path + " " +
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2019 Taner Sener
|
||||
*
|
||||
* This file is part of MobileFFmpeg.
|
||||
*
|
||||
* MobileFFmpeg is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* MobileFFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with MobileFFmpeg. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.arthenica.mobileffmpeg.util;
|
||||
|
||||
import android.os.AsyncTask;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static com.arthenica.mobileffmpeg.test.MainActivity.TAG;
|
||||
|
||||
public class AsyncCatImageTask extends AsyncTask<String, Integer, Integer> {
|
||||
|
||||
@Override
|
||||
protected Integer doInBackground(String... inputs) {
|
||||
try {
|
||||
final String asyncCommand = "cat " + inputs[0] + " > " + inputs[1];
|
||||
Log.d(TAG, String.format("Starting async cat image command: %s", asyncCommand));
|
||||
|
||||
final Process process = Runtime.getRuntime().exec(new String[]{"sh", "-c", asyncCommand});
|
||||
int rc = process.waitFor();
|
||||
|
||||
Log.d(TAG, String.format("Async cat image command: %s exited with %d.", asyncCommand, rc));
|
||||
|
||||
return rc;
|
||||
} catch (final IOException | InterruptedException e) {
|
||||
Log.e(TAG, String.format("Async cat image command failed for %s.", inputs[0]), e);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2019 Taner Sener
|
||||
*
|
||||
* This file is part of MobileFFmpeg.
|
||||
*
|
||||
* MobileFFmpeg is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* MobileFFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with MobileFFmpeg. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.arthenica.mobileffmpeg.util;
|
||||
|
||||
import android.os.AsyncTask;
|
||||
|
||||
import com.arthenica.mobileffmpeg.FFmpeg;
|
||||
|
||||
public class AsyncCommandTask extends AsyncTask<String, Integer, Integer> {
|
||||
|
||||
private final RunCallback runCallback;
|
||||
|
||||
public AsyncCommandTask(final RunCallback runCallback) {
|
||||
this.runCallback = runCallback;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Integer doInBackground(final String... arguments) {
|
||||
return FFmpeg.execute(arguments[0], " ");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(final Integer rc) {
|
||||
if (runCallback != null) {
|
||||
runCallback.apply(rc);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018 Taner Sener
|
||||
*
|
||||
* This file is part of MobileFFmpeg.
|
||||
*
|
||||
* MobileFFmpeg is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* MobileFFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with MobileFFmpeg. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.arthenica.mobileffmpeg.util;
|
||||
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class AsyncThreadFactory implements ThreadFactory {
|
||||
|
||||
protected static final String DEFAULT_THREAD_NAME_PREFIX = "AsyncTaskThread";
|
||||
|
||||
protected static AtomicInteger threadCounter;
|
||||
|
||||
static {
|
||||
threadCounter = new AtomicInteger(1);
|
||||
}
|
||||
|
||||
private final String namePrefix;
|
||||
|
||||
public AsyncThreadFactory() {
|
||||
this(DEFAULT_THREAD_NAME_PREFIX);
|
||||
}
|
||||
|
||||
public AsyncThreadFactory(final String namePrefix) {
|
||||
this.namePrefix = namePrefix;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Thread newThread(@NonNull final Runnable runnable) {
|
||||
return new Thread(runnable, MessageFormat.format("{0}-{1,number,#}", namePrefix, threadCounter.getAndIncrement()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018 Taner Sener
|
||||
*
|
||||
* This file is part of MobileFFmpeg.
|
||||
*
|
||||
* MobileFFmpeg is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* MobileFFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with MobileFFmpeg. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.arthenica.mobileffmpeg.util;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class AsynchronousTaskService {
|
||||
|
||||
protected static final String TAG = "mobile-ffmpeg-android";
|
||||
|
||||
protected final BlockingQueue<Runnable> queue;
|
||||
|
||||
protected final Object executorServiceLock;
|
||||
|
||||
protected ThreadPoolExecutor executorService;
|
||||
|
||||
protected int coreThreadPoolSize;
|
||||
|
||||
protected int maximumThreadPoolSize;
|
||||
|
||||
protected int keepAliveTimeInSeconds;
|
||||
|
||||
public AsynchronousTaskService() {
|
||||
this(1, 5, 30);
|
||||
}
|
||||
|
||||
public AsynchronousTaskService(final int coreThreadPoolSize, final int maximumThreadPoolSize, final int keepAliveTimeInSeconds) {
|
||||
this.executorServiceLock = new Object();
|
||||
this.queue = new LinkedBlockingQueue<>();
|
||||
this.executorService = null;
|
||||
|
||||
this.coreThreadPoolSize = coreThreadPoolSize;
|
||||
this.maximumThreadPoolSize = maximumThreadPoolSize;
|
||||
this.keepAliveTimeInSeconds = keepAliveTimeInSeconds;
|
||||
}
|
||||
|
||||
public void init(final int coreThreadPoolSize, final int maximumThreadPoolSize, final int keepAliveTimeInSeconds) {
|
||||
this.coreThreadPoolSize = coreThreadPoolSize;
|
||||
this.maximumThreadPoolSize = maximumThreadPoolSize;
|
||||
this.keepAliveTimeInSeconds = keepAliveTimeInSeconds;
|
||||
}
|
||||
|
||||
public void initializeExecutorService() {
|
||||
synchronized (executorServiceLock) {
|
||||
if (executorService != null) {
|
||||
executorService.shutdown();
|
||||
}
|
||||
|
||||
executorService = new ThreadPoolExecutor(coreThreadPoolSize, maximumThreadPoolSize, keepAliveTimeInSeconds, TimeUnit.SECONDS, queue, new AsyncThreadFactory());
|
||||
}
|
||||
}
|
||||
|
||||
public <T> Future<T> runAsynchronously(final Callable<T> callable) {
|
||||
|
||||
/* INITIALIZE EXECUTOR SERVICE ONLY IF NECESSARY */
|
||||
if (executorService == null) {
|
||||
initializeExecutorService();
|
||||
}
|
||||
|
||||
final String className = callable.getClass().getSimpleName();
|
||||
|
||||
try {
|
||||
return executorService.submit(callable);
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, String.format("Failed to run asynchronous task %s. Running it synchronously.", className), e);
|
||||
return runSynchronously(callable);
|
||||
}
|
||||
}
|
||||
|
||||
public <T> Future<T> runSynchronously(final Callable<T> callable) {
|
||||
T called = null;
|
||||
|
||||
/* INITIALIZE EXECUTOR SERVICE ONLY IF NECESSARY */
|
||||
if (executorService == null) {
|
||||
initializeExecutorService();
|
||||
}
|
||||
|
||||
final String className = callable.getClass().getSimpleName();
|
||||
|
||||
try {
|
||||
called = callable.call();
|
||||
return new SynchronousResultFuture<>(called, true);
|
||||
} catch (final Exception e) {
|
||||
Log.d(TAG, "Failed to run asynchronous task " + className + " synchronously.", e);
|
||||
return new SynchronousResultFuture<>(called, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
if (executorService != null) {
|
||||
synchronized (executorServiceLock) {
|
||||
executorService.shutdown();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018 Taner Sener
|
||||
*
|
||||
* This file is part of MobileFFmpeg.
|
||||
*
|
||||
* MobileFFmpeg is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* MobileFFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with MobileFFmpeg. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.arthenica.mobileffmpeg.util;
|
||||
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
public class SynchronousResultFuture<V> implements Future<V> {
|
||||
|
||||
protected final V v;
|
||||
|
||||
protected final boolean completed;
|
||||
|
||||
public SynchronousResultFuture(final V v, final boolean completed) {
|
||||
this.v = v;
|
||||
this.completed = completed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean cancel(final boolean mayInterruptIfRunning) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return !completed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDone() {
|
||||
return completed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public V get() throws InterruptedException, ExecutionException {
|
||||
return v;
|
||||
}
|
||||
|
||||
@Override
|
||||
public V get(final long timeout, final TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
|
||||
return v;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
tools:context=".PipeTabFragment">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/createButtonLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center">
|
||||
|
||||
<Button
|
||||
android:id="@+id/createButton"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/rounded_button"
|
||||
android:fontFamily="sans-serif"
|
||||
android:gravity="center"
|
||||
android:text="@string/video_create_button_text"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<VideoView
|
||||
android:id="@+id/videoPlayerFrame"
|
||||
android:layout_width="wrap_content"
|
||||
android:background="@drawable/rounded_video_frame"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_margin="20dp"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
@@ -6,10 +6,12 @@
|
||||
<string name="audio_tab">AUDIO</string>
|
||||
<string name="subtitle_tab">SUBTITLE</string>
|
||||
<string name="vidstab_tab">VID.STAB</string>
|
||||
<string name="pipe_tab">PIPE</string>
|
||||
<string name="command_text_input_placeholder">Enter command</string>
|
||||
<string name="command_run_async_button_text">RUN ASYNC</string>
|
||||
<string name="command_run_button_text">RUN</string>
|
||||
<string name="video_encode_button_text">ENCODE</string>
|
||||
<string name="video_create_button_text">CREATE</string>
|
||||
<string name="https_get_info_button_text">GET INFO</string>
|
||||
<string name="https_text_input_placeholder">Enter https url</string>
|
||||
<string name="audio_encode_button_text">ENCODE</string>
|
||||
|
||||
|
Before Width: | Height: | Size: 66 KiB |
@@ -47,15 +47,15 @@ cmake -Wno-dev \
|
||||
-DCMAKE_C_FLAGS="${CFLAGS}" \
|
||||
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
|
||||
-DCMAKE_SYSROOT="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_FIND_ROOT_PATH="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_SYSROOT="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_FIND_ROOT_PATH="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX="${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME}" \
|
||||
-DCMAKE_SYSTEM_NAME=Generic \
|
||||
-DCMAKE_C_COMPILER="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$CC" \
|
||||
-DCMAKE_LINKER="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$LD" \
|
||||
-DCMAKE_AR="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$AR" \
|
||||
-DCMAKE_AS="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$AS" \
|
||||
-DCMAKE_C_COMPILER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$CC" \
|
||||
-DCMAKE_LINKER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$LD" \
|
||||
-DCMAKE_AR="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$AR" \
|
||||
-DCMAKE_AS="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$AS" \
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$(get_cmake_target_processor) \
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=1 \
|
||||
-DFFT_LIB=kissfft \
|
||||
|
||||
@@ -91,23 +91,42 @@ get_target_host() {
|
||||
esac
|
||||
}
|
||||
|
||||
get_toolchain() {
|
||||
|
||||
get_clang_target_host() {
|
||||
case ${ARCH} in
|
||||
arm-v7a | arm-v7a-neon)
|
||||
echo "arm"
|
||||
echo "armv7a-linux-androideabi${API}"
|
||||
;;
|
||||
arm64-v8a)
|
||||
echo "aarch64"
|
||||
echo "aarch64-linux-android${API}"
|
||||
;;
|
||||
x86)
|
||||
echo "i686"
|
||||
echo "i686-linux-android${API}"
|
||||
;;
|
||||
x86-64)
|
||||
echo "x86_64"
|
||||
echo "x86_64-linux-android${API}"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
get_toolchain() {
|
||||
HOST_OS=$(uname -s)
|
||||
case ${HOST_OS} in
|
||||
Darwin) HOST_OS=darwin;;
|
||||
Linux) HOST_OS=linux;;
|
||||
FreeBsd) HOST_OS=freebsd;;
|
||||
CYGWIN*|*_NT-*) HOST_OS=cygwin;;
|
||||
esac
|
||||
|
||||
HOST_ARCH=$(uname -m)
|
||||
case ${HOST_ARCH} in
|
||||
i?86) HOST_ARCH=x86;;
|
||||
x86_64|amd64) HOST_ARCH=x86_64;;
|
||||
esac
|
||||
|
||||
echo "${HOST_OS}-${HOST_ARCH}"
|
||||
}
|
||||
|
||||
get_cmake_target_processor() {
|
||||
case ${ARCH} in
|
||||
arm-v7a | arm-v7a-neon)
|
||||
@@ -184,7 +203,7 @@ get_android_arch() {
|
||||
}
|
||||
|
||||
get_common_includes() {
|
||||
echo "-I${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot/usr/include -I${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot/usr/local/include"
|
||||
echo "-I${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot/usr/include -I${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot/usr/local/include"
|
||||
}
|
||||
|
||||
get_common_cflags() {
|
||||
@@ -328,22 +347,22 @@ get_cxxflags() {
|
||||
}
|
||||
|
||||
get_common_linked_libraries() {
|
||||
local COMMON_LIBRARY_PATHS="-L${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/${TARGET_HOST}/lib -L${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot/usr/lib -L${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/lib"
|
||||
local COMMON_LIBRARY_PATHS="-L${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/${TARGET_HOST}/lib -L${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot/usr/lib/${TARGET_HOST}/${API} -L${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/lib"
|
||||
|
||||
case $1 in
|
||||
ffmpeg)
|
||||
if [[ -z ${MOBILE_FFMPEG_LTS_BUILD} ]]; then
|
||||
echo "-lc -lm -ldl -llog -lcamera2ndk -lmediandk -lc++_shared ${COMMON_LIBRARY_PATHS}"
|
||||
echo "-lc -lm -ldl -llog -lcamera2ndk -lmediandk ${COMMON_LIBRARY_PATHS}"
|
||||
else
|
||||
echo "-lc -lm -ldl -llog -lc++_shared ${COMMON_LIBRARY_PATHS}"
|
||||
echo "-lc -lm -ldl -llog ${COMMON_LIBRARY_PATHS}"
|
||||
fi
|
||||
;;
|
||||
tesseract)
|
||||
echo "-lc -lm -ldl -llog -lc++_shared ${COMMON_LIBRARY_PATHS}"
|
||||
;;
|
||||
libvpx)
|
||||
echo "-lc -lm ${COMMON_LIBRARY_PATHS}"
|
||||
;;
|
||||
tesseract | x265)
|
||||
echo "-lc -lm -ldl -llog -lc++_shared ${COMMON_LIBRARY_PATHS}"
|
||||
;;
|
||||
*)
|
||||
echo "-lc -lm -ldl -llog ${COMMON_LIBRARY_PATHS}"
|
||||
;;
|
||||
@@ -732,7 +751,7 @@ URL: https://github.com/tesseract-ocr/tesseract
|
||||
Version: ${TESSERACT_VERSION}
|
||||
|
||||
Requires: lept, libjpeg, libpng, giflib, zlib, libwebp, libtiff-4
|
||||
Libs: -L\${libdir} -ltesseract
|
||||
Libs: -L\${libdir} -ltesseract -lc++_shared
|
||||
Cflags: -I\${includedir}
|
||||
EOF
|
||||
}
|
||||
@@ -770,7 +789,7 @@ Version: ${X265_VERSION}
|
||||
|
||||
Requires:
|
||||
Libs: -L\${libdir} -lx265
|
||||
Libs.private: -lm -lgcc -lgcc -ldl -lgcc -lgcc -ldl
|
||||
Libs.private: -lm -lgcc -lgcc -ldl -lgcc -lgcc -ldl -lc++_shared
|
||||
Cflags: -I\${includedir}
|
||||
EOF
|
||||
}
|
||||
@@ -795,10 +814,10 @@ EOF
|
||||
}
|
||||
|
||||
create_zlib_package_config() {
|
||||
ZLIB_VERSION=$(grep '#define ZLIB_VERSION' ${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot/usr/include/zlib.h | grep -Eo '\".*\"' | sed -e 's/\"//g')
|
||||
ZLIB_VERSION=$(grep '#define ZLIB_VERSION' ${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot/usr/include/zlib.h | grep -Eo '\".*\"' | sed -e 's/\"//g')
|
||||
|
||||
cat > "${INSTALL_PKG_CONFIG_DIR}/zlib.pc" << EOF
|
||||
prefix=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot/usr
|
||||
prefix=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot/usr
|
||||
exec_prefix=\${prefix}
|
||||
libdir=${ANDROID_NDK_ROOT}/platforms/android-${API}/arch-${TOOLCHAIN_ARCH}/usr/lib
|
||||
includedir=\${prefix}/include
|
||||
@@ -876,15 +895,15 @@ download_gpl_library_source() {
|
||||
GPL_LIB_DEST_DIR="libvidstab"
|
||||
;;
|
||||
x264)
|
||||
GPL_LIB_URL="ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20181224-2245-stable.tar.bz2"
|
||||
GPL_LIB_FILE="x264-snapshot-20181224-2245-stable.tar.bz2"
|
||||
GPL_LIB_ORIG_DIR="x264-snapshot-20181224-2245-stable"
|
||||
GPL_LIB_URL="ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20190328-2245-stable.tar.bz2"
|
||||
GPL_LIB_FILE="x264-snapshot-20190328-2245-stable.tar.bz2"
|
||||
GPL_LIB_ORIG_DIR="x264-snapshot-20190328-2245-stable"
|
||||
GPL_LIB_DEST_DIR="x264"
|
||||
;;
|
||||
x265)
|
||||
GPL_LIB_URL="https://download.videolan.org/pub/videolan/x265/x265_2.9.tar.gz"
|
||||
GPL_LIB_FILE="x265-2.9.tar.gz"
|
||||
GPL_LIB_ORIG_DIR="x265_2.9"
|
||||
GPL_LIB_URL="https://download.videolan.org/pub/videolan/x265/x265_3.0.tar.gz"
|
||||
GPL_LIB_FILE="x265-3.0.tar.gz"
|
||||
GPL_LIB_ORIG_DIR="x265_3.0"
|
||||
GPL_LIB_DEST_DIR="x265"
|
||||
;;
|
||||
xvidcore)
|
||||
@@ -964,13 +983,13 @@ download_gpl_library_source() {
|
||||
}
|
||||
|
||||
set_toolchain_clang_paths() {
|
||||
export PATH=$PATH:${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin
|
||||
export PATH=$PATH:${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin
|
||||
|
||||
TARGET_HOST=$(get_target_host)
|
||||
|
||||
export AR=${TARGET_HOST}-ar
|
||||
export CC=${TARGET_HOST}-clang
|
||||
export CXX=${TARGET_HOST}-clang++
|
||||
export CC=$(get_clang_target_host)-clang
|
||||
export CXX=$(get_clang_target_host)-clang++
|
||||
|
||||
if [ "$1" == "x264" ]; then
|
||||
export AS=${CC}
|
||||
@@ -1002,14 +1021,6 @@ set_toolchain_clang_paths() {
|
||||
prepare_inline_sed
|
||||
}
|
||||
|
||||
create_toolchain() {
|
||||
local TOOLCHAIN_DIR="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-"${TOOLCHAIN}
|
||||
|
||||
if [ ! -d ${TOOLCHAIN_DIR} ]; then
|
||||
${ANDROID_NDK_ROOT}/build/tools/make_standalone_toolchain.py --arch ${TOOLCHAIN_ARCH} --api ${API} --stl libc++ --install-dir ${TOOLCHAIN_DIR} || exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
build_cpufeatures() {
|
||||
|
||||
# CLEAN OLD BUILD
|
||||
@@ -1022,9 +1033,9 @@ build_cpufeatures() {
|
||||
echo -e "\nINFO: Building cpu-features for for ${ARCH}\n" 1>>${BASEDIR}/build.log 2>&1
|
||||
|
||||
# THEN BUILD FOR THIS ABI
|
||||
${TARGET_HOST}-clang -c ${ANDROID_NDK_ROOT}/sources/android/cpufeatures/cpu-features.c -o ${ANDROID_NDK_ROOT}/sources/android/cpufeatures/cpu-features.o 1>>${BASEDIR}/build.log 2>&1
|
||||
$(get_clang_target_host)-clang -c ${ANDROID_NDK_ROOT}/sources/android/cpufeatures/cpu-features.c -o ${ANDROID_NDK_ROOT}/sources/android/cpufeatures/cpu-features.o 1>>${BASEDIR}/build.log 2>&1
|
||||
${TARGET_HOST}-ar rcs ${ANDROID_NDK_ROOT}/sources/android/cpufeatures/libcpufeatures.a ${ANDROID_NDK_ROOT}/sources/android/cpufeatures/cpu-features.o 1>>${BASEDIR}/build.log 2>&1
|
||||
${TARGET_HOST}-clang -shared ${ANDROID_NDK_ROOT}/sources/android/cpufeatures/cpu-features.o -o ${ANDROID_NDK_ROOT}/sources/android/cpufeatures/libcpufeatures.so 1>>${BASEDIR}/build.log 2>&1
|
||||
$(get_clang_target_host)-clang -shared ${ANDROID_NDK_ROOT}/sources/android/cpufeatures/cpu-features.o -o ${ANDROID_NDK_ROOT}/sources/android/cpufeatures/libcpufeatures.so 1>>${BASEDIR}/build.log 2>&1
|
||||
|
||||
create_cpufeatures_package_config
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ fi
|
||||
./configure \
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--with-pic \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--without-docbook \
|
||||
--without-xmlwf \
|
||||
--enable-static \
|
||||
|
||||
@@ -299,7 +299,7 @@ fi
|
||||
|
||||
# SET DEBUG OPTIONS
|
||||
if [[ -z ${MOBILE_FFMPEG_DEBUG} ]]; then
|
||||
DEBUG_OPTIONS="--disable-debug";
|
||||
DEBUG_OPTIONS="--disable-debug --enable-lto";
|
||||
else
|
||||
DEBUG_OPTIONS="--enable-debug";
|
||||
fi
|
||||
@@ -314,20 +314,24 @@ export CFLAGS="${HIGH_PRIORITY_INCLUDES} ${CFLAGS}"
|
||||
export CXXFLAGS="${CXXFLAGS}"
|
||||
export LDFLAGS="${LDFLAGS}"
|
||||
|
||||
# USE HIGHER LIMITS FOR FFMPEG LINKING
|
||||
ulimit -n 2048 1>>${BASEDIR}/build.log 2>&1
|
||||
|
||||
./configure \
|
||||
--cross-prefix="${TARGET_HOST}-" \
|
||||
--sysroot="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot" \
|
||||
--sysroot="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
|
||||
--prefix="${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME}" \
|
||||
--pkg-config="${HOST_PKG_CONFIG_PATH}" \
|
||||
--enable-version3 \
|
||||
--arch="${TARGET_ARCH}" \
|
||||
--cpu="${TARGET_CPU}" \
|
||||
--cc="${CC}" \
|
||||
--cxx="${CXX}" \
|
||||
--target-os=android \
|
||||
${ASM_FLAGS} \
|
||||
--enable-cross-compile \
|
||||
--enable-pic \
|
||||
--enable-jni \
|
||||
--enable-lto \
|
||||
--enable-optimizations \
|
||||
--enable-swscale \
|
||||
--enable-shared \
|
||||
|
||||
@@ -47,7 +47,7 @@ export LIBPNG_LIBS="-L${BASEDIR}/prebuilt/android-$(get_target_build)/libpng/lib
|
||||
--with-pic \
|
||||
--with-zlib \
|
||||
--with-png \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--without-harfbuzz \
|
||||
--without-bzip2 \
|
||||
--without-fsref \
|
||||
@@ -63,6 +63,6 @@ export LIBPNG_LIBS="-L${BASEDIR}/prebuilt/android-$(get_target_build)/libpng/lib
|
||||
make -j$(get_cpu_count) || exit 1
|
||||
|
||||
# CREATE PACKAGE CONFIG MANUALLY
|
||||
create_freetype_package_config "22.0.16"
|
||||
create_freetype_package_config "23.0.17"
|
||||
|
||||
make install || exit 1
|
||||
|
||||
@@ -46,7 +46,7 @@ fi
|
||||
./configure \
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--with-pic \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--enable-static \
|
||||
--disable-shared \
|
||||
--disable-fast-install \
|
||||
|
||||
@@ -46,7 +46,7 @@ fi
|
||||
./configure \
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--with-pic \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--enable-static \
|
||||
--disable-shared \
|
||||
--disable-fast-install \
|
||||
|
||||
@@ -45,7 +45,7 @@ fi
|
||||
./configure \
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--with-pic \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--enable-static \
|
||||
--disable-assembly \
|
||||
--disable-shared \
|
||||
|
||||
@@ -56,7 +56,7 @@ fi
|
||||
./configure \
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--with-pic \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--with-included-libtasn1 \
|
||||
--with-included-unistring \
|
||||
--without-idn \
|
||||
|
||||
@@ -47,16 +47,16 @@ cmake -Wno-dev \
|
||||
-DCMAKE_C_FLAGS="${CFLAGS}" \
|
||||
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
|
||||
-DCMAKE_SYSROOT="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_FIND_ROOT_PATH="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_SYSROOT="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_FIND_ROOT_PATH="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX="${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME}" \
|
||||
-DCMAKE_SYSTEM_NAME=Generic \
|
||||
-DCMAKE_C_COMPILER="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$CC" \
|
||||
-DCMAKE_CXX_COMPILER="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$CXX" \
|
||||
-DCMAKE_LINKER="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$LD" \
|
||||
-DCMAKE_AR="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$AR" \
|
||||
-DCMAKE_AS="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$AS" \
|
||||
-DCMAKE_C_COMPILER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$CC" \
|
||||
-DCMAKE_CXX_COMPILER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$CXX" \
|
||||
-DCMAKE_LINKER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$LD" \
|
||||
-DCMAKE_AR="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$AR" \
|
||||
-DCMAKE_AS="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$AS" \
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=1 \
|
||||
-DENABLE_STATIC=1 \
|
||||
-DENABLE_SHARED=0 \
|
||||
|
||||
@@ -46,7 +46,7 @@ fi
|
||||
./configure \
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--with-pic \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--enable-static \
|
||||
--disable-shared \
|
||||
--disable-fast-install \
|
||||
|
||||
@@ -46,7 +46,7 @@ fi
|
||||
./configure \
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--with-pic \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--with-libiconv-prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/libiconv \
|
||||
--enable-static \
|
||||
--disable-shared \
|
||||
|
||||
@@ -67,16 +67,16 @@ cmake -Wno-dev \
|
||||
-DCMAKE_C_FLAGS="${CFLAGS}" \
|
||||
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
|
||||
-DCMAKE_SYSROOT="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_FIND_ROOT_PATH="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_SYSROOT="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_FIND_ROOT_PATH="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_SYSTEM_NAME=Generic \
|
||||
-DCMAKE_INSTALL_PREFIX="${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME}" \
|
||||
-DCMAKE_CXX_COMPILER="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$CXX" \
|
||||
-DCMAKE_C_COMPILER="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$CC" \
|
||||
-DCMAKE_LINKER="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$LD" \
|
||||
-DCMAKE_AR="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$AR" \
|
||||
-DCMAKE_AS="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$AS" \
|
||||
-DCMAKE_CXX_COMPILER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$CXX" \
|
||||
-DCMAKE_C_COMPILER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$CC" \
|
||||
-DCMAKE_LINKER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$LD" \
|
||||
-DCMAKE_AR="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$AR" \
|
||||
-DCMAKE_AS="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$AS" \
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=1 \
|
||||
${ARCH_OPTIONS} \
|
||||
-DENABLE_TESTS=0 \
|
||||
|
||||
@@ -59,7 +59,7 @@ esac
|
||||
./configure \
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--with-pic \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--disable-libtool-lock \
|
||||
--enable-static \
|
||||
--disable-shared \
|
||||
|
||||
@@ -45,7 +45,7 @@ fi
|
||||
./configure \
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--with-pic \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--enable-static \
|
||||
--disable-shared \
|
||||
--disable-fast-install \
|
||||
|
||||
@@ -45,7 +45,7 @@ fi
|
||||
./configure \
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--with-pic \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--enable-static \
|
||||
--disable-shared \
|
||||
--disable-fast-install \
|
||||
|
||||
@@ -45,7 +45,7 @@ fi
|
||||
./configure \
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--with-pic \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--enable-static \
|
||||
--disable-shared \
|
||||
--disable-fast-install \
|
||||
|
||||
@@ -61,7 +61,7 @@ fi
|
||||
./configure \
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--with-pic \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--enable-static \
|
||||
--disable-shared \
|
||||
--disable-fast-install \
|
||||
|
||||
@@ -45,7 +45,7 @@ fi
|
||||
./configure \
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--with-pic \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--enable-static \
|
||||
--disable-shared \
|
||||
--disable-fast-install \
|
||||
|
||||
@@ -45,7 +45,7 @@ fi
|
||||
./configure \
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--with-pic \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--enable-static \
|
||||
--disable-shared \
|
||||
--disable-fast-install \
|
||||
|
||||
@@ -57,15 +57,15 @@ cmake -Wno-dev \
|
||||
-DCMAKE_C_FLAGS="${CFLAGS}" \
|
||||
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
|
||||
-DCMAKE_SYSROOT="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_FIND_ROOT_PATH="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_SYSROOT="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_FIND_ROOT_PATH="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX="${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME}" \
|
||||
-DCMAKE_SYSTEM_NAME=Generic \
|
||||
-DCMAKE_C_COMPILER="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$CC" \
|
||||
-DCMAKE_LINKER="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$LD" \
|
||||
-DCMAKE_AR="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$AR" \
|
||||
-DCMAKE_AS="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$AS" \
|
||||
-DCMAKE_C_COMPILER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$CC" \
|
||||
-DCMAKE_LINKER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$LD" \
|
||||
-DCMAKE_AR="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$AR" \
|
||||
-DCMAKE_AS="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$AS" \
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=1 \
|
||||
-DUSE_OMP=0 \
|
||||
${ASM_FLAGS} \
|
||||
|
||||
@@ -46,7 +46,7 @@ autoreconf_library ${LIB_NAME}
|
||||
./configure \
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--with-pic \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--with-ogg-includes=${BASEDIR}/prebuilt/android-$(get_target_build)/libogg/include \
|
||||
--with-ogg-libraries=${BASEDIR}/prebuilt/android-$(get_target_build)/libogg/lib \
|
||||
--enable-static \
|
||||
|
||||
@@ -80,6 +80,7 @@ make distclean 2>/dev/null 1>/dev/null
|
||||
--enable-spatial-resampling \
|
||||
--enable-small \
|
||||
--enable-static \
|
||||
--disable-realtime-only \
|
||||
--disable-shared \
|
||||
--disable-debug \
|
||||
--disable-gprof \
|
||||
|
||||
@@ -33,6 +33,16 @@ CFLAGS=$(get_cflags ${LIB_NAME})
|
||||
CXXFLAGS=$(get_cxxflags ${LIB_NAME})
|
||||
LDFLAGS=$(get_ldflags ${LIB_NAME})
|
||||
|
||||
SIMD_OPTIONS=""
|
||||
case ${ARCH} in
|
||||
arm-v7a)
|
||||
SIMD_OPTIONS="-DWEBP_ENABLE_SIMD=OFF"
|
||||
;;
|
||||
*)
|
||||
SIMD_OPTIONS="-DWEBP_ENABLE_SIMD=ON"
|
||||
;;
|
||||
esac
|
||||
|
||||
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
|
||||
|
||||
if [ -d "build" ]; then
|
||||
@@ -53,15 +63,15 @@ cmake -Wno-dev \
|
||||
-DCMAKE_C_FLAGS="${CFLAGS}" \
|
||||
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
|
||||
-DCMAKE_SYSROOT="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_FIND_ROOT_PATH="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_SYSROOT="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_FIND_ROOT_PATH="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX="${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME}" \
|
||||
-DCMAKE_SYSTEM_NAME=Generic \
|
||||
-DCMAKE_C_COMPILER="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$CC" \
|
||||
-DCMAKE_LINKER="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$LD" \
|
||||
-DCMAKE_AR="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$AR" \
|
||||
-DCMAKE_AS="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$AS" \
|
||||
-DCMAKE_C_COMPILER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$CC" \
|
||||
-DCMAKE_LINKER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$LD" \
|
||||
-DCMAKE_AR="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$AR" \
|
||||
-DCMAKE_AS="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$AS" \
|
||||
-DGIF_INCLUDE_DIR="${BASEDIR}/prebuilt/android-$(get_target_build)/giflib/include" \
|
||||
-DJPEG_INCLUDE_DIR="${BASEDIR}/prebuilt/android-$(get_target_build)/jpeg/include" \
|
||||
-DJPEG_LIBRARY="${BASEDIR}/prebuilt/android-$(get_target_build)/jpeg/lib" \
|
||||
@@ -69,7 +79,7 @@ cmake -Wno-dev \
|
||||
-DPNG_LIBRARY="${BASEDIR}/prebuilt/android-$(get_target_build)/libpng/lib" \
|
||||
-DTIFF_INCLUDE_DIR="${BASEDIR}/prebuilt/android-$(get_target_build)/tiff/include" \
|
||||
-DTIFF_LIBRARY="${BASEDIR}/prebuilt/android-$(get_target_build)/tiff/lib" \
|
||||
-DZLIB_INCLUDE_DIR="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot/usr/include" \
|
||||
-DZLIB_INCLUDE_DIR="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot/usr/include" \
|
||||
-DZLIB_LIBRARY="${ANDROID_NDK_ROOT}/platform/android-${API}/arch-$(get_target_build)/usr/lib" \
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=1 \
|
||||
-DGLUT_INCLUDE_DIR= \
|
||||
@@ -85,12 +95,13 @@ cmake -Wno-dev \
|
||||
-DWEBP_BUILD_IMG2WEBP=0 \
|
||||
-DWEBP_BUILD_WEBPMUX=0 \
|
||||
-DWEBP_BUILD_WEBPINFO=0 \
|
||||
${SIMD_OPTIONS} \
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$(get_cmake_target_processor) \
|
||||
-DBUILD_SHARED_LIBS=0 .. || exit 1
|
||||
|
||||
make -j$(get_cpu_count) || exit 1
|
||||
|
||||
# CREATE PACKAGE CONFIG MANUALLY
|
||||
create_libwebp_package_config "1.0.1"
|
||||
create_libwebp_package_config "1.0.2"
|
||||
|
||||
make install || exit 1
|
||||
|
||||
@@ -50,7 +50,7 @@ autoreconf_library ${LIB_NAME}
|
||||
./configure \
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--with-pic \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--with-zlib \
|
||||
--with-iconv=${BASEDIR}/prebuilt/android-$(get_target_build)/libiconv/lib \
|
||||
--with-sax1 \
|
||||
@@ -65,6 +65,6 @@ autoreconf_library ${LIB_NAME}
|
||||
make -j$(get_cpu_count) || exit 1
|
||||
|
||||
# CREATE PACKAGE CONFIG MANUALLY
|
||||
create_libxml2_package_config "2.9.8"
|
||||
create_libxml2_package_config "2.9.9"
|
||||
|
||||
make install || exit 1
|
||||
|
||||
@@ -45,7 +45,7 @@ fi
|
||||
./configure \
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--with-pic \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--enable-static \
|
||||
--disable-shared \
|
||||
--disable-fast-install \
|
||||
|
||||
@@ -45,7 +45,7 @@ fi
|
||||
./configure \
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--with-pic \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--enable-static \
|
||||
--enable-rtcd \
|
||||
--enable-asm \
|
||||
|
||||
@@ -47,7 +47,7 @@ fi
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--with-pic \
|
||||
--without-x \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--enable-static \
|
||||
--disable-shared \
|
||||
--disable-fast-install \
|
||||
|
||||
@@ -45,7 +45,7 @@ fi
|
||||
./configure \
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--with-pic \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--enable-static \
|
||||
--disable-shared \
|
||||
--disable-fast-install \
|
||||
|
||||
@@ -47,16 +47,16 @@ cmake -Wno-dev \
|
||||
-DCMAKE_C_FLAGS="${CFLAGS}" \
|
||||
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
|
||||
-DCMAKE_SYSROOT="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_FIND_ROOT_PATH="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_SYSROOT="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_FIND_ROOT_PATH="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX="${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME}" \
|
||||
-DCMAKE_SYSTEM_NAME=Generic \
|
||||
-DCMAKE_CXX_COMPILER="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$CXX" \
|
||||
-DCMAKE_C_COMPILER="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$CC" \
|
||||
-DCMAKE_LINKER="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$LD" \
|
||||
-DCMAKE_AR="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$AR" \
|
||||
-DCMAKE_AS="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$AS" \
|
||||
-DCMAKE_CXX_COMPILER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$CXX" \
|
||||
-DCMAKE_C_COMPILER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$CC" \
|
||||
-DCMAKE_LINKER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$LD" \
|
||||
-DCMAKE_AR="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$AR" \
|
||||
-DCMAKE_AS="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$AS" \
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=1 \
|
||||
-DSNAPPY_BUILD_TESTS=0 \
|
||||
-DHAVE_LIBLZO2=0 \
|
||||
|
||||
@@ -47,16 +47,16 @@ cmake -Wno-dev \
|
||||
-DCMAKE_C_FLAGS="${CFLAGS}" \
|
||||
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
|
||||
-DCMAKE_SYSROOT="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_FIND_ROOT_PATH="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_SYSROOT="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_FIND_ROOT_PATH="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX="${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME}" \
|
||||
-DCMAKE_SYSTEM_NAME=Generic \
|
||||
-DCMAKE_CXX_COMPILER="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$CXX" \
|
||||
-DCMAKE_C_COMPILER="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$CC" \
|
||||
-DCMAKE_LINKER="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$LD" \
|
||||
-DCMAKE_AR="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$AR" \
|
||||
-DCMAKE_AS="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$AS" \
|
||||
-DCMAKE_CXX_COMPILER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$CXX" \
|
||||
-DCMAKE_C_COMPILER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$CC" \
|
||||
-DCMAKE_LINKER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$LD" \
|
||||
-DCMAKE_AR="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$AR" \
|
||||
-DCMAKE_AS="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$AS" \
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=1 \
|
||||
-DBUILD_TESTS=0 \
|
||||
-DWITH_DEV_TRACE=0 \
|
||||
|
||||
@@ -51,7 +51,7 @@ fi
|
||||
./configure \
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--with-pic \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--enable-static ${OPTIONAL_CPU_SUPPORT} \
|
||||
--disable-shared \
|
||||
--disable-binaries \
|
||||
|
||||
@@ -51,7 +51,7 @@ export ac_cv_c_bigendian=no
|
||||
./configure \
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--with-pic \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--enable-static \
|
||||
--disable-shared \
|
||||
--disable-fast-install \
|
||||
|
||||
@@ -45,7 +45,7 @@ fi
|
||||
./configure \
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--with-pic \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--with-jpeg-include-dir=${BASEDIR}/prebuilt/android-$(get_target_build)/jpeg/include \
|
||||
--with-jpeg-lib-dir=${BASEDIR}/prebuilt/android-$(get_target_build)/jpeg/lib \
|
||||
--enable-static \
|
||||
|
||||
@@ -49,7 +49,7 @@ export SNDFILE_LIBS="$(pkg-config --libs --static sndfile)"
|
||||
./configure \
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--with-pic \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--enable-static \
|
||||
--disable-shared \
|
||||
--disable-fast-install \
|
||||
|
||||
@@ -45,7 +45,7 @@ fi
|
||||
./configure \
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--with-pic \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--without-iconv \
|
||||
--enable-static \
|
||||
--disable-shared \
|
||||
|
||||
@@ -67,7 +67,7 @@ esac
|
||||
./configure \
|
||||
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
|
||||
--enable-pic \
|
||||
--sysroot=${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot \
|
||||
--sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
|
||||
--enable-static \
|
||||
--disable-cli \
|
||||
${ASM_FLAGS} \
|
||||
|
||||
@@ -65,27 +65,21 @@ fi
|
||||
mkdir cmake-build || exit 1
|
||||
cd cmake-build || exit 1
|
||||
|
||||
# apply detect512 patch
|
||||
rc=$(download "https://bitbucket.org/multicoreware/x265/issues/attachments/442/multicoreware/x265/1539002893.24/442/enable512.diff" "enable512.diff")
|
||||
cd ${BASEDIR}/src/${LIB_NAME}/source/common
|
||||
patch -p3 < ${MOBILE_FFMPEG_TMPDIR}/enable512.diff
|
||||
cd ${BASEDIR}/src/${LIB_NAME}/cmake-build
|
||||
|
||||
cmake -Wno-dev \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=0 \
|
||||
-DCMAKE_C_FLAGS="${CFLAGS}" \
|
||||
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
|
||||
-DCMAKE_SYSROOT="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_FIND_ROOT_PATH="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_SYSROOT="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_FIND_ROOT_PATH="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX="${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME}" \
|
||||
-DCMAKE_SYSTEM_NAME=Generic \
|
||||
-DCMAKE_C_COMPILER="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$CC" \
|
||||
-DCMAKE_CXX_COMPILER="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$CXX" \
|
||||
-DCMAKE_LINKER="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$LD" \
|
||||
-DCMAKE_AR="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$AR" \
|
||||
-DCMAKE_AS="${ANDROID_NDK_ROOT}/toolchains/mobile-ffmpeg-api-${API}-${TOOLCHAIN}/bin/$AS" \
|
||||
-DCMAKE_C_COMPILER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$CC" \
|
||||
-DCMAKE_CXX_COMPILER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$CXX" \
|
||||
-DCMAKE_LINKER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$LD" \
|
||||
-DCMAKE_AR="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$AR" \
|
||||
-DCMAKE_AS="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$AS" \
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=1 \
|
||||
-DSTATIC_LINK_CRT=1 \
|
||||
-DENABLE_PIC=1 \
|
||||
@@ -97,6 +91,6 @@ cmake -Wno-dev \
|
||||
make -j$(get_cpu_count) || exit 1
|
||||
|
||||
# CREATE PACKAGE CONFIG MANUALLY
|
||||
create_x265_package_config "2.9"
|
||||
create_x265_package_config "3.0"
|
||||
|
||||
make install || exit 1
|
||||
|
||||
@@ -57,9 +57,10 @@ cmake -Wno-dev \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX="${BASEDIR}/prebuilt/ios-$(get_target_build_directory)/${LIB_NAME}" \
|
||||
-DCMAKE_SYSTEM_NAME=Darwin \
|
||||
-DCMAKE_OSX_SYSROOT="" \
|
||||
-DCMAKE_C_COMPILER="$CC" \
|
||||
-DCMAKE_LINKER="$LD" \
|
||||
-DCMAKE_AR="$AR" \
|
||||
-DCMAKE_AR="$(xcrun --sdk $(get_sdk_name) -f ar)" \
|
||||
-DCMAKE_AS="$AS" \
|
||||
-DFFT_LIB=kissfft \
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$(get_target_arch) \
|
||||
|
||||
@@ -193,15 +193,17 @@ get_common_includes() {
|
||||
|
||||
get_common_cflags() {
|
||||
if [[ ! -z ${MOBILE_FFMPEG_LTS_BUILD} ]]; then
|
||||
local LTS_BUILD__FLAG="-DMOBILE_FFMPEG_LTS "
|
||||
local LTS_BUILD_FLAG="-DMOBILE_FFMPEG_LTS "
|
||||
fi
|
||||
|
||||
local BUILD_DATE="-DMOBILE_FFMPEG_BUILD_DATE=$(date +%Y%m%d 2>>${BASEDIR}/build.log)"
|
||||
|
||||
case ${ARCH} in
|
||||
i386 | x86-64)
|
||||
echo "-fstrict-aliasing -DIOS ${LTS_BUILD__FLAG}-isysroot ${SDK_PATH}"
|
||||
echo "-fstrict-aliasing -DIOS ${LTS_BUILD_FLAG}${BUILD_DATE} -isysroot ${SDK_PATH}"
|
||||
;;
|
||||
*)
|
||||
echo "-fstrict-aliasing -fembed-bitcode -DIOS ${LTS_BUILD__FLAG}-isysroot ${SDK_PATH}"
|
||||
echo "-fstrict-aliasing -fembed-bitcode -DIOS ${LTS_BUILD_FLAG}${BUILD_DATE} -isysroot ${SDK_PATH}"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
@@ -303,6 +305,9 @@ get_app_specific_cflags() {
|
||||
ffmpeg)
|
||||
APP_FLAGS="-Wno-unused-function -Wno-deprecated-declarations"
|
||||
;;
|
||||
jpeg)
|
||||
APP_FLAGS="-Wno-nullability-completeness"
|
||||
;;
|
||||
kvazaar)
|
||||
APP_FLAGS="-std=gnu99 -Wno-unused-function"
|
||||
;;
|
||||
@@ -917,15 +922,15 @@ download_gpl_library_source() {
|
||||
GPL_LIB_DEST_DIR="libvidstab"
|
||||
;;
|
||||
x264)
|
||||
GPL_LIB_URL="ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20181224-2245-stable.tar.bz2"
|
||||
GPL_LIB_FILE="x264-snapshot-20181224-2245-stable.tar.bz2"
|
||||
GPL_LIB_ORIG_DIR="x264-snapshot-20181224-2245-stable"
|
||||
GPL_LIB_URL="ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20190328-2245-stable.tar.bz2"
|
||||
GPL_LIB_FILE="x264-snapshot-20190328-2245-stable.tar.bz2"
|
||||
GPL_LIB_ORIG_DIR="x264-snapshot-20190328-2245-stable"
|
||||
GPL_LIB_DEST_DIR="x264"
|
||||
;;
|
||||
x265)
|
||||
GPL_LIB_URL="https://download.videolan.org/pub/videolan/x265/x265_2.9.tar.gz"
|
||||
GPL_LIB_FILE="x265-2.9.tar.gz"
|
||||
GPL_LIB_ORIG_DIR="x265_2.9"
|
||||
GPL_LIB_URL="https://download.videolan.org/pub/videolan/x265/x265_3.0.tar.gz"
|
||||
GPL_LIB_FILE="x265-3.0.tar.gz"
|
||||
GPL_LIB_ORIG_DIR="x265_3.0"
|
||||
GPL_LIB_DEST_DIR="x265"
|
||||
;;
|
||||
xvidcore)
|
||||
@@ -1024,10 +1029,10 @@ set_toolchain_clang_paths() {
|
||||
|
||||
TARGET_HOST=$(get_target_host)
|
||||
|
||||
export AR="$(xcrun --sdk $(get_sdk_name) -f ar)"
|
||||
export CC="$(xcrun --sdk $(get_sdk_name) -f clang)"
|
||||
export OBJC="$(xcrun --sdk $(get_sdk_name) -f clang)"
|
||||
export CXX="$(xcrun --sdk $(get_sdk_name) -f clang++)"
|
||||
export AR="ar"
|
||||
export CC="clang"
|
||||
export OBJC="clang"
|
||||
export CXX="clang++"
|
||||
|
||||
LOCAL_ASMFLAGS="$(get_asmflags $1)"
|
||||
case ${ARCH} in
|
||||
@@ -1054,9 +1059,9 @@ set_toolchain_clang_paths() {
|
||||
;;
|
||||
esac
|
||||
|
||||
export LD="$(xcrun --sdk $(get_sdk_name) -f ld)"
|
||||
export RANLIB="$(xcrun --sdk $(get_sdk_name) -f ranlib)"
|
||||
export STRIP="$(xcrun --sdk $(get_sdk_name) -f strip)"
|
||||
export LD="ld"
|
||||
export RANLIB="ranlib"
|
||||
export STRIP="strip"
|
||||
|
||||
export INSTALL_PKG_CONFIG_DIR="${BASEDIR}/prebuilt/ios-$(get_target_build_directory)/pkgconfig"
|
||||
export ZLIB_PACKAGE_CONFIG_PATH="${INSTALL_PKG_CONFIG_DIR}/zlib.pc"
|
||||
|
||||
@@ -68,6 +68,6 @@ export LIBPNG_LIBS="-L${BASEDIR}/prebuilt/ios-$(get_target_build_directory)/libp
|
||||
make -j$(get_cpu_count) || exit 1
|
||||
|
||||
# CREATE PACKAGE CONFIG MANUALLY
|
||||
create_freetype_package_config "22.0.16"
|
||||
create_freetype_package_config "23.0.17"
|
||||
|
||||
make install || exit 1
|
||||
|
||||
@@ -40,6 +40,16 @@ export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
|
||||
export LDFLAGS=$(get_ldflags ${LIB_NAME})
|
||||
export ASM_FLAGS=$(get_asmflags ${LIB_NAME})
|
||||
|
||||
SIMD_OPTIONS=""
|
||||
case ${ARCH} in
|
||||
armv7 | armv7s | arm64 | arm64e)
|
||||
SIMD_OPTIONS="-DWITH_SIMD=1"
|
||||
;;
|
||||
*)
|
||||
SIMD_OPTIONS="-DWITH_SIMD=0"
|
||||
;;
|
||||
esac
|
||||
|
||||
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
|
||||
|
||||
if [ -d "build" ]; then
|
||||
@@ -62,15 +72,16 @@ cmake -Wno-dev \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX="${BASEDIR}/prebuilt/ios-$(get_target_build_directory)/${LIB_NAME}" \
|
||||
-DCMAKE_SYSTEM_NAME=Darwin \
|
||||
-DCMAKE_OSX_SYSROOT="" \
|
||||
-DCMAKE_C_COMPILER="$CC" \
|
||||
-DCMAKE_LINKER="$LD" \
|
||||
-DCMAKE_AR="$AR" \
|
||||
-DCMAKE_AR="$(xcrun --sdk $(get_sdk_name) -f ar)" \
|
||||
-DCMAKE_ASM_FLAGS="$ASM_FLAGS" \
|
||||
-DENABLE_PIC=1 \
|
||||
-DENABLE_STATIC=1 \
|
||||
-DENABLE_SHARED=0 \
|
||||
-DWITH_JPEG8=1 \
|
||||
-DWITH_SIMD=1 \
|
||||
${SIMD_OPTIONS} \
|
||||
-DWITH_TURBOJPEG=0 \
|
||||
-DWITH_JAVA=0 \
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$(get_target_arch) \
|
||||
|
||||
@@ -89,7 +89,7 @@ cmake -Wno-dev \
|
||||
-DCMAKE_CXX_COMPILER="$CXX" \
|
||||
-DCMAKE_C_COMPILER="$CC" \
|
||||
-DCMAKE_LINKER="$LD" \
|
||||
-DCMAKE_AR="$AR" \
|
||||
-DCMAKE_AR="$(xcrun --sdk $(get_sdk_name) -f ar)" \
|
||||
-DCMAKE_AS="$AS" \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} \
|
||||
${ARCH_OPTIONS} \
|
||||
|
||||
@@ -69,7 +69,7 @@ cmake -Wno-dev \
|
||||
-DCMAKE_SYSTEM_NAME=Darwin \
|
||||
-DCMAKE_C_COMPILER="$CC" \
|
||||
-DCMAKE_LINKER="$LD" \
|
||||
-DCMAKE_AR="$AR" \
|
||||
-DCMAKE_AR="$(xcrun --sdk $(get_sdk_name) -f ar)" \
|
||||
-DCMAKE_AS="$AS" \
|
||||
-DUSE_OMP=0 \
|
||||
${ASM_FLAGS} \
|
||||
|
||||
@@ -107,6 +107,7 @@ make distclean 2>/dev/null 1>/dev/null
|
||||
--enable-spatial-resampling \
|
||||
--enable-small \
|
||||
--enable-static \
|
||||
--disable-realtime-only \
|
||||
--disable-shared \
|
||||
--disable-debug \
|
||||
--disable-gprof \
|
||||
|
||||
@@ -63,9 +63,10 @@ cmake -Wno-dev \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX="${BASEDIR}/prebuilt/ios-$(get_target_build_directory)/${LIB_NAME}" \
|
||||
-DCMAKE_SYSTEM_NAME=Darwin \
|
||||
-DCMAKE_OSX_SYSROOT="" \
|
||||
-DCMAKE_C_COMPILER="$CC" \
|
||||
-DCMAKE_LINKER="$LD" \
|
||||
-DCMAKE_AR="$AR" \
|
||||
-DCMAKE_AR="$(xcrun --sdk $(get_sdk_name) -f ar)" \
|
||||
-DCMAKE_AS="$AS" \
|
||||
-DGIF_INCLUDE_DIR=${BASEDIR}/prebuilt/ios-$(get_target_build_directory)/giflib/include \
|
||||
-DJPEG_INCLUDE_DIR=${BASEDIR}/prebuilt/ios-$(get_target_build_directory)/jpeg/include \
|
||||
@@ -95,6 +96,6 @@ cmake -Wno-dev \
|
||||
make -j$(get_cpu_count) || exit 1
|
||||
|
||||
# CREATE PACKAGE CONFIG MANUALLY
|
||||
create_libwebp_package_config "1.0.1"
|
||||
create_libwebp_package_config "1.0.2"
|
||||
|
||||
make install || exit 1
|
||||
|
||||
@@ -64,6 +64,6 @@ autoreconf_library ${LIB_NAME}
|
||||
make -j$(get_cpu_count) || exit 1
|
||||
|
||||
# CREATE PACKAGE CONFIG MANUALLY
|
||||
create_libxml2_package_config "2.9.8"
|
||||
create_libxml2_package_config "2.9.9"
|
||||
|
||||
make install || exit 1
|
||||
|
||||
@@ -57,10 +57,11 @@ cmake -Wno-dev \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX="${BASEDIR}/prebuilt/ios-$(get_target_build_directory)/${LIB_NAME}" \
|
||||
-DCMAKE_SYSTEM_NAME=Darwin \
|
||||
-DCMAKE_OSX_SYSROOT="" \
|
||||
-DCMAKE_CXX_COMPILER="$CXX" \
|
||||
-DCMAKE_C_COMPILER="$CC" \
|
||||
-DCMAKE_LINKER="$LD" \
|
||||
-DCMAKE_AR="$AR" \
|
||||
-DCMAKE_AR="$(xcrun --sdk $(get_sdk_name) -f ar)" \
|
||||
-DCMAKE_AS="$AS" \
|
||||
-DSNAPPY_BUILD_TESTS=0 \
|
||||
-DHAVE_LIBLZO2=0 \
|
||||
|
||||
@@ -59,7 +59,7 @@ cmake -Wno-dev \
|
||||
-DCMAKE_SYSTEM_NAME=Generic \
|
||||
-DCMAKE_C_COMPILER="$CC" \
|
||||
-DCMAKE_LINKER="$LD" \
|
||||
-DCMAKE_AR="$AR" \
|
||||
-DCMAKE_AR="$(xcrun --sdk $(get_sdk_name) -f ar)" \
|
||||
-DCMAKE_AS="$AS" \
|
||||
-DBUILD_TESTS=0 \
|
||||
-DWITH_DEV_TRACE=0 \
|
||||
|
||||