summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2014-12-03 20:40:06 +0100
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2014-12-03 20:40:06 +0100
commit82afc0f343e9b5d561051ebee51d0feffbde0377 (patch)
tree496229fd78c078a953595ed2bbc673d7e4a0c2b7 /video
parent0c6d85f6c36703d5e6fe1c2696fb4376cee5b46e (diff)
downloadmpv-82afc0f343e9b5d561051ebee51d0feffbde0377.tar.bz2
mpv-82afc0f343e9b5d561051ebee51d0feffbde0377.tar.xz
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.
Diffstat (limited to 'video')
-rw-r--r--video/out/cocoa_common.h3
-rw-r--r--video/out/cocoa_common.m11
-rw-r--r--video/out/gl_hwdec_vda.c3
3 files changed, 1 insertions, 16 deletions
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 <OpenGL/CGLIOSurface.h>
#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);