Skip to content
Merged
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
3 changes: 0 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ jobs:
./gradlew clean assembleDebug testDebugUnitTest --no-daemon
apks=$(find app/build/outputs/apk -name '*.apk' -print0 | tr '\0' ',' | sed 's/,$//')
echo "apks=$apks" >> "$GITHUB_OUTPUT"
env:
ORG_GRADLE_PROJECT_WholphinExtensionsUsername: "${{ secrets.EXTENSIONS_USERNAME }}"
ORG_GRADLE_PROJECT_WholphinExtensionsPassword: "${{ secrets.EXTENSIONS_PASSWORD }}"
- name: Tar build dirs
run: |
tar -czf build.tgz ./app/.
Expand Down
10 changes: 10 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ The app uses [media3's `ExoPlayer`](https://github.com/androidx/media) for playb

In the legacy UI, the `PlaybackFragment` abstract class handles most of the playback logic.

#### Extensions

There are several native components for extra playback compatibility. This includes Media3 ffmpeg/av1 decoders and `libmpv`. These extensions are not required to build the app, but without them some functionality will not work.

If you want to include these in a local build, see the [instructions here](https://github.com/damontecres/wholphin-extensions?tab=readme-ov-file#usage) for configuring the repository.

You can also build the extensions locally from https://github.com/damontecres/wholphin-extensions and include them in `app/libs`. The gradle build dependency resolution prefers these local files over fetching from the remote maven registry.

Finally, if no `wholphin-mpv` implementation is found, `:app:mpv-stub` will be used. This allows the app to compile, but any runtime usage of MPV will throw an exception.

### Image loading

The app uses [Coil](https://coil-kt.github.io/coil/) for image loading for composables.
Expand Down
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ dependencies {
implementation(libs.wholphin.extensions.mpv)
} else {
logger.warn("libMPV was NOT found")
implementation(project(":app:mpv-stub"))
}

testImplementation(libs.androidx.test.core.ktx)
Expand Down
1 change: 1 addition & 0 deletions app/mpv-stub/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
5 changes: 5 additions & 0 deletions app/mpv-stub/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# mpv-stub

This is a stub library for [`wholphin-mpv`](https://github.com/damontecres/wholphin-extensions/tree/main/wholphin-mpv). This allows for compiling the app without including the full MPV implementation, but any runtime usage will throw an exception.

See [DEVELOPMENT.md](../../DEVELOPMENT.md) for details on how to include the full implementation in local builds.
25 changes: 25 additions & 0 deletions app/mpv-stub/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
plugins {
alias(libs.plugins.android.library)
}

android {
namespace = "com.github.damontecres.stashapp.mpvstub"
compileSdk {
version = release(36)
}

defaultConfig {
minSdk = 23

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}

dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.media3.common)
}
Empty file.
4 changes: 4 additions & 0 deletions app/mpv-stub/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.github.damontecres.wholphin.mpv

import android.content.Context
import android.os.Looper
import androidx.annotation.OptIn
import androidx.media3.common.SimpleBasePlayer
import androidx.media3.common.util.UnstableApi

/**
* Stub implementation to allow for compiling
*
* See DEVELOPMENT.md for instructions on including the actual implementation in a build
*/
@OptIn(UnstableApi::class)
class MpvPlayer(
private val context: Context,
private val enableHardwareDecoding: Boolean,
private val useGpuNext: Boolean,
) : SimpleBasePlayer(Looper.getMainLooper()) {
init {
throw UnsupportedOperationException("mpv-stub has no runtime functionality!")
}

val isReleased: Boolean get() = throw UnsupportedOperationException("mpv-stub has no runtime functionality!")

override fun getState(): State = throw UnsupportedOperationException("mpv-stub has no runtime functionality!")
}
12 changes: 12 additions & 0 deletions app/mpv-stub/src/main/keepRules/rules.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Add project specific R8 rules here.
# AGP will combine all keep rule files in src/main/keepRules to pass to R8
#
# For more details, see
# https://d.android.com/r/tools/r8/keep-rules

# 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 *;
#}
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ plugins {
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.android.library) apply false
}
4 changes: 4 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ zoomlayout = "1.9.0"
slf4j2Timber = "1.2"
timber = "5.0.1"
wholphin-extensions = "0.2.1"
espressoCore = "3.7.0"
appcompat = "1.7.1"

[libraries]
acra-dialog = { module = "ch.acra:acra-dialog", version.ref = "acra" }
Expand Down Expand Up @@ -82,6 +84,7 @@ androidx-leanback-tab = { module = "androidx.leanback:leanback-tab", version.ref
androidx-leanback-grid = { module = "androidx.leanback:leanback-grid", version.ref = "leanback-grid" }
androidx-media3-effect = { module = "androidx.media3:media3-effect", version.ref = "androidx-media3" }
androidx-media3-datasource-okhttp = { module = "androidx.media3:media3-datasource-okhttp", version.ref = "androidx-media3" }
androidx-media3-common = { module = "androidx.media3:media3-common", version.ref = "androidx-media3" }
androidx-media3-exoplayer = { module = "androidx.media3:media3-exoplayer", version.ref = "androidx-media3" }
androidx-media3-exoplayer-dash = { module = "androidx.media3:media3-exoplayer-dash", version.ref = "androidx-media3" }
androidx-media3-exoplayer-hls = { module = "androidx.media3:media3-exoplayer-hls", version.ref = "androidx-media3" }
Expand Down Expand Up @@ -156,3 +159,4 @@ kotlin-plugin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization"
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
room = { id = "androidx.room", version.ref = "room" }
protobuf = { id = "com.google.protobuf", version.ref = "protobuf" }
android-library = { id = "com.android.library", version.ref = "android-application" }
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ include(":app")

gradle.startParameter.excludedTaskNames.addAll(listOf(":buildSrc:testClasses"))
include(":apollo-compiler")
include(":app:mpv-stub")
Loading