Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 1 addition & 11 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 15 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,10 @@

## Description ##

x264 jni for android
x264 encoder to being using through jni in Android.

## Using ##

* Make sure you have the jcenter repository included in the `build.gradle` file in the root of your project:

```
repositories {
jcenter()
}
```

* Include the following in your module's `build.gradle` file:

```
compile 'com.github.bakaoh:x264-android:X.X.X'
```

for the version X.X.X, see the project on [Bintray](https://bintray.com/bakaoh/maven/x264-android).

* Create `X264Encoder` and `X264Params`

```
Expand Down Expand Up @@ -59,26 +43,32 @@ if (encodedFrame.err == 0) {

## Build instructions ##

* Set the following environment variable:
* Download the [Android NDK][]:

[Android NDK]: https://developer.android.com/tools/sdk/ndk/index.html

* Set the following environment variables:
```
X264_ANDROID_ROOT="<path to x264android checkout>"
ANDROID_NDK_ROOT="<path to Android NDK>"
ANDROID_NDK_PLATFORM="<platform to build to>"
ANDROID_NDK_HOST="<your-build-host>"
```

* Download the [Android NDK][] and set its location in an environment variable:

[Android NDK]: https://developer.android.com/tools/sdk/ndk/index.html

** Example:
```
NDK_PATH="<path to Android NDK>"
ANDROID_NDK_ROOT=/home/forlayo/android-ndk-r21e
ANDROID_NDK_PLATFORM=android-21
ANDROID_NDK_HOST=linux-x86_64
```

* Fetch and build libx264.

```
cd "${X264_ANDROID_ROOT}/x264/src/main/cpp" && \
cd "<repository checkout dir>/x264-android/src/main/cpp" && \
git clone http://git.videolan.org/git/x264.git libx264 && \
git checkout ae03d92b52bb7581df2e75d571989cb1ecd19cbd && \
./build_x264.sh
```
You can use other commit of libx264, but its tested on provided one; which is the most actual at the momment of writting this.

* Open project in Android Studio to build the JNI native libraries.
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.android.tools.build:gradle:4.2.1'
}
}

allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}

Expand Down
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Mon Dec 28 10:00:20 PST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
59 changes: 0 additions & 59 deletions x264-android/bintrayv1.gradle

This file was deleted.

38 changes: 5 additions & 33 deletions x264-android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,32 +1,7 @@
apply plugin: 'com.android.library'

ext {
bintrayRepo = 'maven'
bintrayName = 'x264-android'

publishedGroupId = 'com.github.bakaoh'
libraryName = 'X264Android'
artifact = 'x264-android'

libraryDescription = 'Simple x264 encoder jni for android'

siteUrl = 'https://github.com/bakaoh/X264Android'
gitUrl = 'https://github.com/bakaoh/X264Android.git'

libraryVersion = '1.0.0'

developerId = 'bakaoh'
developerName = 'Tata Tata'
developerEmail = 'tatattai@gmail.com'

licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
}

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 30

defaultConfig {
minSdkVersion 15
Expand All @@ -40,7 +15,7 @@ android {
}
}
ndk {
abiFilters 'x86', 'armeabi-v7a', 'arm64-v8a'
abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
}
}
buildTypes {
Expand All @@ -49,7 +24,7 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
externalNativeBuild {
ndkBuild {
arguments "LOCAL_LDFLAGS:=-Wl,-s"
arguments "LOCAL_LDFLAGS:=-Wl,-s "
}
}
}
Expand All @@ -62,8 +37,5 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}

apply from: 'installv1.gradle'
apply from: 'bintrayv1.gradle'
implementation fileTree(dir: 'libs', include: ['*.jar'])
}
42 changes: 0 additions & 42 deletions x264-android/installv1.gradle

This file was deleted.

6 changes: 3 additions & 3 deletions x264-android/src/main/cpp/Application.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
APP_STL := gnustl_static
APP_ABI := x86 armeabi-v7a arm64-v8a
APP_PLATFORM := android-9
APP_STL := c++_shared
APP_ABI := x86 x86_64 armeabi-v7a arm64-v8a
APP_PLATFORM := android-21
APP_OPTIM := release
Loading