Wholphin/app/src/main/jni
Ray 8b40e89b8a
Update MPV playback threading model (#481)
There's no user facing changes in this PR

This PR updates `MpvPlayer` to use a threading model more similar to
[ExoPlayer's
model](https://developer.android.com/reference/androidx/media3/exoplayer/ExoPlayer#threading-model).

There's now a dedicated thread looper message queue between the UI
interactions on the main thread and calls to `libmpv`. This is necessary
because previously, the main thread would make the calls into `libmpv`.
`libmpv` uses internal mutex locking for some operations which meant
that the main thread would be blocked momentarily.

Now, the UI issues a command (eg seek to X position) and the command is
added to the thread looper queue and processed on that separate thread.
This uses the standard Android Handler/Looper mechanisms.

Related to #235
2025-12-17 18:24:25 -05:00
..
Android.mk Add experimental MPV player backend (#161) 2025-11-16 18:46:25 -05:00
Application.mk Add experimental MPV player backend (#161) 2025-11-16 18:46:25 -05:00
event.cpp Add experimental MPV player backend (#161) 2025-11-16 18:46:25 -05:00
event.h Add experimental MPV player backend (#161) 2025-11-16 18:46:25 -05:00
globals.h Add experimental MPV player backend (#161) 2025-11-16 18:46:25 -05:00
jni_utils.cpp Add experimental MPV player backend (#161) 2025-11-16 18:46:25 -05:00
jni_utils.h Add experimental MPV player backend (#161) 2025-11-16 18:46:25 -05:00
log.cpp Add experimental MPV player backend (#161) 2025-11-16 18:46:25 -05:00
log.h Update MPV playback threading model (#481) 2025-12-17 18:24:25 -05:00
main.cpp Add experimental MPV player backend (#161) 2025-11-16 18:46:25 -05:00
property.cpp Add experimental MPV player backend (#161) 2025-11-16 18:46:25 -05:00
README.md Add experimental MPV player backend (#161) 2025-11-16 18:46:25 -05:00
render.cpp Add experimental MPV player backend (#161) 2025-11-16 18:46:25 -05:00
thumbnail.cpp Add experimental MPV player backend (#161) 2025-11-16 18:46:25 -05:00

JNI bindings for libmpv

The files in this directory are copied from https://github.com/mpv-android/mpv-android/tree/master/app/src/main/jni

The files are copyrighted and used under MIT license below:

Copyright (c) 2016 Ilya Zhuravlev Copyright (c) 2016 sfan5 sfan5@live.de

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.