Skip to content

Commit

Permalink
Merge pull request #22 from Parseus/dev
Browse files Browse the repository at this point in the history
Dev -> master: version 2.3.0
  • Loading branch information
Parseus committed Sep 15, 2021
2 parents b4d6cfd + be68010 commit 7f2d0f6
Show file tree
Hide file tree
Showing 71 changed files with 1,145 additions and 439 deletions.
61 changes: 51 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,61 @@
# Built application files
*.apk
*.aar
*.ap_
*.aab

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# IntelliJ
*.iml
.gradle
/local.properties
/.idea/caches/build_file_checksums.ser
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
.idea/kotlinc.xml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml

# Version control
vcs.xml

.DS_Store
/build
/captures
.externalNativeBuild
.idea/assetWizardSettings.xml
.cxx

app/build
app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/androidx/asynclayoutinflater/R.java
app/nonFree
app/nonFreeMobile
app/standardMobile
app/standardTv
app/standard
.idea/kotlinc.xml
.idea/deploymentTargetDropDown.xml
21 changes: 5 additions & 16 deletions .idea/codeStyles/Project.xml

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

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

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

3 changes: 1 addition & 2 deletions .idea/gradle.xml

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

6 changes: 0 additions & 6 deletions .idea/inspectionProfiles/Project_Default.xml

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

15 changes: 14 additions & 1 deletion .idea/misc.xml

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

13 changes: 0 additions & 13 deletions .idea/runConfigurations.xml

This file was deleted.

32 changes: 17 additions & 15 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 30
compileSdkVersion 31
defaultConfig {
applicationId "com.parseus.codecinfo"
minSdkVersion 16
targetSdkVersion 30
versionCode 20
versionName "2.2.2"
targetSdkVersion 31
versionCode 21
versionName "2.3.0"
resConfigs "en"

vectorDrawables.useSupportLibrary = true
Expand Down Expand Up @@ -64,12 +64,12 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "11"
}

