From 134f3e97bf482b75c0eccbe5ac943a2a1d5a4ad6 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 4 Mar 2013 14:23:06 +0100 Subject: 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. --- video/out/cocoa_common.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'video/out/cocoa_common.h') 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); -- cgit v1.2.3