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/gl_common.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'video/out/gl_common.h') 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; -- cgit v1.2.3