Skip to content

Commit

Permalink
Fixed an issue with Android 11 where images were not rendering
Browse files Browse the repository at this point in the history
Using version 2.11.8 of exoplayer
Updatd change log
  • Loading branch information
jvl711 committed Sep 10, 2020
1 parent 35959f0 commit 5b562a0
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 11 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
**1.6.2 (2020-09-10) **
- jvl711: Fixed an issue with Android 11 where images were not rendering
- jvl711: Upgraded ExoPlayer to 2.11.8
- jvl711: Fixed the volume up/down keys. You need to map them to NONE for them to work properly
- jvl711: Volume up/down mapped to NONE by default

**1.6.1 (2020-8-31)**
- jvl711: Missed a default value on one of the properties which caused a null pointer exception on launch of connection

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.graphics.BitmapFactory;
import android.graphics.Point;
import android.os.Build;
import android.util.Log;
import android.view.Display;
import android.view.WindowManager;

Expand Down Expand Up @@ -621,14 +622,23 @@ public void run() {

@Override
public ImageHolder<GdxTexture> readImage(File file) throws Exception {
try {
try
{
FileInputStream fis = new FileInputStream(file);
try {

try
{
return readImage(fis);
} finally {
}
finally
{
fis.close();
}
} catch (IOException e) {
}
catch (IOException e)
{
log.error("ERRROR READING IMAGE");

e.printStackTrace();
}

Expand All @@ -640,13 +650,26 @@ public ImageHolder<GdxTexture> readImage(InputStream fis) throws Exception {
long st = System.currentTimeMillis();

BitmapFactory.Options options = new BitmapFactory.Options();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
/*
JVL 09/10/2020 - Bitmap.Config.HARDWARE seemed to break rendering on Andriod 11
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
{
// this appears to work better since Android O (documentation says it's prefferred
// for bitmaps that are only used to render to the screen (immutable)
//options.inMutable = false;
options.inPreferredConfig = Bitmap.Config.HARDWARE;
} else {
}
else
{
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
}
*/

options.inPreferredConfig = Bitmap.Config.ARGB_8888;




final Bitmap bitmap = BitmapFactory.decodeStream(fis, null, options);

long time = System.currentTimeMillis() - st;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,13 +540,17 @@ public ImageHolder<OpenGLTexture> readImage(InputStream fis) throws Exception {
long st = System.currentTimeMillis();

BitmapFactory.Options options = new BitmapFactory.Options();
/*
JVL 09/10/2020 - Bitmap.Config.HARDWARE seemed to break rendering on Andriod 11
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// this appears to work better since Android O (documentation says it's prefferred
// for bitmaps that are only used to render to the screen (immutable)
options.inPreferredConfig = Bitmap.Config.HARDWARE;
} else {
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
}
*/

options.inDither = true;
options.inDensity = 32;
options.inTargetDensity = 32;
Expand Down
30 changes: 27 additions & 3 deletions android-tv/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,26 @@ android {
{
release
{

keyAlias = "client"

if (signingProps!=null && signingProps.containsKey("keyAlias") && signingProps.containsKey("storeFile")
&& signingProps.containsKey("storePassword") && signingProps.containsKey("keyPassword"))
{
keyAlias = signingProps.getProperty("keyAlias")
storeFile = new File(signingProps.getProperty("storeFile"));
storePassword = signingProps.getProperty("storePassword")
keyPassword = signingProps.getProperty("keyPassword")

System.out.println("signing config setup from properties file")
}
else
{
System.out.println("signing config missing or incorrectly configured")
}
}
debug
{
keyAlias = "client"

if (signingProps!=null && signingProps.containsKey("keyAlias") && signingProps.containsKey("storeFile")
&& signingProps.containsKey("storePassword") && signingProps.containsKey("keyPassword"))
Expand All @@ -66,8 +82,16 @@ android {
}
}

buildTypes {
release {
buildTypes
{
release
{
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
debug
{
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ allprojects {
// NOTE: using exoplayer from mavenlocal (prebuilt) for ffmpeg
exoVersionCustomExt = '2.11.5'
// NOTE: using regular exoplayer for core stuff
exoVersion = '2.11.5'
exoVersion = '2.11.8'

androidExtrasVer = "28.0.0"
androidBuildToolsVersion = "28.0.3"
Expand All @@ -54,7 +54,7 @@ allprojects {
androidCompileSdkVersion = 28
androidTargetSdkVersion = 28

appVersionCode = 2101061
appVersionCode = 2101062
appVersionName = "${baseVersion}"

// tell every project where to find the local project maven files
Expand Down

0 comments on commit 5b562a0

Please sign in to comment.