cocoa-cb: use new ambient-light property and remove old libmpv usage

This commit is contained in:
der richter committed 2024-12-21 16:15:44 +01:00
1 parent e0f82b1a77
commit e785296a1c
4 files changed
+1 -18

No files matched your search

-9
View File
@@ -154,15 +154,6 @@ class LibmpvHelper {
}
}
func setRenderLux(_ lux: Int) {
if mpvRenderContext == nil { return }
var light = lux
withUnsafeMutableBytes(of: &light) { (ptr: UnsafeMutableRawBufferPointer) in
let params = mpv_render_param(type: MPV_RENDER_PARAM_AMBIENT_LIGHT, data: ptr.baseAddress)
mpv_render_context_set_parameter(mpvRenderContext, params)
}
}
func uninit() {
mpv_render_context_set_update_callback(mpvRenderContext, nil, nil)
mp_render_context_set_control_callback(mpvRenderContext, nil, nil)
-4
View File
@@ -110,10 +110,6 @@ class CocoaCB: Common, EventSubscriber {
return kCVReturnSuccess
}
override func lightSensorUpdate() {
libmpv.setRenderLux(Int(lmuToLux(lastLmu)))
}
override func updateICCProfile() {
guard let colorSpace = window?.screen?.colorSpace else {
log.warning("Couldn't update ICC Profile, no color space available")
+1 -1
View File
@@ -274,7 +274,7 @@ class Common: NSObject {
}
func lightSensorUpdate() {
log.warning("lightSensorUpdate not implemented")
flagEvents(VO_EVENT_AMBIENT_LIGHTING_CHANGED)
}
func initLightSensor() {
-4
View File
@@ -147,10 +147,6 @@ class MacCommon: Common {
timer?.updatePolicy(periodSeconds: 1 / currentFps())
}
override func lightSensorUpdate() {
flagEvents(VO_EVENT_AMBIENT_LIGHTING_CHANGED)
}
override func updateICCProfile() {
flagEvents(VO_EVENT_ICC_PROFILE_CHANGED)
}