From 82afc0f343e9b5d561051ebee51d0feffbde0377 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 3 Dec 2014 20:40:06 +0100 Subject: vda: use implicit current GL context Removes the dependency from the Cocoa backend in case we are not using it but still wanna use VDA GL introp. --- video/out/cocoa_common.h | 3 --- video/out/cocoa_common.m | 11 ----------- video/out/gl_hwdec_vda.c | 3 +-- 3 files changed, 1 insertion(+), 16 deletions(-) (limited to 'video') diff --git a/video/out/cocoa_common.h b/video/out/cocoa_common.h index 8e59ab6764..be68b7ca22 100644 --- a/video/out/cocoa_common.h +++ b/video/out/cocoa_common.h @@ -42,9 +42,6 @@ void vo_cocoa_register_resize_callback(struct vo *vo, void vo_cocoa_register_gl_clear_callback(struct vo *vo, void *ctx, void (*cb)(void *ctx)); -void *vo_cocoa_cgl_context(struct vo *vo); -void *vo_cocoa_cgl_pixel_format(struct vo *vo); - void vo_cocoa_create_nsgl_ctx(struct vo *vo, void *ctx); void vo_cocoa_release_nsgl_ctx(struct vo *vo); diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index 83c006d86f..dca4290d07 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -716,17 +716,6 @@ int vo_cocoa_control(struct vo *vo, int *events, int request, void *arg) return VO_NOTIMPL; } -void *vo_cocoa_cgl_context(struct vo *vo) -{ - struct vo_cocoa_state *s = vo->cocoa; - return [s->gl_ctx CGLContextObj]; -} - -void *vo_cocoa_cgl_pixel_format(struct vo *vo) -{ - return CGLGetPixelFormat(vo_cocoa_cgl_context(vo)); -} - @implementation MpvCocoaAdapter @synthesize vout = _video_output; diff --git a/video/out/gl_hwdec_vda.c b/video/out/gl_hwdec_vda.c index c86c1abb34..b85b4665e8 100644 --- a/video/out/gl_hwdec_vda.c +++ b/video/out/gl_hwdec_vda.c @@ -23,7 +23,6 @@ #include #include "video/decode/dec_video.h" -#include "cocoa_common.h" #include "gl_common.h" struct priv { @@ -87,7 +86,7 @@ static int map_image(struct gl_hwdec *hw, struct mp_image *hw_image, gl->BindTexture(hw->gl_texture_target, p->gl_texture); CGLError err = CGLTexImageIOSurface2D( - vo_cocoa_cgl_context(vo), hw->gl_texture_target, GL_RGB, + CGLGetCurrentContext(), hw->gl_texture_target, GL_RGB, CVPixelBufferGetWidth(p->pbuf), CVPixelBufferGetHeight(p->pbuf), GL_RGB_422_APPLE, GL_UNSIGNED_SHORT_8_8_APPLE, surface, 0); -- cgit v1.2.3