diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-03-04 14:23:06 +0100 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-05-12 15:27:54 +0200 |
commit | 134f3e97bf482b75c0eccbe5ac943a2a1d5a4ad6 (patch) | |
tree | 98bac431df2697072238864e48a0380d3b1745ff /video/out/cocoa_common.h | |
parent | afdc9c4ae2e69a9ced6c3c6580df19edfedea36a (diff) | |
download | mpv-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/cocoa_common.h')
-rw-r--r-- | video/out/cocoa_common.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/video/out/cocoa_common.h b/video/out/cocoa_common.h index 3450ebd547..823325ad15 100644 --- a/video/out/cocoa_common.h +++ b/video/out/cocoa_common.h @@ -24,7 +24,6 @@ struct vo_cocoa_state; -bool vo_cocoa_gui_running(void); void *vo_cocoa_glgetaddr(const char *s); int vo_cocoa_init(struct vo *vo); @@ -37,6 +36,7 @@ int vo_cocoa_config_window(struct vo *vo, uint32_t d_width, uint32_t d_height, uint32_t flags, int gl3profile); +void vo_cocoa_set_current_context(struct vo *vo, bool current); void vo_cocoa_swap_buffers(struct vo *vo); int vo_cocoa_check_events(struct vo *vo); void vo_cocoa_fullscreen(struct vo *vo); @@ -44,6 +44,9 @@ void vo_cocoa_ontop(struct vo *vo); void vo_cocoa_pause(struct vo *vo); void vo_cocoa_resume(struct vo *vo); +void vo_cocoa_register_resize_callback(struct vo *vo, + void (*cb)(struct vo *vo, int w, int h)); + // returns an int to conform to the gl extensions from other platforms int vo_cocoa_swap_interval(int enabled); |