summaryrefslogtreecommitdiffstats
path: root/video/out/gl_video.c
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2014-10-18 18:30:22 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2014-10-18 18:30:22 +0200
commitfa904150bfb7467b66e7fc0a7c709e61cb3dd9fc (patch)
tree4178261c60fb754197df47264784305f422136cc /video/out/gl_video.c
parent421bce00776f00cc0185ef65b82a6a4c8bcfd366 (diff)
downloadmpv-fa904150bfb7467b66e7fc0a7c709e61cb3dd9fc.tar.bz2
mpv-fa904150bfb7467b66e7fc0a7c709e61cb3dd9fc.tar.xz
cocoa: reintroduce async resize
After removing synchronous libdispatch calls, this looks like it doesn't deadlock anymore. I also experimented with pthread_mutex_trylock liek wm4 suggested, but it leads to some annoying black flickering. I will fallback to that only if some new deadlocks are discovered.
Diffstat (limited to 'video/out/gl_video.c')
-rw-r--r--video/out/gl_video.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c
index c66021ee76..7e416a61c2 100644
--- a/video/out/gl_video.c
+++ b/video/out/gl_video.c
@@ -2388,6 +2388,18 @@ static int validate_scaler_opt(struct mp_log *log, const m_option_t *opt,
return handle_scaler_opt(s) ? 1 : M_OPT_INVALID;
}
+// Resize and redraw the contents of the window without further configuration.
+// Intended to be used in situations where the frontend can't really be
+// involved with reconfiguring the VO properly.
+// gl_video_resize() should be called when user interaction is done.
+void gl_video_resize_redraw(struct gl_video *p, int w, int h)
+{
+ p->gl->Viewport(p->vp_x, p->vp_y, w, h);
+ p->vp_w = w;
+ p->vp_h = h;
+ gl_video_render_frame(p);
+}
+
void gl_video_set_hwdec(struct gl_video *p, struct gl_hwdec *hwdec)
{
p->hwdec = hwdec;