summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2016-06-28 13:51:22 +1000
committerMatthew Waters <matthew@centricular.com>2016-06-29 18:04:28 +1000
commit989200820d43c78fb179d7984827800d83787390 (patch)
tree4e26370accaa68b3e7b96610aed3b518c57766f9 /tests
parent6958b7a0147334e6d02c30f6f236fbd7e1089081 (diff)
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 'tests')
-rw-r--r--tests/check/libs/gstglcolorconvert.c6
-rw-r--r--tests/check/libs/gstglcontext.c2
-rw-r--r--tests/check/libs/gstglmemory.c17
-rw-r--r--tests/check/libs/gstglupload.c3
4 files changed, 18 insertions, 10 deletions
diff --git a/tests/check/libs/gstglcolorconvert.c b/tests/check/libs/gstglcolorconvert.c
index f2be51416..d891c8bb0 100644
--- a/tests/check/libs/gstglcolorconvert.c
+++ b/tests/check/libs/gstglcolorconvert.c
@@ -141,13 +141,15 @@ check_conversion (TestFrame * frames, guint size)
/* create GL buffer */
inbuf = gst_buffer_new ();
for (j = 0; j < GST_VIDEO_INFO_N_PLANES (&in_info); j++) {
+ GstVideoGLTextureType tex_type = gst_gl_texture_type_from_format (context,
+ GST_VIDEO_INFO_FORMAT (&in_info), j);
GstGLVideoAllocationParams *params;
GstGLBaseMemory *mem;
ref_count++;
params = gst_gl_video_allocation_params_new_wrapped_data (context, NULL,
- &in_info, j, NULL, GST_GL_TEXTURE_TARGET_2D, frames[i].data[j],
- &ref_count, _frame_unref);
+ &in_info, j, NULL, GST_GL_TEXTURE_TARGET_2D, tex_type,
+ frames[i].data[j], &ref_count, _frame_unref);
mem = gst_gl_base_memory_alloc (base_mem_alloc,
(GstGLAllocationParams *) params);
diff --git a/tests/check/libs/gstglcontext.c b/tests/check/libs/gstglcontext.c
index 5db0de883..662e3a765 100644
--- a/tests/check/libs/gstglcontext.c
+++ b/tests/check/libs/gstglcontext.c
@@ -72,7 +72,7 @@ init (gpointer data)
allocator = gst_gl_memory_allocator_get_default (context);
params =
gst_gl_video_allocation_params_new (context, NULL, &v_info, 0, NULL,
- GST_GL_TEXTURE_TARGET_2D);
+ GST_GL_TEXTURE_TARGET_2D, GST_VIDEO_GL_TEXTURE_TYPE_RGBA);
/* has to be called in the thread that is going to use the framebuffer */
fbo = gst_gl_framebuffer_new (context);
diff --git a/tests/check/libs/gstglmemory.c b/tests/check/libs/gstglmemory.c
index 4130e3ba2..f8f9840cf 100644
--- a/tests/check/libs/gstglmemory.c
+++ b/tests/check/libs/gstglmemory.c
@@ -75,10 +75,12 @@ GST_START_TEST (test_basic)
gst_video_info_set_format (&v_info, formats[i], width, height);
for (j = 0; j < GST_VIDEO_INFO_N_PLANES (&v_info); j++) {
+ GstVideoGLTextureType tex_type = gst_gl_texture_type_from_format (context,
+ GST_VIDEO_INFO_FORMAT (&v_info), j);
GstGLVideoAllocationParams *params;
params = gst_gl_video_allocation_params_new (context, NULL, &v_info, j,
- NULL, GST_GL_TEXTURE_TARGET_2D);
+ NULL, GST_GL_TEXTURE_TARGET_2D, tex_type);
mem = (GstMemory *) gst_gl_base_memory_alloc (base_mem_alloc,
(GstGLAllocationParams *) params);
@@ -137,7 +139,7 @@ test_transfer_allocator (const gchar * allocator_name)
gst_video_info_set_format (&v_info, GST_VIDEO_FORMAT_RGBA, 1, 1);
params = gst_gl_video_allocation_params_new (context, NULL, &v_info, 0,
- NULL, GST_GL_TEXTURE_TARGET_2D);
+ NULL, GST_GL_TEXTURE_TARGET_2D, GST_VIDEO_GL_TEXTURE_TYPE_RGBA);
/* texture creation */
mem = (GstMemory *) gst_gl_base_memory_alloc (base_mem_alloc,
@@ -150,7 +152,8 @@ test_transfer_allocator (const gchar * allocator_name)
/* test wrapping raw data */
params = gst_gl_video_allocation_params_new_wrapped_data (context, NULL,
- &v_info, 0, NULL, GST_GL_TEXTURE_TARGET_2D, rgba_pixel, NULL, NULL);
+ &v_info, 0, NULL, GST_GL_TEXTURE_TARGET_2D,
+ GST_VIDEO_GL_TEXTURE_TYPE_RGBA, rgba_pixel, NULL, NULL);
mem2 =
(GstMemory *) gst_gl_base_memory_alloc (base_mem_alloc,
(GstGLAllocationParams *) params);
@@ -164,8 +167,9 @@ test_transfer_allocator (const gchar * allocator_name)
/* wrapped texture creation */
params = gst_gl_video_allocation_params_new_wrapped_texture (context, NULL,
- &v_info, 0, NULL, GST_GL_TEXTURE_TARGET_2D, ((GstGLMemory *) mem)->tex_id,
- NULL, NULL);
+ &v_info, 0, NULL, GST_GL_TEXTURE_TARGET_2D,
+ GST_VIDEO_GL_TEXTURE_TYPE_RGBA, ((GstGLMemory *) mem)->tex_id, NULL,
+ NULL);
mem3 =
(GstMemory *) gst_gl_base_memory_alloc (base_mem_alloc,
(GstGLAllocationParams *) params);
@@ -303,7 +307,8 @@ GST_START_TEST (test_separate_transfer)
gst_video_info_set_format (&v_info, GST_VIDEO_FORMAT_RGBA, 1, 1);
params = gst_gl_video_allocation_params_new_wrapped_data (context, NULL,
- &v_info, 0, NULL, GST_GL_TEXTURE_TARGET_2D, rgba_pixel, NULL, NULL);
+ &v_info, 0, NULL, GST_GL_TEXTURE_TARGET_2D,
+ GST_VIDEO_GL_TEXTURE_TYPE_RGBA, rgba_pixel, NULL, NULL);
mem =
(GstMemory *) gst_gl_base_memory_alloc (base_mem_alloc,
(GstGLAllocationParams *) params);
diff --git a/tests/check/libs/gstglupload.c b/tests/check/libs/gstglupload.c
index 1befd415f..4f9e4b2b7 100644
--- a/tests/check/libs/gstglupload.c
+++ b/tests/check/libs/gstglupload.c
@@ -217,7 +217,8 @@ GST_START_TEST (test_upload_buffer)
/* create GL buffer */
buffer = gst_buffer_new ();
params = gst_gl_video_allocation_params_new_wrapped_data (context, NULL,
- &in_info, 0, NULL, GST_GL_TEXTURE_TARGET_2D, rgba_data, NULL, NULL);
+ &in_info, 0, NULL, GST_GL_TEXTURE_TARGET_2D,
+ GST_VIDEO_GL_TEXTURE_TYPE_RGBA, rgba_data, NULL, NULL);
gl_mem = (GstGLMemory *) gst_gl_base_memory_alloc (base_mem_alloc,
(GstGLAllocationParams *) params);
gst_gl_allocation_params_free ((GstGLAllocationParams *) params);