summaryrefslogtreecommitdiff
path: root/sys/applemedia
diff options
context:
space:
mode:
authorNick Kallen <nickkallen@me.com>2017-02-14 13:04:01 +0100
committerEdward Hervey <bilboed@bilboed.com>2017-02-14 14:50:34 +0100
commit2f676d61a7e08076900e57b7b7ad56d5b296b66e (patch)
treeb6f00e2b14ba6ab1cfb8032a85f1e6a589a51e7c /sys/applemedia
parent487e57f1b7ffe7199718f7f4b01eb3697dd3c68e (diff)
downloadgstreamer-plugins-bad-2f676d61a7e08076900e57b7b7ad56d5b296b66e.tar.gz
Builds for MacOS
https://bugzilla.gnome.org/show_bug.cgi?id=778434
Diffstat (limited to 'sys/applemedia')
-rw-r--r--sys/applemedia/iosglmemory.c13
-rw-r--r--sys/applemedia/iosglmemory.h6
-rw-r--r--sys/applemedia/videotexturecache.m4
3 files changed, 14 insertions, 9 deletions
diff --git a/sys/applemedia/iosglmemory.c b/sys/applemedia/iosglmemory.c
index ac753670a..c19f5f31d 100644
--- a/sys/applemedia/iosglmemory.c
+++ b/sys/applemedia/iosglmemory.c
@@ -42,7 +42,7 @@ _ios_gl_memory_destroy (GstGLBaseMemory * gl_mem)
{
GstIOSGLMemory *mem = (GstIOSGLMemory *) gl_mem;
- CFRelease (mem->texture);
+ mem->gl_notify (mem->gl_data);
gst_memory_unref (GST_MEMORY_CAST (mem->cv_mem));
GST_GL_BASE_MEMORY_ALLOCATOR_CLASS
(gst_ios_gl_memory_allocator_parent_class)->destroy (gl_mem);
@@ -135,7 +135,8 @@ _ios_gl_memory_new (GstGLContext * context,
GstVideoGLTextureType tex_type,
guint tex_id,
GstVideoInfo * info,
- guint plane, GstVideoAlignment * valign, CVOpenGLESTextureRef texture)
+ guint plane,
+ GstVideoAlignment * valign, gpointer gl_data, GDestroyNotify gl_notify)
{
GstIOSGLMemory *mem;
@@ -145,7 +146,8 @@ _ios_gl_memory_new (GstGLContext * context,
gst_gl_memory_init (&mem->gl_mem, _ios_gl_memory_allocator, NULL, context,
target, tex_type, NULL, info, plane, valign, NULL, NULL);
mem->cv_mem = cv_mem;
- mem->texture = texture;
+ mem->gl_data = gl_data;
+ mem->gl_notify = gl_notify;
GST_MINI_OBJECT_FLAG_SET (mem, GST_MEMORY_FLAG_READONLY);
@@ -159,8 +161,9 @@ gst_ios_gl_memory_new_wrapped (GstGLContext * context,
GstVideoGLTextureType tex_type,
guint tex_id,
GstVideoInfo * info,
- guint plane, GstVideoAlignment * valign, CVOpenGLESTextureRef texture)
+ guint plane,
+ GstVideoAlignment * valign, gpointer gl_data, GDestroyNotify gl_notify)
{
return _ios_gl_memory_new (context, cv_mem, target, tex_type, tex_id, info,
- plane, valign, texture);
+ plane, valign, gl_data, gl_notify);
}
diff --git a/sys/applemedia/iosglmemory.h b/sys/applemedia/iosglmemory.h
index f55d4fd3d..7e457d2bb 100644
--- a/sys/applemedia/iosglmemory.h
+++ b/sys/applemedia/iosglmemory.h
@@ -43,7 +43,8 @@ typedef struct _GstIOSGLMemory
{
GstGLMemory gl_mem;
GstAppleCoreVideoMemory *cv_mem;
- CVOpenGLESTextureRef texture;
+ gpointer gl_data;
+ GDestroyNotify gl_notify;
} GstIOSGLMemory;
#define GST_IOS_GL_MEMORY_ALLOCATOR_NAME "IOSGLMemory"
@@ -59,7 +60,8 @@ gst_ios_gl_memory_new_wrapped (GstGLContext * context,
GstVideoInfo * info,
guint plane,
GstVideoAlignment *valign,
- CVOpenGLESTextureRef texture);
+ gpointer gl_data,
+ GDestroyNotify gl_notify);
gboolean gst_is_ios_gl_memory (GstMemory * mem);
diff --git a/sys/applemedia/videotexturecache.m b/sys/applemedia/videotexturecache.m
index 529a1033e..8315a3bba 100644
--- a/sys/applemedia/videotexturecache.m
+++ b/sys/applemedia/videotexturecache.m
@@ -157,7 +157,7 @@ _do_create_memory (GstGLContext * context, ContextThreadData * data)
gl_target, GST_VIDEO_GL_TEXTURE_TYPE_RGBA,
CVOpenGLESTextureGetName (texture),
&cache->input_info,
- 0, NULL, texture);
+ 0, NULL, texture, (GDestroyNotify) CFRelease);
break;
case GST_VIDEO_FORMAT_NV12: {
GstVideoGLTextureType textype;
@@ -181,7 +181,7 @@ _do_create_memory (GstGLContext * context, ContextThreadData * data)
memory = gst_apple_core_video_memory_new_wrapped (gpixbuf, plane, size);
gl_memory = gst_ios_gl_memory_new_wrapped (context, memory,
gl_target, textype, CVOpenGLESTextureGetName (texture), &cache->input_info,
- plane, NULL, texture);
+ plane, NULL, texture, (GDestroyNotify) CFRelease);
break;
}
default: