diff options
author | Matthew Waters <matthew@centricular.com> | 2016-06-28 13:51:22 +1000 |
---|---|---|
committer | Matthew Waters <matthew@centricular.com> | 2016-06-29 18:04:28 +1000 |
commit | 989200820d43c78fb179d7984827800d83787390 (patch) | |
tree | 4e26370accaa68b3e7b96610aed3b518c57766f9 /sys/applemedia/videotexturecache.m | |
parent | 6958b7a0147334e6d02c30f6f236fbd7e1089081 (diff) | |
download | gstreamer-plugins-bad-989200820d43c78fb179d7984827800d83787390.tar.gz |
glmemory: add the texture type to allocate to parameters
Rather than assuming something. e.g. zerocopy on iOS with GLES3 requires
the use of Luminance/Luminance Alpha formats and does not work with
Red/RG textures.
Diffstat (limited to 'sys/applemedia/videotexturecache.m')
-rw-r--r-- | sys/applemedia/videotexturecache.m | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/applemedia/videotexturecache.m b/sys/applemedia/videotexturecache.m index e1bdb64d2..13ff5884b 100644 --- a/sys/applemedia/videotexturecache.m +++ b/sys/applemedia/videotexturecache.m @@ -171,8 +171,8 @@ _do_get_gl_buffer (GstGLContext * context, ContextThreadData * data) gl_target = gst_gl_texture_target_from_gl (CVOpenGLESTextureGetTarget (texture)); params = gst_gl_video_allocation_params_new_wrapped_texture (cache->ctx, NULL, &cache->input_info, 0, NULL, gl_target, - CVOpenGLESTextureGetName (texture), texture, - (GDestroyNotify) CFRelease); + GST_VIDEO_GL_TEXTURE_TYPE_RGBA, CVOpenGLESTextureGetName (texture), + texture, (GDestroyNotify) CFRelease); gst_buffer_replace_memory (output_buffer, 0, (GstMemory *) gst_gl_base_memory_alloc (base_mem_alloc, @@ -197,7 +197,7 @@ _do_get_gl_buffer (GstGLContext * context, ContextThreadData * data) gl_target = gst_gl_texture_target_from_gl (CVOpenGLESTextureGetTarget (texture)); params = gst_gl_video_allocation_params_new_wrapped_texture (cache->ctx, - NULL, &cache->input_info, 0, NULL, gl_target, + NULL, &cache->input_info, 0, NULL, gl_target, textype, CVOpenGLESTextureGetName (texture), texture, (GDestroyNotify) CFRelease); @@ -219,7 +219,7 @@ _do_get_gl_buffer (GstGLContext * context, ContextThreadData * data) gl_target = gst_gl_texture_target_from_gl (CVOpenGLESTextureGetTarget (texture)); params = gst_gl_video_allocation_params_new_wrapped_texture (cache->ctx, - NULL, &cache->input_info, 1, NULL, gl_target, + NULL, &cache->input_info, 1, NULL, gl_target, textype, CVOpenGLESTextureGetName (texture), texture, (GDestroyNotify) CFRelease); @@ -255,11 +255,14 @@ _do_get_gl_buffer (GstGLContext * context, ContextThreadData * data) gst_buffer_copy_into (data->output_buffer, data->input_buffer, GST_BUFFER_COPY_ALL, 0, -1); for (int i = 0; i < GST_VIDEO_INFO_N_PLANES (&cache->input_info); i++) { GstIOSurfaceMemory *mem; + GstVideoGLTextureType tex_type = + gst_gl_texture_type_from_format (context, + GST_VIDEO_INFO_FORMAT (&cache->input_info), i); CFRetain (pixel_buf); mem = gst_io_surface_memory_wrapped (cache->ctx, - surface, GST_GL_TEXTURE_TARGET_RECTANGLE, &cache->input_info, - i, NULL, pixel_buf, (GDestroyNotify) CFRelease); + surface, GST_GL_TEXTURE_TARGET_RECTANGLE, tex_type, + &cache->input_info, i, NULL, pixel_buf, (GDestroyNotify) CFRelease); gst_buffer_replace_memory (data->output_buffer, i, (GstMemory *) mem); } |