While this exposes events to the Mpv class
private val _events = MutableSharedFlow<Event>(extraBufferCapacity = 4)
val events = _events.asSharedFlow()
There is no way to register a property to be observed. So bindings for mpv_observe_property and mpv_unobserve_property needs to be added.
Also getProperty and setProperty are hardcoded to wrap everything inside a heavy Format.Node. Which is fine for properties you call only a few times but if observeProperty gets added then these are polled at a very high rate and can cause performance issues from marshalling full Node structs at 60 fps. So some functions should bypass Node entirely and return simple primitive overloads.
fun observePropertyDouble(name: String): Result<Double>
fun observePropertyLong(name: String): Result<Long>
fun observetPropertyBoolean(name: String): Result<Boolean>
attachSurface() and detachSurface() for VideoSurface since I've seen mpv get detached from that composable after some form of recomposition.
For heavy initiations steps in compose they should be done in a remember block since recompositions on those cause a lot of lag. Like rememberRenderer() and then you pass the renderer to the VideoSurface along with Mpv.
While this exposes events to the Mpv class
There is no way to register a property to be observed. So bindings for
mpv_observe_propertyandmpv_unobserve_propertyneeds to be added.Also
getPropertyandsetPropertyare hardcoded to wrap everything inside a heavy Format.Node. Which is fine for properties you call only a few times but ifobservePropertygets added then these are polled at a very high rate and can cause performance issues from marshalling full Node structs at 60 fps. So some functions should bypass Node entirely and return simple primitive overloads.attachSurface()anddetachSurface()for VideoSurface since I've seen mpv get detached from that composable after some form of recomposition.For heavy initiations steps in compose they should be done in a remember block since recompositions on those cause a lot of lag. Like
rememberRenderer()and then you pass the renderer to the VideoSurface along with Mpv.