summaryrefslogtreecommitdiffstats
path: root/video/out/gl_common.h
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2013-03-04 14:23:06 +0100
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2013-05-12 15:27:54 +0200
commit134f3e97bf482b75c0eccbe5ac943a2a1d5a4ad6 (patch)
tree98bac431df2697072238864e48a0380d3b1745ff /video/out/gl_common.h
parentafdc9c4ae2e69a9ced6c3c6580df19edfedea36a (diff)
downloadmpv-134f3e97bf482b75c0eccbe5ac943a2a1d5a4ad6.tar.bz2
mpv-134f3e97bf482b75c0eccbe5ac943a2a1d5a4ad6.tar.xz
OSX: run native event loop in a separate thread
This commit is a followup on the previous one and uses a solution I like more since it totally decouples the Cocoa code from mpv's core and tries to emulate a generic Cocoa application's lifecycle as much as possible without fighting the framework. mpv's main is executed in a pthread while the main thread runs the native cocoa event loop. All of the thread safety is mainly accomplished with additional logic in cocoa_common as to not increase complexity on the crossplatform parts of the code.
Diffstat (limited to 'video/out/gl_common.h')
-rw-r--r--video/out/gl_common.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/video/out/gl_common.h b/video/out/gl_common.h
index 18d1cf8879..1956b73616 100644
--- a/video/out/gl_common.h
+++ b/video/out/gl_common.h
@@ -131,6 +131,13 @@ typedef struct MPGLContext {
void (*border)(struct vo *vo);
void (*update_xinerama_info)(struct vo *vo);
+ // An optional function to register a resize callback in the backend that
+ // can be called on separate thread to handle resize events immediately
+ // (without waiting for vo_check_events, which will come later for the
+ // proper resize)
+ void (*register_resize_callback)(struct vo *vo,
+ void (*cb)(struct vo *vo, int w, int h));
+
// For free use by the backend.
void *priv;
} MPGLContext;