mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-11-07 03:04:50 +01:00
Update wholphin-extensions with newer MpvPlayer (#1365)
## Description Uses the newer version of `wholphin-extensions` which now has the Kotlin code, so this PR removes the MPV Kotlin code from this repo. Also updates gradle to use providers. There are no user facing changes ### Dev notes `wholphin-mpv` can be provided by: 1. [Fetching pre-built binaries](https://github.com/damontecres/wholphin-extensions#pre-built-binaries) (Preferred method for devs) 2. Building `wholphin-extensions` from [source](https://github.com/damontecres/wholphin-extensions#build-from-source) 3. Using `wholphin-mpv-stub` (the new module added in this PR) which allows for compiling Wholphin, but will throw exceptions if MPV is used during runtime ### Related issues Related to #1172 ### Testing Emulator ## Screenshots N/A ## AI or LLM usage None
This commit is contained in:
parent
f5ce9745ba
commit
a8ade9171e
24 changed files with 177 additions and 1652 deletions
1
wholphin-mpv-stub/.gitignore
vendored
Normal file
1
wholphin-mpv-stub/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
/build
|
||||
5
wholphin-mpv-stub/README.md
Normal file
5
wholphin-mpv-stub/README.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# wholphin-mpv-stub
|
||||
|
||||
This is a non-functional stub implementation for the `wholphin-mpv` library in https://github.com/damontecres/wholphin-extensions.
|
||||
|
||||
This provides the minimal API so that Wholphin can compile without `wholphin-mpv`, but any runtime usage will error out.
|
||||
38
wholphin-mpv-stub/build.gradle.kts
Normal file
38
wholphin-mpv-stub/build.gradle.kts
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
plugins {
|
||||
alias(libs.plugins.android.library)
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.github.damontecres.wholphin.mpv"
|
||||
compileSdk {
|
||||
version = release(36)
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
minSdk = 23
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles("consumer-rules.pro")
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro",
|
||||
)
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.androidx.media3.exoplayer)
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.androidx.junit)
|
||||
androidTestImplementation(libs.androidx.espresso.core)
|
||||
}
|
||||
0
wholphin-mpv-stub/consumer-rules.pro
Normal file
0
wholphin-mpv-stub/consumer-rules.pro
Normal file
21
wholphin-mpv-stub/proguard-rules.pro
vendored
Normal file
21
wholphin-mpv-stub/proguard-rules.pro
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# 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 *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
4
wholphin-mpv-stub/src/main/AndroidManifest.xml
Normal file
4
wholphin-mpv-stub/src/main/AndroidManifest.xml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
</manifest>
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.github.damontecres.wholphin.mpv
|
||||
|
||||
/**
|
||||
* Stubs out MPVLib in wholphin-mpv
|
||||
*/
|
||||
object MPVLib {
|
||||
fun setPropertyString(
|
||||
key: String,
|
||||
value: String,
|
||||
): Unit = throw MpvStubException()
|
||||
|
||||
fun setPropertyInt(
|
||||
key: String,
|
||||
value: Int,
|
||||
): Unit = throw MpvStubException()
|
||||
|
||||
fun setPropertyDouble(
|
||||
key: String,
|
||||
value: Double,
|
||||
): Unit = throw MpvStubException()
|
||||
|
||||
fun setPropertyBoolean(
|
||||
key: String,
|
||||
value: Boolean,
|
||||
): Unit = throw MpvStubException()
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
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
|
||||
import kotlin.time.Duration
|
||||
|
||||
/**
|
||||
* Stubs out MpvPlayer in wholphin-mpv
|
||||
*/
|
||||
@OptIn(UnstableApi::class)
|
||||
class MpvPlayer(
|
||||
private val context: Context,
|
||||
private val enableHardwareDecoding: Boolean,
|
||||
private val useGpuNext: Boolean,
|
||||
) : SimpleBasePlayer(Looper.getMainLooper()) {
|
||||
override fun getState(): State = throw MpvStubException()
|
||||
|
||||
var subtitleDelay: Duration = throw MpvStubException()
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.github.damontecres.wholphin.mpv
|
||||
|
||||
class MpvStubException : Exception("This build is using wholphin-mpv-stub which does not implement actual functionality")
|
||||
Loading…
Add table
Add a link
Reference in a new issue