Skip to content

Commit

Permalink
add "flavor" that includes ExoPlayer decoder extensions w/ ABI splits
Browse files Browse the repository at this point in the history
  • Loading branch information
warren-bank committed Oct 4, 2021
1 parent a5d4eb0 commit 7b6a4aa
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 3 deletions.
24 changes: 24 additions & 0 deletions android-studio-project/ExoPlayer-AirPlay-Receiver/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ android {
archivesBaseName += "-$versionName"
}

flavorDimensions "decoderExtensions"

productFlavors {
noDecoderExtensions {
dimension "decoderExtensions"
buildConfigField "boolean", "USE_DECODER_EXTENSIONS", "false"
}
withDecoderExtensions {
dimension "decoderExtensions"
buildConfigField "boolean", "USE_DECODER_EXTENSIONS", "true"
}
}

buildTypes {
release {
shrinkResources true
Expand All @@ -36,6 +49,15 @@ android {
}
}

splits {
abi {
enable gradle.startParameter.taskNames.any { it.toLowerCase().contains("withdecoderextensions") }
reset()
include "arm64-v8a", "armeabi-v7a", "x86", "x86_64"
universalApk false
}
}

lintOptions {
disable 'MissingTranslation'
abortOnError true
Expand Down Expand Up @@ -63,6 +85,8 @@ dependencies {
implementation 'com.googlecode.plist:dd-plist:' + project.ext.libVersionDdPlist // ( 74 KB) https://mvnrepository.com/artifact/com.googlecode.plist/dd-plist
implementation 'org.apache.httpcomponents:httpcore:' + project.ext.libVersionHttpCore // (320 KB) https://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore
implementation 'org.jmdns:jmdns:' + project.ext.libVersionJmDNS // (209 KB) https://mvnrepository.com/artifact/org.jmdns/jmdns

withDecoderExtensionsImplementation fileTree(dir: "libs/decoder_extensions", include: ["extension-*.aar"])
}

apply plugin: 'com.google.android.gms.strict-version-matcher-plugin'
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#### origin for pre-built native extension binaries:

* [Just Player](https://github.com/moneytoo/Player/tree/v0.45/app/libs)
- release: 0.45 (using ExoPlayer 2.14.2)
- extensions:
* [_av1_](https://github.com/moneytoo/Player/raw/v0.45/app/libs/extension-av1-release.aar)
* [_ffmpeg_](https://github.com/moneytoo/Player/raw/v0.45/app/libs/extension-ffmpeg-release.aar)
- ABIs:
* armeabi-v7a
* arm64-v8a
* x86
* x86_64

#### _ffmpeg_ build options

```
ENABLED_DECODERS=(vorbis opus flac alac pcm_mulaw pcm_alaw mp3 amrnb amrwb aac ac3 eac3 dca mlp truehd)
```
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.github.warren_bank.exoplayer_airplay_receiver.exoplayer2.customizations;

import com.github.warren_bank.exoplayer_airplay_receiver.BuildConfig;

import android.content.Context;
import android.os.Looper;
import com.google.android.exoplayer2.DefaultRenderersFactory;
Expand All @@ -11,7 +13,12 @@ public class MyRenderersFactory extends DefaultRenderersFactory implements TextS
private MyTextRenderer textRenderer;

public MyRenderersFactory(Context context) {
super(context);
super(
context,
/* int extensionRendererMode = */ BuildConfig.USE_DECODER_EXTENSIONS
? DefaultRenderersFactory.EXTENSION_RENDERER_MODE_ON
: DefaultRenderersFactory.EXTENSION_RENDERER_MODE_OFF
);
textRenderer = null;
}

Expand Down
4 changes: 2 additions & 2 deletions android-studio-project/constants.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project.ext {
releaseVersionCode = Integer.parseInt("002002716", 10) //Integer.MAX_VALUE == 2147483647
releaseVersion = '002.00.27-16API'
releaseVersionCode = Integer.parseInt("002002816", 10) //Integer.MAX_VALUE == 2147483647
releaseVersion = '002.00.28-16API'
javaVersion = JavaVersion.VERSION_1_8
minSdkVersion = 16
targetSdkVersion = 29
Expand Down

0 comments on commit 7b6a4aa

Please sign in to comment.