cocoa-cb: use new ambient-light property and remove old libmpv usage
This commit is contained in:
1 parent
e0f82b1a77
commit
e785296a1c
4 files changed
+1
-18
No files matched your search
@@ -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)
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -274,7 +274,7 @@ class Common: NSObject {
|
||||
}
|
||||
|
||||
func lightSensorUpdate() {
|
||||
log.warning("lightSensorUpdate not implemented")
|
||||
flagEvents(VO_EVENT_AMBIENT_LIGHTING_CHANGED)
|
||||
}
|
||||
|
||||
func initLightSensor() {
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user