diff --git a/core/src/main/res/values-b+es+419/strings.xml b/core/src/main/res/values-b+es+419/strings.xml
index ade11087..379b1570 100644
--- a/core/src/main/res/values-b+es+419/strings.xml
+++ b/core/src/main/res/values-b+es+419/strings.xml
@@ -120,7 +120,6 @@
Oscuro
Red
Decodificación por hardware
- Códecs de decodificación por hardware
Salida de vídeo
Salida de audio
Direcciones
diff --git a/core/src/main/res/values-bg/strings.xml b/core/src/main/res/values-bg/strings.xml
index 573ac408..37d2d1fb 100644
--- a/core/src/main/res/values-bg/strings.xml
+++ b/core/src/main/res/values-bg/strings.xml
@@ -108,7 +108,6 @@
Classificação IMDB
data adicionada
Buscar incremento de volta (ms)
- Codecs de decodificação de hardware
Saida de video
Requer que o plugin Confused Polar Bears Intro Skipper esteja instalado no servidor
Remover usuário
diff --git a/core/src/main/res/values-de/strings.xml b/core/src/main/res/values-de/strings.xml
index 1e3fdd87..ae19a4aa 100644
--- a/core/src/main/res/values-de/strings.xml
+++ b/core/src/main/res/values-de/strings.xml
@@ -134,7 +134,6 @@
Benötigt ConfusedPolarBears Intro Skipper Plugin installiert auf dem Server
Übernehme Systemeinstellung
Hardware-Dekodierung
- Hardware-Dekodierung Codecs
Videoausgang
Audioausgang
Trickspiel
diff --git a/core/src/main/res/values-es-rMX/strings.xml b/core/src/main/res/values-es-rMX/strings.xml
index daa11927..5949df00 100644
--- a/core/src/main/res/values-es-rMX/strings.xml
+++ b/core/src/main/res/values-es-rMX/strings.xml
@@ -128,7 +128,6 @@
Usuarios
Agregar usuario
Decodificación por hardware
- Codecs con decodificación por hardware
Salida de video
Salida de audio
Direcciones
diff --git a/core/src/main/res/values-es/strings.xml b/core/src/main/res/values-es/strings.xml
index 2f6f02f7..d185a4bf 100644
--- a/core/src/main/res/values-es/strings.xml
+++ b/core/src/main/res/values-es/strings.xml
@@ -125,7 +125,6 @@
Esperar zócalo (ms)
Usuarios
Agregar usuario
- Codecs de decodificación por hardware
Salida de video
Salida de audio
Quitar usuario
diff --git a/core/src/main/res/values-fr/strings.xml b/core/src/main/res/values-fr/strings.xml
index ec017a4b..012532b7 100644
--- a/core/src/main/res/values-fr/strings.xml
+++ b/core/src/main/res/values-fr/strings.xml
@@ -123,7 +123,6 @@
Supprimer l\'utilisateur
Voulez-vous vraiment supprimer l\'utilisateur %1$s
Utilisateurs
- Décodages matériels supportés
Connexion rapide
Passer l\'introduction
Le plugin Intro Skipper de ConfusedPolarBear doit être installé sur le serveur
diff --git a/core/src/main/res/values-hu/strings.xml b/core/src/main/res/values-hu/strings.xml
index 90cd8212..edb5abc5 100644
--- a/core/src/main/res/values-hu/strings.xml
+++ b/core/src/main/res/values-hu/strings.xml
@@ -128,7 +128,6 @@
Csatlakozási időtúllépés (ms)
Felhasználó hozzádása
Hardveres dekódolás
- Hardveres dekódolási kodekek
Socket időtúllépése (ms)
Lekérdezési idő túllépés (ms)
Dinamikus színek
diff --git a/core/src/main/res/values-it/strings.xml b/core/src/main/res/values-it/strings.xml
index a88a5b3d..91475f5c 100644
--- a/core/src/main/res/values-it/strings.xml
+++ b/core/src/main/res/values-it/strings.xml
@@ -128,7 +128,6 @@
Utenti
Aggiungi utente
Decodifica hardware
- Codec di decodifica hardware
Output video
Indirizzi
Aggiungi indirizzo
diff --git a/core/src/main/res/values-iw/strings.xml b/core/src/main/res/values-iw/strings.xml
index 9ca96a2b..af8dd55c 100644
--- a/core/src/main/res/values-iw/strings.xml
+++ b/core/src/main/res/values-iw/strings.xml
@@ -117,7 +117,6 @@
כתוביות
הצג מידע נוסף
זמן קצוב ל-Socket (מילי שניות)
- מפענחי חומרה
יציאת וידאו
יציאת שמע
מדלג פתיחים
diff --git a/core/src/main/res/values-ko/strings.xml b/core/src/main/res/values-ko/strings.xml
index a7b8ef59..8c14ecc5 100644
--- a/core/src/main/res/values-ko/strings.xml
+++ b/core/src/main/res/values-ko/strings.xml
@@ -128,7 +128,6 @@
유저 추가
하드웨어 디코딩
서버 주소 추가
- 하드웨어 디코딩 코덱
비디오 출력
오디오 출력
주소
diff --git a/core/src/main/res/values-nl/strings.xml b/core/src/main/res/values-nl/strings.xml
index d8485272..948292af 100644
--- a/core/src/main/res/values-nl/strings.xml
+++ b/core/src/main/res/values-nl/strings.xml
@@ -70,7 +70,6 @@
Zoek vooruitstap (ms)
Selecteer versie
Hardware decoding
- Hardware decodering codecs
Video uitvoer
Audio uitvoer
Bibliotheken
diff --git a/core/src/main/res/values-pl/strings.xml b/core/src/main/res/values-pl/strings.xml
index 5780e48f..a05cabf9 100644
--- a/core/src/main/res/values-pl/strings.xml
+++ b/core/src/main/res/values-pl/strings.xml
@@ -122,7 +122,6 @@
Ciemny
Odcinki
Dodaj użytkownika
- Sprzętowe kodeki do dekodowania
Wyjście wideo
Wyjście audio
Krok przesuwania wstecznego (ms)
diff --git a/core/src/main/res/values-pt-rBR/strings.xml b/core/src/main/res/values-pt-rBR/strings.xml
index 40147531..a5e3ee01 100644
--- a/core/src/main/res/values-pt-rBR/strings.xml
+++ b/core/src/main/res/values-pt-rBR/strings.xml
@@ -115,7 +115,6 @@
Usuários
Adicionar usuário
Decodificação de hardware
- Codecs de decodificação de hardware
Data de Adição
Data de Reprodução
Crescente
diff --git a/core/src/main/res/values-pt/strings.xml b/core/src/main/res/values-pt/strings.xml
index 6d680137..0adc48c4 100644
--- a/core/src/main/res/values-pt/strings.xml
+++ b/core/src/main/res/values-pt/strings.xml
@@ -124,7 +124,6 @@
Tem certeza de que deseja remover o usuário %1$s
Saida de video
Saída de áudio
- Codecs de decodificação de hardware
Adicionar endereço
Jogo de truque
%1$d. %2$s
diff --git a/core/src/main/res/values-ro/strings.xml b/core/src/main/res/values-ro/strings.xml
index 45e059a8..fa6adc89 100644
--- a/core/src/main/res/values-ro/strings.xml
+++ b/core/src/main/res/values-ro/strings.xml
@@ -77,7 +77,6 @@
Utilizatori
Adaugă un utilizator
Decodare hardware
- Codecuri de decodare hardware
Ieșire video
Ieșire audio
Necesită ca pluginul IntroSkipper de ConfusedPolarBear să fie instalat pe server
diff --git a/core/src/main/res/values-ru/strings.xml b/core/src/main/res/values-ru/strings.xml
index 237a5299..9f9f6207 100644
--- a/core/src/main/res/values-ru/strings.xml
+++ b/core/src/main/res/values-ru/strings.xml
@@ -110,7 +110,6 @@
Светлая
Тёмная
Аппаратное декодирование
- Кодеки аппаратного декодирования
Вывод видео
Intro Skipper (Пропуск заставок)
Адреса
diff --git a/core/src/main/res/values-sk/strings.xml b/core/src/main/res/values-sk/strings.xml
index 713eccf7..5c9e1244 100644
--- a/core/src/main/res/values-sk/strings.xml
+++ b/core/src/main/res/values-sk/strings.xml
@@ -100,7 +100,6 @@
Limit čakania na socket (ms)
Používatelia
Hardvérové dekódovanie
- Kodeky hardvérového dekódovania
Výstup videa
Výstup zvuku
Vyžaduje nainštalovaný plugin Intro Skipper od ConfusedPolarBear na serveri
diff --git a/core/src/main/res/values-sl/strings.xml b/core/src/main/res/values-sl/strings.xml
index a623f7d4..eb762f8b 100644
--- a/core/src/main/res/values-sl/strings.xml
+++ b/core/src/main/res/values-sl/strings.xml
@@ -100,7 +100,6 @@
Uporabniki
Dodaj uporabnika
Strojno dekodiranje
- Kodeki za strojno dekodiranje
Video izhod
Avdio izhod
Preskoči uvode
diff --git a/core/src/main/res/values-sv/strings.xml b/core/src/main/res/values-sv/strings.xml
index c9cf79d1..12a1d938 100644
--- a/core/src/main/res/values-sv/strings.xml
+++ b/core/src/main/res/values-sv/strings.xml
@@ -91,7 +91,6 @@
Timeout för anslutning (ms)
Användare
Lägg till användare
- Hårdvaruavkodningsformat
Videooutput
Ljudoutput
Trickspel
diff --git a/core/src/main/res/values-uk/strings.xml b/core/src/main/res/values-uk/strings.xml
index 95aa6314..59850ace 100644
--- a/core/src/main/res/values-uk/strings.xml
+++ b/core/src/main/res/values-uk/strings.xml
@@ -160,7 +160,6 @@
Використовувати кольори Material You (доступно лише на Android 12+)
Як на пристрої
Тайм-аут підключення (мс)
- Апаратні кодеки декодування
Додати
Аудіо
Субтитри
diff --git a/core/src/main/res/values-vi/strings.xml b/core/src/main/res/values-vi/strings.xml
index ac4e9737..40cb1350 100644
--- a/core/src/main/res/values-vi/strings.xml
+++ b/core/src/main/res/values-vi/strings.xml
@@ -100,7 +100,6 @@
Thời gian socket hết hạn (ms)
Người dùng
Giải mã phần cứng
- Các bộ giải mã phần cứng
Đầu ra hình ảnh
Đầu ra âm thanh
Địa chỉ
diff --git a/core/src/main/res/values-zh-rCN/strings.xml b/core/src/main/res/values-zh-rCN/strings.xml
index bdd28e3a..ed7103c0 100644
--- a/core/src/main/res/values-zh-rCN/strings.xml
+++ b/core/src/main/res/values-zh-rCN/strings.xml
@@ -127,7 +127,6 @@
用户
添加用户
硬解
- 硬解解码器
视频输出
音频输出
地址
diff --git a/core/src/main/res/values-zh-rTW/strings.xml b/core/src/main/res/values-zh-rTW/strings.xml
index 241c6f5b..84b2a22e 100644
--- a/core/src/main/res/values-zh-rTW/strings.xml
+++ b/core/src/main/res/values-zh-rTW/strings.xml
@@ -130,7 +130,6 @@
片頭跳過器
需要在服務器上安裝ConfusedPolarBear的Intro Skipper挿件
硬體解碼
- 硬體解碼轉碼器
視頻輸出
音頻輸出
地址
diff --git a/core/src/main/res/values/string_arrays.xml b/core/src/main/res/values/string_arrays.xml
index bc768c8a..6e92f5c0 100644
--- a/core/src/main/res/values/string_arrays.xml
+++ b/core/src/main/res/values/string_arrays.xml
@@ -17,15 +17,6 @@
- mediacodec
- mediacodec-copy
-
- - h264
- - hevc
- - mpeg4
- - mpeg2video
- - vp8
- - vp9
- - av1
-
- gpu
- gpu-next
@@ -34,7 +25,4 @@
- audiotrack
- opensles
-
- - opengl
-
\ No newline at end of file
diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml
index 82eb95de..ec8684c0 100644
--- a/core/src/main/res/values/strings.xml
+++ b/core/src/main/res/values/strings.xml
@@ -137,10 +137,8 @@
Users
Add user
Hardware decoding
- Hardware decoding codecs
Video output
Audio output
- GPU API
Intro Skipper
Requires ConfusedPolarBear\'s Intro Skipper plugin to be installed on the server
Trick Play
diff --git a/core/src/main/res/xml/fragment_settings_player.xml b/core/src/main/res/xml/fragment_settings_player.xml
index 9d47c844..fcc8aeb4 100644
--- a/core/src/main/res/xml/fragment_settings_player.xml
+++ b/core/src/main/res/xml/fragment_settings_player.xml
@@ -11,20 +11,13 @@
app:summary="@string/mpv_player_summary"
app:title="@string/mpv_player" />
-
-
diff --git a/player/video/src/main/java/dev/jdtech/jellyfin/mpv/MPVPlayer.kt b/player/video/src/main/java/dev/jdtech/jellyfin/mpv/MPVPlayer.kt
index 674beb3d..4f3d6377 100644
--- a/player/video/src/main/java/dev/jdtech/jellyfin/mpv/MPVPlayer.kt
+++ b/player/video/src/main/java/dev/jdtech/jellyfin/mpv/MPVPlayer.kt
@@ -34,7 +34,6 @@ import androidx.media3.common.util.Clock
import androidx.media3.common.util.ListenerSet
import androidx.media3.common.util.Size
import androidx.media3.common.util.Util
-import dev.jdtech.jellyfin.AppPreferences
import dev.jdtech.mpv.MPVLib
import org.json.JSONArray
import org.json.JSONException
@@ -48,8 +47,12 @@ import java.util.concurrent.CopyOnWriteArraySet
class MPVPlayer(
context: Context,
private val requestAudioFocus: Boolean,
- private val appPreferences: AppPreferences,
private var trackSelectionParameters: TrackSelectionParameters = TrackSelectionParameters.Builder(context).build(),
+ private val seekBackIncrement: Long = C.DEFAULT_SEEK_BACK_INCREMENT_MS,
+ private val seekForwardIncrement: Long = C.DEFAULT_SEEK_FORWARD_INCREMENT_MS,
+ videoOutput: String = "gpu",
+ audioOutput: String = "audiotrack",
+ hwDec: String = "mediacodec",
) : BasePlayer(), MPVLib.EventObserver, AudioManager.OnAudioFocusChangeListener {
private val audioManager: AudioManager by lazy { context.getSystemService()!! }
@@ -74,14 +77,13 @@ class MPVPlayer(
// General
MPVLib.setOptionString("config", "yes")
MPVLib.setOptionString("config-dir", mpvDir.path)
- MPVLib.setOptionString("vo", appPreferences.playerMpvVo)
+ MPVLib.setOptionString("vo", videoOutput)
+ MPVLib.setOptionString("ao", audioOutput)
MPVLib.setOptionString("gpu-context", "android")
- MPVLib.setOptionString("gpu-api", appPreferences.playerMpvGpuApi)
- MPVLib.setOptionString("ao", appPreferences.playerMpvAo)
// Hardware video decoding
- MPVLib.setOptionString("hwdec", appPreferences.playerMpvHwdec)
- MPVLib.setOptionString("hwdec-codecs", appPreferences.playerMpvHwdecCodecs.joinToString(separator = ","))
+ MPVLib.setOptionString("hwdec", hwDec)
+ MPVLib.setOptionString("hwdec-codecs", "h264,hevc,mpeg4,mpeg2video,vp8,vp9,av1")
// TLS
MPVLib.setOptionString("tls-verify", "no")
@@ -111,8 +113,6 @@ class MPVPlayer(
MPVLib.init()
- companionPrefs = appPreferences
-
MPVLib.addObserver(this)
// Observe properties
@@ -885,11 +885,11 @@ class MPVPlayer(
}
override fun getSeekBackIncrement(): Long {
- return appPreferences.playerSeekBackIncrement
+ return seekBackIncrement
}
override fun getSeekForwardIncrement(): Long {
- return appPreferences.playerSeekForwardIncrement
+ return seekForwardIncrement
}
override fun getMaxSeekToPreviousPosition(): Long {
@@ -1316,6 +1316,58 @@ class MPVPlayer(
}
}
+ private val surfaceHolder: SurfaceHolder.Callback = object : SurfaceHolder.Callback {
+ /**
+ * This is called immediately after the surface is first created.
+ * Implementations of this should start up whatever rendering code
+ * they desire. Note that only one thread can ever draw into
+ * a [Surface], so you should not draw into the Surface here
+ * if your normal rendering will be in another thread.
+ *
+ * @param holder The SurfaceHolder whose surface is being created.
+ */
+ override fun surfaceCreated(holder: SurfaceHolder) {
+ MPVLib.attachSurface(holder.surface)
+ MPVLib.setOptionString("force-window", "yes")
+ MPVLib.setOptionString("vo", videoOutput)
+ }
+
+ /**
+ * This is called immediately after any structural changes (format or
+ * size) have been made to the surface. You should at this point update
+ * the imagery in the surface. This method is always called at least
+ * once, after [.surfaceCreated].
+ *
+ * @param holder The SurfaceHolder whose surface has changed.
+ * @param format The new [android.graphics.PixelFormat] of the surface.
+ * @param width The new width of the surface.
+ * @param height The new height of the surface.
+ */
+ override fun surfaceChanged(
+ holder: SurfaceHolder,
+ format: Int,
+ width: Int,
+ height: Int,
+ ) {
+ MPVLib.setPropertyString("android-surface-size", "${width}x$height")
+ }
+
+ /**
+ * This is called immediately before a surface is being destroyed. After
+ * returning from this call, you should no longer try to access this
+ * surface. If you have a rendering thread that directly accesses
+ * the surface, you must ensure that thread is no longer touching the
+ * Surface before returning from this function.
+ *
+ * @param holder The SurfaceHolder whose surface is being destroyed.
+ */
+ override fun surfaceDestroyed(holder: SurfaceHolder) {
+ MPVLib.setOptionString("vo", "null")
+ MPVLib.setOptionString("force-window", "no")
+ MPVLib.detachSurface()
+ }
+ }
+
companion object {
/**
* Fraction to which audio volume is ducked on loss of audio focus
@@ -1335,60 +1387,6 @@ class MPVPlayer(
)
.build()
- private lateinit var companionPrefs: AppPreferences
-
- private val surfaceHolder: SurfaceHolder.Callback = object : SurfaceHolder.Callback {
- /**
- * This is called immediately after the surface is first created.
- * Implementations of this should start up whatever rendering code
- * they desire. Note that only one thread can ever draw into
- * a [Surface], so you should not draw into the Surface here
- * if your normal rendering will be in another thread.
- *
- * @param holder The SurfaceHolder whose surface is being created.
- */
- override fun surfaceCreated(holder: SurfaceHolder) {
- MPVLib.attachSurface(holder.surface)
- MPVLib.setOptionString("force-window", "yes")
- MPVLib.setOptionString("vo", companionPrefs.playerMpvVo)
- }
-
- /**
- * This is called immediately after any structural changes (format or
- * size) have been made to the surface. You should at this point update
- * the imagery in the surface. This method is always called at least
- * once, after [.surfaceCreated].
- *
- * @param holder The SurfaceHolder whose surface has changed.
- * @param format The new [android.graphics.PixelFormat] of the surface.
- * @param width The new width of the surface.
- * @param height The new height of the surface.
- */
- override fun surfaceChanged(
- holder: SurfaceHolder,
- format: Int,
- width: Int,
- height: Int,
- ) {
- MPVLib.setPropertyString("android-surface-size", "${width}x$height")
- }
-
- /**
- * This is called immediately before a surface is being destroyed. After
- * returning from this call, you should no longer try to access this
- * surface. If you have a rendering thread that directly accesses
- * the surface, you must ensure that thread is no longer touching the
- * Surface before returning from this function.
- *
- * @param holder The SurfaceHolder whose surface is being destroyed.
- */
- override fun surfaceDestroyed(holder: SurfaceHolder) {
- MPVLib.setOptionString("vo", "null")
- MPVLib.setOptionString("force-window", "no")
- MPVLib.detachSurface()
- }
- }
-
private fun JSONObject.optNullableString(name: String): String? {
return if (this.has(name) && !this.isNull(name)) {
this.getString(name)
diff --git a/player/video/src/main/java/dev/jdtech/jellyfin/viewmodels/PlayerActivityViewModel.kt b/player/video/src/main/java/dev/jdtech/jellyfin/viewmodels/PlayerActivityViewModel.kt
index e18fc7e6..53a358d0 100644
--- a/player/video/src/main/java/dev/jdtech/jellyfin/viewmodels/PlayerActivityViewModel.kt
+++ b/player/video/src/main/java/dev/jdtech/jellyfin/viewmodels/PlayerActivityViewModel.kt
@@ -93,10 +93,14 @@ constructor(
.setPreferredTextLanguage(appPreferences.preferredSubtitleLanguage)
.build()
player = MPVPlayer(
- application,
- false,
- appPreferences,
- trackSelectionParameters,
+ context = application,
+ requestAudioFocus = false,
+ trackSelectionParameters = trackSelectionParameters,
+ seekBackIncrement = appPreferences.playerSeekBackIncrement,
+ seekForwardIncrement = appPreferences.playerSeekForwardIncrement,
+ videoOutput = appPreferences.playerMpvVo,
+ audioOutput = appPreferences.playerMpvAo,
+ hwDec = appPreferences.playerMpvHwdec,
)
} else {
val renderersFactory =
diff --git a/preferences/src/main/java/dev/jdtech/jellyfin/AppPreferences.kt b/preferences/src/main/java/dev/jdtech/jellyfin/AppPreferences.kt
index 860abfb9..69905bb3 100644
--- a/preferences/src/main/java/dev/jdtech/jellyfin/AppPreferences.kt
+++ b/preferences/src/main/java/dev/jdtech/jellyfin/AppPreferences.kt
@@ -71,13 +71,8 @@ constructor(
)!!.toLongOrNull() ?: DEFAULT_SEEK_FORWARD_INCREMENT_MS
val playerMpv get() = sharedPreferences.getBoolean(Constants.PREF_PLAYER_MPV, false)
val playerMpvHwdec get() = sharedPreferences.getString(Constants.PREF_PLAYER_MPV_HWDEC, "mediacodec-copy")!!
- val playerMpvHwdecCodecs: Set get() = sharedPreferences.getStringSet(
- Constants.PREF_PLAYER_MPV_HWDEC_CODECS,
- setOf("h264", "hevc", "mpeg4", "mpeg2video", "vp8", "vp9"),
- )!!
val playerMpvVo get() = sharedPreferences.getString(Constants.PREF_PLAYER_MPV_VO, "gpu")!!
val playerMpvAo get() = sharedPreferences.getString(Constants.PREF_PLAYER_MPV_AO, "audiotrack")!!
- val playerMpvGpuApi get() = sharedPreferences.getString(Constants.PREF_PLAYER_MPV_GPU_API, "opengl")!!
val playerIntroSkipper get() = sharedPreferences.getBoolean(Constants.PREF_PLAYER_INTRO_SKIPPER, true)
val playerTrickPlay get() = sharedPreferences.getBoolean(Constants.PREF_PLAYER_TRICK_PLAY, true)
diff --git a/preferences/src/main/java/dev/jdtech/jellyfin/Constants.kt b/preferences/src/main/java/dev/jdtech/jellyfin/Constants.kt
index a9f5dda0..b34d6313 100644
--- a/preferences/src/main/java/dev/jdtech/jellyfin/Constants.kt
+++ b/preferences/src/main/java/dev/jdtech/jellyfin/Constants.kt
@@ -22,10 +22,8 @@ object Constants {
const val PREF_PLAYER_SEEK_FORWARD_INC = "pref_player_seek_forward_inc"
const val PREF_PLAYER_MPV = "pref_player_mpv"
const val PREF_PLAYER_MPV_HWDEC = "pref_player_mpv_hwdec"
- const val PREF_PLAYER_MPV_HWDEC_CODECS = "pref_player_mpv_hwdec_codecs"
const val PREF_PLAYER_MPV_VO = "pref_player_mpv_vo"
const val PREF_PLAYER_MPV_AO = "pref_player_mpv_ao"
- const val PREF_PLAYER_MPV_GPU_API = "pref_player_mpv_gpu_api"
const val PREF_PLAYER_INTRO_SKIPPER = "pref_player_intro_skipper"
const val PREF_PLAYER_TRICK_PLAY = "pref_player_trick_play"
const val PREF_PLAYER_PIP_GESTURE = "pref_player_picture_in_picture_gesture"