packagingOptions {
Expand All @@ -95,9 +95,9 @@ configurations {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2'

implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation "androidx.core:core-ktx:1.6.0"
implementation 'androidx.preference:preference-ktx:1.1.1'

Expand All @@ -110,15 +110,17 @@ dependencies {
standardMobileDebugImplementation 'androidx.multidex:multidex:2.0.1'
nonFreeMobileDebugImplementation 'androidx.multidex:multidex:2.0.1'

tvImplementation 'androidx.leanback:leanback:1.1.0-rc01'
tvImplementation 'androidx.leanback:leanback-preference:1.1.0-rc01'
tvImplementation 'androidx.leanback:leanback:1.2.0-alpha01'
tvImplementation 'androidx.leanback:leanback-preference:1.2.0-alpha01'

mobileImplementation 'androidx.constraintlayout:constraintlayout:2.0.4'
mobileImplementation 'com.github.ditacristianionut:AppInfoBadge:1.3'
mobileImplementation 'com.google.android.material:material:1.4.0'
mobileImplementation 'androidx.constraintlayout:constraintlayout:2.1.0'
mobileImplementation 'androidx.core:core-splashscreen:1.0.0-alpha01'
mobileImplementation 'androidx.webkit:webkit:1.4.0'
mobileImplementation 'com.github.marcoscgdev:Licenser:2.0.0'
mobileImplementation 'com.google.android.material:material:1.5.0-alpha03'

nonFreeMobileImplementation fileTree(include: ['*.jar'], dir: 'libs')
nonFreeMobileImplementation 'com.google.android.play:core:1.10.0'
nonFreeMobileImplementation 'com.google.android.play:core:1.10.1'
nonFreeMobileImplementation ('com.google.android.play:core-ktx:1.8.1') {
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk7'
}
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
android:installLocation="preferExternal"
package="com.parseus.codecinfo">

<uses-sdk tools:overrideLibrary="com.dci.dev.appinfobadge, com.afollestad.recyclical" />

<uses-feature android:name="android.hardware.touchscreen" android:required="false" />

<queries>
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/assets/changelog.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<html>
<body>

<h2>Version 2.3.0</h2>
<p>Added detecting features introduced in Android 12.</p>
<p>Added optional dynamic theming on Android 12 and newer.</p>
<p>Input channel count now shows both minimal and maximal values.</p>
<p>Bugfixes and general improvements.</p>

<h2>Version 2.2.2</h2>
<p>Bugfixes and general improvements.</p>

Expand Down
25 changes: 0 additions & 25 deletions app/src/main/assets/license.html

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ fun getDetailedCodecInfo(context: Context, codecId: String, codecName: String):
if (SDK_INT >= 24) {
propertyList.addFeature(context, capabilities, FEATURE_IntraRefresh, R.string.intra_refresh)
}
if (SDK_INT >= 31) {
propertyList.addFeature(context, capabilities, FEATURE_QpBounds, R.string.qp_bounds)
}
}
}

Expand All @@ -281,13 +284,17 @@ fun getDetailedCodecInfo(context: Context, codecId: String, codecName: String):

if (isEncoder && SDK_INT >= 21) {
val encoderCapabilities = capabilities.encoderCapabilities
val bitrateModesString =
var bitrateModesString =
"${context.getString(R.string.cbr)}: " +
"${encoderCapabilities.isBitrateModeSupported(MediaCodecInfo.EncoderCapabilities.BITRATE_MODE_CBR)}" +
"\n${context.getString(R.string.cq)}: " +
"${encoderCapabilities.isBitrateModeSupported(MediaCodecInfo.EncoderCapabilities.BITRATE_MODE_CQ)}" +
"\n${context.getString(R.string.vbr)}: " +
"${encoderCapabilities.isBitrateModeSupported(MediaCodecInfo.EncoderCapabilities.BITRATE_MODE_VBR)}"
if (SDK_INT >= 31) {
bitrateModesString += "\n${context.getString(R.string.cbr_fd)}: " +
"${encoderCapabilities.isBitrateModeSupported(MediaCodecInfo.EncoderCapabilities.BITRATE_MODE_CBR_FD)}"
}
propertyList.add(DetailsProperty(propertyList.size.toLong(),
context.getString(R.string.bitrate_modes), bitrateModesString))

Expand Down Expand Up @@ -375,9 +382,21 @@ private fun getAudioCapabilities(context: Context, codecId: String, codecName: S
propertyList: MutableList<DetailsProperty>) {
val audioCapabilities = capabilities.audioCapabilities

var minChannelCount = 1
val maxChannelCount = adjustMaxInputChannelCount(codecId, codecName,
audioCapabilities.maxInputChannelCount, capabilities)

if (SDK_INT >= 31) {
minChannelCount = audioCapabilities.minInputChannelCount
}

propertyList.add(DetailsProperty(propertyList.size.toLong(), context.getString(R.string.input_channels),
adjustMaxInputChannelCount(codecId, codecName,
audioCapabilities.maxInputChannelCount, capabilities).toString()))
if (minChannelCount != maxChannelCount) {
"$minChannelCount \u2014 $maxChannelCount"
} else {
maxChannelCount.toString()
}
))

val bitrateRangeString = when {
codecId == "audio/amr-wb-plus" -> // Source: http://www.voiceage.com/AMR-WBplus.html
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/java/com/parseus/codecinfo/utils/Extensions.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.parseus.codecinfo.utils

import android.app.Activity
import android.app.UiModeManager
import android.content.Context
import android.content.ContextWrapper
import android.content.res.Configuration
import android.media.MediaCodecInfo
import java.util.*
Expand Down Expand Up @@ -35,4 +37,7 @@ fun ByteArray.toHexString(): String {

fun MediaCodecInfo.isAudioCodec(): Boolean {
return supportedTypes.joinToString().contains("audio")
}
}

tailrec fun Context.getActivity(): Activity? = this as? Activity
?: (this as? ContextWrapper)?.baseContext?.getActivity()
Loading

0 comments on commit 7f2d0f6

Please sign in to comment.