diff options
author | Akemi <der.richter@gmx.de> | 2018-02-28 15:08:41 +0100 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2018-03-04 16:26:35 -0800 |
commit | ae2972557f555a11591082c213e653ac68a01f23 (patch) | |
tree | 5f4757e0b70ad8344158c433b9903c35970645b5 /video/out/cocoa-cb | |
parent | d7b6ebf64391327c60bdf50becd945f6237e5c9e (diff) | |
download | mpv-ae2972557f555a11591082c213e653ac68a01f23.tar.bz2 mpv-ae2972557f555a11591082c213e653ac68a01f23.tar.xz |
cocoa-cb: use new libmpv API instead of opengl-cb
a new replacement API was introduced with b037121 and the old one was
deprecated. porting cocoa-cb to the new API.
Diffstat (limited to 'video/out/cocoa-cb')
-rw-r--r-- | video/out/cocoa-cb/events_view.swift | 2 | ||||
-rw-r--r-- | video/out/cocoa-cb/video_layer.swift | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/video/out/cocoa-cb/events_view.swift b/video/out/cocoa-cb/events_view.swift index e2da8345f1..729a26263e 100644 --- a/video/out/cocoa-cb/events_view.swift +++ b/video/out/cocoa-cb/events_view.swift @@ -52,7 +52,7 @@ class EventsView: NSView { return } - tracker = NSTrackingArea(rect: self.bounds, + tracker = NSTrackingArea(rect: bounds, options: [.activeAlways, .mouseEnteredAndExited, .mouseMoved, .enabledDuringMouseDrag], owner: self, userInfo: nil) addTrackingArea(tracker!) diff --git a/video/out/cocoa-cb/video_layer.swift b/video/out/cocoa-cb/video_layer.swift index 8e2eee621b..c5604b88f7 100644 --- a/video/out/cocoa-cb/video_layer.swift +++ b/video/out/cocoa-cb/video_layer.swift @@ -76,10 +76,10 @@ class VideoLayer: CAOpenGLLayer { fatalError("init(coder:) has not been implemented") } - func setUpGLCB() { - self.mpv.initGLCB() - self.mpv.setGLCBUpdateCallback(self.updateCallback, context: self) - self.mpv.setGLCBControlCallback(self.cocoaCB.controlCallback, context: self.cocoaCB) + func setUpRender() { + mpv.initRender() + mpv.setRenderUpdateCallback(updateCallback, context: self) + mpv.setRenderControlCallback(cocoaCB.controlCallback, context: cocoaCB) } override func canDraw(inCGLContext ctx: CGLContextObj, @@ -114,7 +114,7 @@ class VideoLayer: CAOpenGLLayer { } } - mpv.drawGLCB(surfaceSize!) + mpv.drawRender(surfaceSize!) CGLFlushDrawable(ctx) drawLock.unlock() @@ -200,7 +200,7 @@ class VideoLayer: CAOpenGLLayer { return ctx } - let updateCallback: mpv_opengl_cb_update_fn = { (ctx) in + let updateCallback: mpv_render_update_fn = { (ctx) in let layer: VideoLayer = MPVHelper.bridge(ptr: ctx!) layer.neededFlips += 1 } @@ -218,7 +218,7 @@ class VideoLayer: CAOpenGLLayer { } func reportFlip() { - mpv.reportGLCBFlip() + mpv.reportRenderFlip() videoLock.lock() if !isAsynchronous && neededFlips > 0 && hasVideo { if !cocoaCB.window.occlusionState.contains(.visible) && |