mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
gl/tests: update for glmemory api changes
This commit is contained in:
parent
c256f0285b
commit
25e3e1eb7b
3 changed files with 19 additions and 12 deletions
|
@ -142,8 +142,9 @@ check_conversion (TestFrame * frames, guint size)
|
||||||
/* create GL buffer */
|
/* create GL buffer */
|
||||||
ref_count += GST_VIDEO_INFO_N_PLANES (&in_info);
|
ref_count += GST_VIDEO_INFO_N_PLANES (&in_info);
|
||||||
inbuf = gst_buffer_new ();
|
inbuf = gst_buffer_new ();
|
||||||
fail_unless (gst_gl_memory_setup_wrapped (context, &in_info, NULL,
|
fail_unless (gst_gl_memory_setup_wrapped (context, GST_GL_TEXTURE_TARGET_2D,
|
||||||
(gpointer *) in_data, in_mem, &ref_count, _frame_unref));
|
&in_info, NULL, (gpointer *) in_data, in_mem, &ref_count,
|
||||||
|
_frame_unref));
|
||||||
|
|
||||||
for (j = 0; j < GST_VIDEO_INFO_N_PLANES (&in_info); j++) {
|
for (j = 0; j < GST_VIDEO_INFO_N_PLANES (&in_info); j++) {
|
||||||
gst_buffer_append_memory (inbuf, (GstMemory *) in_mem[j]);
|
gst_buffer_append_memory (inbuf, (GstMemory *) in_mem[j]);
|
||||||
|
|
|
@ -73,7 +73,9 @@ GST_START_TEST (test_basic)
|
||||||
gst_video_info_set_format (&v_info, formats[i], width, height);
|
gst_video_info_set_format (&v_info, formats[i], width, height);
|
||||||
|
|
||||||
for (j = 0; j < GST_VIDEO_INFO_N_PLANES (&v_info); j++) {
|
for (j = 0; j < GST_VIDEO_INFO_N_PLANES (&v_info); j++) {
|
||||||
mem = gst_gl_memory_alloc (context, NULL, &v_info, j, NULL);
|
mem =
|
||||||
|
gst_gl_memory_alloc (context, GST_GL_TEXTURE_TARGET_2D, NULL, &v_info,
|
||||||
|
j, NULL);
|
||||||
fail_if (mem == NULL);
|
fail_if (mem == NULL);
|
||||||
gl_mem = (GstGLMemory *) mem;
|
gl_mem = (GstGLMemory *) mem;
|
||||||
|
|
||||||
|
@ -124,7 +126,9 @@ GST_START_TEST (test_transfer)
|
||||||
gst_video_info_set_format (&v_info, GST_VIDEO_FORMAT_RGBA, 1, 1);
|
gst_video_info_set_format (&v_info, GST_VIDEO_FORMAT_RGBA, 1, 1);
|
||||||
|
|
||||||
/* texture creation */
|
/* texture creation */
|
||||||
mem = (GstMemory *) gst_gl_memory_alloc (context, NULL, &v_info, 0, NULL);
|
mem =
|
||||||
|
(GstMemory *) gst_gl_memory_alloc (context, GST_GL_TEXTURE_TARGET_2D,
|
||||||
|
NULL, &v_info, 0, NULL);
|
||||||
fail_unless (!GST_MEMORY_FLAG_IS_SET (mem,
|
fail_unless (!GST_MEMORY_FLAG_IS_SET (mem,
|
||||||
GST_GL_BASE_BUFFER_FLAG_NEED_UPLOAD));
|
GST_GL_BASE_BUFFER_FLAG_NEED_UPLOAD));
|
||||||
fail_unless (!GST_MEMORY_FLAG_IS_SET (mem,
|
fail_unless (!GST_MEMORY_FLAG_IS_SET (mem,
|
||||||
|
@ -132,8 +136,8 @@ GST_START_TEST (test_transfer)
|
||||||
|
|
||||||
/* test wrapping raw data */
|
/* test wrapping raw data */
|
||||||
mem2 =
|
mem2 =
|
||||||
(GstMemory *) gst_gl_memory_wrapped (context, &v_info, 0, NULL,
|
(GstMemory *) gst_gl_memory_wrapped (context, GST_GL_TEXTURE_TARGET_2D,
|
||||||
rgba_pixel, NULL, NULL);
|
&v_info, 0, NULL, rgba_pixel, NULL, NULL);
|
||||||
fail_if (mem == NULL);
|
fail_if (mem == NULL);
|
||||||
|
|
||||||
fail_unless (GST_MEMORY_FLAG_IS_SET (mem2,
|
fail_unless (GST_MEMORY_FLAG_IS_SET (mem2,
|
||||||
|
@ -179,8 +183,8 @@ GST_START_TEST (test_transfer)
|
||||||
|
|
||||||
/* test texture copy */
|
/* test texture copy */
|
||||||
fail_unless (gst_gl_memory_copy_into_texture ((GstGLMemory *) mem2,
|
fail_unless (gst_gl_memory_copy_into_texture ((GstGLMemory *) mem2,
|
||||||
((GstGLMemory *) mem)->tex_id, GST_VIDEO_GL_TEXTURE_TYPE_RGBA, 1, 1,
|
((GstGLMemory *) mem)->tex_id, GST_GL_TEXTURE_TARGET_2D,
|
||||||
4, FALSE));
|
GST_VIDEO_GL_TEXTURE_TYPE_RGBA, 1, 1, 4, FALSE));
|
||||||
GST_MINI_OBJECT_FLAG_SET (mem, GST_GL_BASE_BUFFER_FLAG_NEED_DOWNLOAD);
|
GST_MINI_OBJECT_FLAG_SET (mem, GST_GL_BASE_BUFFER_FLAG_NEED_DOWNLOAD);
|
||||||
GST_GL_MEMORY_ADD_TRANSFER (mem, GST_GL_MEMORY_TRANSFER_NEED_DOWNLOAD);
|
GST_GL_MEMORY_ADD_TRANSFER (mem, GST_GL_MEMORY_TRANSFER_NEED_DOWNLOAD);
|
||||||
|
|
||||||
|
@ -263,8 +267,8 @@ GST_START_TEST (test_separate_transfer)
|
||||||
gst_video_info_set_format (&v_info, GST_VIDEO_FORMAT_RGBA, 1, 1);
|
gst_video_info_set_format (&v_info, GST_VIDEO_FORMAT_RGBA, 1, 1);
|
||||||
|
|
||||||
mem =
|
mem =
|
||||||
(GstMemory *) gst_gl_memory_wrapped (context, &v_info, 0, NULL,
|
(GstMemory *) gst_gl_memory_wrapped (context, GST_GL_TEXTURE_TARGET_2D,
|
||||||
rgba_pixel, NULL, NULL);
|
&v_info, 0, NULL, rgba_pixel, NULL, NULL);
|
||||||
fail_if (mem == NULL);
|
fail_if (mem == NULL);
|
||||||
fail_unless (!GST_MEMORY_FLAG_IS_SET (mem,
|
fail_unless (!GST_MEMORY_FLAG_IS_SET (mem,
|
||||||
GST_GL_BASE_BUFFER_FLAG_NEED_DOWNLOAD));
|
GST_GL_BASE_BUFFER_FLAG_NEED_DOWNLOAD));
|
||||||
|
|
|
@ -207,7 +207,8 @@ GST_START_TEST (test_upload_buffer)
|
||||||
/* create GL buffer */
|
/* create GL buffer */
|
||||||
buffer = gst_buffer_new ();
|
buffer = gst_buffer_new ();
|
||||||
gl_mem =
|
gl_mem =
|
||||||
gst_gl_memory_wrapped (context, &in_info, 0, NULL, rgba_data, NULL, NULL);
|
gst_gl_memory_wrapped (context, GST_GL_TEXTURE_TARGET_2D, &in_info, 0,
|
||||||
|
NULL, rgba_data, NULL, NULL);
|
||||||
|
|
||||||
res =
|
res =
|
||||||
gst_memory_map ((GstMemory *) gl_mem, &map_info,
|
gst_memory_map ((GstMemory *) gl_mem, &map_info,
|
||||||
|
@ -260,7 +261,8 @@ GST_START_TEST (test_upload_meta_producer)
|
||||||
/* create GL buffer */
|
/* create GL buffer */
|
||||||
buffer = gst_buffer_new ();
|
buffer = gst_buffer_new ();
|
||||||
gl_mem =
|
gl_mem =
|
||||||
gst_gl_memory_wrapped (context, &in_info, 0, NULL, rgba_data, NULL, NULL);
|
gst_gl_memory_wrapped (context, GST_GL_TEXTURE_TARGET_2D, &in_info, 0,
|
||||||
|
NULL, rgba_data, NULL, NULL);
|
||||||
gst_buffer_append_memory (buffer, (GstMemory *) gl_mem);
|
gst_buffer_append_memory (buffer, (GstMemory *) gl_mem);
|
||||||
|
|
||||||
gst_gl_context_gen_texture (context, &tex_ids[0], GST_VIDEO_FORMAT_RGBA,
|
gst_gl_context_gen_texture (context, &tex_ids[0], GST_VIDEO_FORMAT_RGBA,
|
||||||
|
|
Loading…
Reference in a new issue