From c6056b0dd590694686b06a03fcbff06135cf30b8 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Fri, 23 Jan 2015 15:02:55 +1100 Subject: [PATCH] applemedia: update for gstgl cocoa -> cgl change --- sys/applemedia/corevideotexturecache.m | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sys/applemedia/corevideotexturecache.m b/sys/applemedia/corevideotexturecache.m index e55ca69ba2..950ae64caa 100644 --- a/sys/applemedia/corevideotexturecache.m +++ b/sys/applemedia/corevideotexturecache.m @@ -23,6 +23,7 @@ #if !HAVE_IOS #import +#include #endif #include "corevideotexturecache.h" #include "coremediabuffer.h" @@ -37,14 +38,12 @@ gst_core_video_texture_cache_new (GstGLContext * ctx) cache->ctx = gst_object_ref (ctx); #if !HAVE_IOS - CGLPixelFormatAttribute attribs[1] = { 0 }; - int numPixelFormats; - CGLPixelFormatObj pixelFormat; - CGLChoosePixelFormat (attribs, &pixelFormat, &numPixelFormats); // 5 - NSOpenGLContext *platform_ctx = - (NSOpenGLContext *) gst_gl_context_get_gl_context (ctx); - CVOpenGLTextureCacheCreate (kCFAllocatorDefault, NULL, - [platform_ctx CGLContextObj], pixelFormat, NULL, &cache->cache); + CGLPixelFormatObj pixelFormat = + gst_gl_context_cocoa_get_pixel_format (GST_GL_CONTEXT_COCOA (ctx)); + CGLContextObj platform_ctx = + (CGLContextObj) gst_gl_context_get_gl_context (ctx); + CVOpenGLTextureCacheCreate (kCFAllocatorDefault, NULL, platform_ctx, + pixelFormat, NULL, &cache->cache); #else CVOpenGLESTextureCacheCreate (kCFAllocatorDefault, NULL, (CVEAGLContext) gst_gl_context_get_gl_context (ctx), NULL, &cache->cache);