1 /* GStreamer
2  *
3  * unit test for state changes on all elements
4  *
5  * Copyright (C) <2012> Matthew Waters <ystreet00@gmail.com>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifdef HAVE_CONFIG_H
24 #  include "config.h"
25 #endif
26 
27 #include <gst/check/gstcheck.h>
28 
29 #include <gst/gl/gl.h>
30 
31 #include <stdio.h>
32 
33 static GstGLDisplay *display;
34 static GstGLContext *context;
35 
36 static void
setup(void)37 setup (void)
38 {
39   display = gst_gl_display_new ();
40   context = gst_gl_context_new (display);
41   gst_gl_context_create (context, 0, NULL);
42   gst_gl_memory_init_once ();
43 }
44 
45 static void
teardown(void)46 teardown (void)
47 {
48   gst_object_unref (display);
49   gst_object_unref (context);
50 }
51 
52 /* one red rgba pixel */
53 static guint8 rgba_pixel[] = {
54   0xff, 0x00, 0x00, 0xff,
55 };
56 
57 static const struct
58 {
59   GstVideoFormat format;
60   guint width;
61   guint height;
62   guint plane;
63   guint8 *data;
64   gsize size;
65 } formats[] = {
66   {
67   GST_VIDEO_FORMAT_RGBA, 1, 1, 0, rgba_pixel, 4}, {
68   GST_VIDEO_FORMAT_RGB, 1, 1, 0, rgba_pixel, 3}, {
69   GST_VIDEO_FORMAT_YUY2, 1, 1, 0, rgba_pixel, 1}, {
70 GST_VIDEO_FORMAT_I420, 1, 1, 0, rgba_pixel, 1},};
71 
GST_START_TEST(test_allocator_alloc)72 GST_START_TEST (test_allocator_alloc)
73 {
74   GstAllocator *gl_allocator;
75   GstMemory *mem;
76 
77   gl_allocator = gst_allocator_find (GST_GL_MEMORY_ALLOCATOR_NAME);
78 
79   ASSERT_WARNING (mem = gst_allocator_alloc (gl_allocator, 0, NULL));
80   fail_unless (mem == NULL);
81 
82   gst_object_unref (gl_allocator);
83 }
84 
85 GST_END_TEST;
86 
GST_START_TEST(test_allocator_pbo_alloc)87 GST_START_TEST (test_allocator_pbo_alloc)
88 {
89   GstAllocator *gl_allocator;
90   GstMemory *mem;
91 
92   gl_allocator = gst_allocator_find (GST_GL_MEMORY_PBO_ALLOCATOR_NAME);
93 
94   ASSERT_WARNING (mem = gst_allocator_alloc (gl_allocator, 0, NULL));
95   fail_unless (mem == NULL);
96 
97   gst_object_unref (gl_allocator);
98 }
99 
100 GST_END_TEST;
101 
102 static GstMemory *
create_memory(const gchar * allocator_name,GstVideoInfo * v_info,guint plane)103 create_memory (const gchar * allocator_name, GstVideoInfo * v_info, guint plane)
104 {
105   GstAllocator *gl_allocator;
106   GstGLBaseMemoryAllocator *base_mem_alloc;
107   GstGLVideoAllocationParams *params;
108   GstGLMemory *gl_mem;
109   GstMemory *mem;
110 
111   GST_DEBUG ("creating from %s texture for format %s, %ux%u plane %u",
112       allocator_name, GST_VIDEO_INFO_NAME (v_info),
113       GST_VIDEO_INFO_WIDTH (v_info), GST_VIDEO_INFO_HEIGHT (v_info), plane);
114 
115   gl_allocator = gst_allocator_find (allocator_name);
116   fail_if (gl_allocator == NULL);
117   base_mem_alloc = GST_GL_BASE_MEMORY_ALLOCATOR (gl_allocator);
118 
119   params = gst_gl_video_allocation_params_new (context, NULL, v_info, plane,
120       NULL, GST_GL_TEXTURE_TARGET_2D, GST_GL_RGBA);
121 
122   /* texture creation */
123   mem = (GstMemory *) gst_gl_base_memory_alloc (base_mem_alloc,
124       (GstGLAllocationParams *) params);
125   gl_mem = (GstGLMemory *) mem;
126   fail_unless (!GST_MEMORY_FLAG_IS_SET (mem,
127           GST_GL_BASE_MEMORY_TRANSFER_NEED_UPLOAD));
128   fail_unless (!GST_MEMORY_FLAG_IS_SET (mem,
129           GST_GL_BASE_MEMORY_TRANSFER_NEED_DOWNLOAD));
130 
131   fail_unless_equals_int (TRUE, gst_video_info_is_equal (v_info,
132           &gl_mem->info));
133   fail_unless_equals_int (plane, gl_mem->plane);
134   fail_if (gl_mem->mem.context != context);
135   fail_if (gl_mem->tex_id == 0);
136 
137   gst_gl_allocation_params_free ((GstGLAllocationParams *) params);
138   gst_object_unref (gl_allocator);
139 
140   return mem;
141 }
142 
GST_START_TEST(test_allocator_create)143 GST_START_TEST (test_allocator_create)
144 {
145   int i;
146 
147   for (i = 0; i < G_N_ELEMENTS (formats); i++) {
148     GstVideoInfo v_info;
149     GstMemory *mem;
150 
151     gst_video_info_set_format (&v_info, formats[i].format, formats[i].width,
152         formats[i].height);
153     mem = create_memory (GST_GL_MEMORY_ALLOCATOR_NAME, &v_info,
154         formats[i].plane);
155     gst_memory_unref (mem);
156     mem = create_memory (GST_GL_MEMORY_PBO_ALLOCATOR_NAME, &v_info,
157         formats[i].plane);
158     gst_memory_unref (mem);
159   }
160 }
161 
162 GST_END_TEST;
163 
GST_START_TEST(test_memory_copy)164 GST_START_TEST (test_memory_copy)
165 {
166   int i;
167 
168   for (i = 0; i < G_N_ELEMENTS (formats); i++) {
169     GstVideoInfo v_info;
170     GstMemory *mem, *mem2;
171     GstGLMemory *gl_mem, *gl_mem2;
172 
173     gst_video_info_set_format (&v_info, formats[i].format, formats[i].width,
174         formats[i].height);
175     mem = create_memory (GST_GL_MEMORY_PBO_ALLOCATOR_NAME, &v_info,
176         formats[i].plane);
177     gl_mem = (GstGLMemory *) mem;
178     mem2 = gst_memory_copy (mem, 0, -1);
179     gl_mem2 = (GstGLMemory *) mem;
180 
181     fail_unless (gl_mem->mem.context == context);
182     fail_unless_equals_int (gl_mem->tex_id, gl_mem2->tex_id);
183     fail_unless_equals_int (gl_mem->tex_target, gl_mem2->tex_target);
184     fail_unless_equals_int (gl_mem->tex_format, gl_mem2->tex_format);
185     fail_unless_equals_int (TRUE, gst_video_info_is_equal (&gl_mem2->info,
186             &gl_mem->info));
187     fail_unless_equals_int (gl_mem->plane, gl_mem2->plane);
188 
189     gst_memory_unref (mem);
190     gst_memory_unref (mem2);
191   }
192 }
193 
194 GST_END_TEST;
195 
196 static GstMemory *
wrap_raw_data(const gchar * allocator_name,GstVideoInfo * v_info,guint plane,guint8 * data)197 wrap_raw_data (const gchar * allocator_name, GstVideoInfo * v_info,
198     guint plane, guint8 * data)
199 {
200   GstAllocator *gl_allocator;
201   GstGLBaseMemoryAllocator *base_mem_alloc;
202   GstGLVideoAllocationParams *params;
203   GstMemory *mem;
204   GstGLMemory *gl_mem;
205   GstGLFormat gl_format;
206 
207   GST_DEBUG ("wrapping from %s data pointer %p for format %s, %ux%u plane %u",
208       allocator_name, data, GST_VIDEO_INFO_NAME (v_info),
209       GST_VIDEO_INFO_WIDTH (v_info), GST_VIDEO_INFO_HEIGHT (v_info), plane);
210 
211   gl_allocator = gst_allocator_find (allocator_name);
212   fail_if (gl_allocator == NULL);
213   base_mem_alloc = GST_GL_BASE_MEMORY_ALLOCATOR (gl_allocator);
214 
215   gl_format = gst_gl_format_from_video_info (context, v_info, plane);
216   params = gst_gl_video_allocation_params_new_wrapped_data (context, NULL,
217       v_info, plane, NULL, GST_GL_TEXTURE_TARGET_2D,
218       gl_format, data, NULL, NULL);
219   mem =
220       (GstMemory *) gst_gl_base_memory_alloc (base_mem_alloc,
221       (GstGLAllocationParams *) params);
222   gl_mem = (GstGLMemory *) mem;
223   fail_if (mem == NULL);
224 
225   fail_unless (GST_MEMORY_FLAG_IS_SET (mem,
226           GST_GL_BASE_MEMORY_TRANSFER_NEED_UPLOAD));
227   fail_unless (!GST_MEMORY_FLAG_IS_SET (mem,
228           GST_GL_BASE_MEMORY_TRANSFER_NEED_DOWNLOAD));
229 
230   fail_unless_equals_int (TRUE, gst_video_info_is_equal (v_info,
231           &gl_mem->info));
232   fail_unless_equals_int (gl_mem->plane, plane);
233 
234   gst_gl_allocation_params_free ((GstGLAllocationParams *) params);
235   gst_object_unref (gl_allocator);
236 
237   return mem;
238 }
239 
GST_START_TEST(test_wrap_raw)240 GST_START_TEST (test_wrap_raw)
241 {
242   int i;
243 
244   for (i = 0; i < G_N_ELEMENTS (formats); i++) {
245     GstVideoInfo v_info;
246     GstMemory *mem;
247     GstGLMemory *gl_mem;
248     GstMapInfo map_info;
249 
250     gst_video_info_set_format (&v_info, formats[i].format, formats[i].width,
251         formats[i].height);
252     mem = wrap_raw_data (GST_GL_MEMORY_PBO_ALLOCATOR_NAME, &v_info,
253         formats[i].plane, formats[i].data);
254     gl_mem = (GstGLMemory *) mem;
255 
256     fail_unless (gl_mem->mem.context == context);
257 
258     fail_unless (gst_memory_map (mem, &map_info, GST_MAP_READ));
259     fail_unless (memcmp (map_info.data, formats[i].data, formats[i].size) == 0);
260     gst_memory_unmap (mem, &map_info);
261 
262     gst_memory_unref (mem);
263   }
264 }
265 
266 GST_END_TEST;
267 
268 static GstMemory *
wrap_gl_memory(GstGLMemory * gl_mem)269 wrap_gl_memory (GstGLMemory * gl_mem)
270 {
271   GstGLBaseMemoryAllocator *base_mem_alloc;
272   GstGLVideoAllocationParams *params;
273   GstMemory *mem, *mem2;
274   GstGLMemory *gl_mem2;
275 
276   mem = (GstMemory *) gl_mem;
277   base_mem_alloc = GST_GL_BASE_MEMORY_ALLOCATOR (mem->allocator);
278 
279   GST_DEBUG ("wrapping from %s %" GST_PTR_FORMAT " for format %s, %ux%u "
280       "plane %u", mem->allocator->mem_type, gl_mem,
281       GST_VIDEO_INFO_NAME (&gl_mem->info), GST_VIDEO_INFO_WIDTH (&gl_mem->info),
282       GST_VIDEO_INFO_HEIGHT (&gl_mem->info), gl_mem->plane);
283 
284   params = gst_gl_video_allocation_params_new_wrapped_texture (context, NULL,
285       &gl_mem->info, gl_mem->plane, NULL, gl_mem->tex_target,
286       gl_mem->tex_format, gl_mem->tex_id, NULL, NULL);
287   mem2 =
288       (GstMemory *) gst_gl_base_memory_alloc (base_mem_alloc,
289       (GstGLAllocationParams *) params);
290   gl_mem2 = (GstGLMemory *) mem2;
291   fail_if (mem == NULL);
292 
293   fail_unless (!GST_MEMORY_FLAG_IS_SET (mem2,
294           GST_GL_BASE_MEMORY_TRANSFER_NEED_UPLOAD));
295   fail_unless (GST_MEMORY_FLAG_IS_SET (mem2,
296           GST_GL_BASE_MEMORY_TRANSFER_NEED_DOWNLOAD));
297 
298   fail_unless (gl_mem->mem.context == context);
299   fail_unless_equals_int (gl_mem->tex_id, gl_mem2->tex_id);
300   fail_unless_equals_int (gl_mem->tex_target, gl_mem2->tex_target);
301   fail_unless_equals_int (gl_mem->tex_format, gl_mem2->tex_format);
302   fail_unless_equals_int (TRUE, gst_video_info_is_equal (&gl_mem2->info,
303           &gl_mem->info));
304   fail_unless_equals_int (gl_mem->plane, gl_mem2->plane);
305 
306   gst_gl_allocation_params_free ((GstGLAllocationParams *) params);
307 
308   return mem2;
309 }
310 
GST_START_TEST(test_wrap_gl_memory)311 GST_START_TEST (test_wrap_gl_memory)
312 {
313   int i;
314 
315   for (i = 0; i < G_N_ELEMENTS (formats); i++) {
316     GstVideoInfo v_info;
317     GstMemory *mem, *mem2;
318     GstGLMemory *gl_mem;
319 
320     gst_video_info_set_format (&v_info, formats[i].format, formats[i].width,
321         formats[i].height);
322     mem = create_memory (GST_GL_MEMORY_PBO_ALLOCATOR_NAME, &v_info,
323         formats[i].plane);
324     gl_mem = (GstGLMemory *) mem;
325     mem2 = wrap_gl_memory (gl_mem);
326 
327     gst_memory_unref (mem);
328     gst_memory_unref (mem2);
329   }
330 }
331 
332 GST_END_TEST;
333 
GST_START_TEST(test_wrap_data_copy_into)334 GST_START_TEST (test_wrap_data_copy_into)
335 {
336   int i;
337 
338   /* FIXME: in GLES2 only supported with RGBA */
339   for (i = 0; i < 1 /*G_N_ELEMENTS (formats) */ ; i++) {
340     GstVideoInfo v_info;
341     GstMemory *mem, *mem2;
342     GstGLMemory *gl_mem, *gl_mem2;
343     GstMapInfo map_info;
344 
345     gst_video_info_set_format (&v_info, formats[i].format, formats[i].width,
346         formats[i].height);
347     /* wrap some data */
348     mem = wrap_raw_data (GST_GL_MEMORY_PBO_ALLOCATOR_NAME, &v_info,
349         formats[i].plane, formats[i].data);
350     gl_mem = (GstGLMemory *) mem;
351     mem2 = create_memory (GST_GL_MEMORY_PBO_ALLOCATOR_NAME, &v_info,
352         formats[i].plane);
353     gl_mem2 = (GstGLMemory *) mem2;
354 
355     fail_unless (gst_memory_map (mem, &map_info, GST_MAP_READ | GST_MAP_GL));
356 
357     /* copy wrapped data into another texture */
358     fail_unless (gst_gl_memory_copy_into (gl_mem,
359             gl_mem2->tex_id, GST_GL_TEXTURE_TARGET_2D, gl_mem2->tex_format,
360             formats[i].width, formats[i].height));
361     GST_MINI_OBJECT_FLAG_SET (mem2, GST_GL_BASE_MEMORY_TRANSFER_NEED_DOWNLOAD);
362 
363     fail_unless (!GST_MEMORY_FLAG_IS_SET (mem,
364             GST_GL_BASE_MEMORY_TRANSFER_NEED_UPLOAD));
365     fail_unless (!GST_MEMORY_FLAG_IS_SET (mem,
366             GST_GL_BASE_MEMORY_TRANSFER_NEED_DOWNLOAD));
367     fail_unless (!GST_MEMORY_FLAG_IS_SET (mem2,
368             GST_GL_BASE_MEMORY_TRANSFER_NEED_UPLOAD));
369     fail_unless (GST_MEMORY_FLAG_IS_SET (mem2,
370             GST_GL_BASE_MEMORY_TRANSFER_NEED_DOWNLOAD));
371 
372     gst_memory_unmap (mem, &map_info);
373 
374     /* check copied texture is the same as the wrapped data */
375     fail_unless (gst_memory_map (mem2, &map_info, GST_MAP_READ));
376     fail_unless (memcmp (map_info.data, formats[i].data, formats[i].size) == 0);
377     gst_memory_unmap (mem2, &map_info);
378 
379     gst_memory_unref (mem);
380     gst_memory_unref (mem2);
381   }
382 }
383 
384 GST_END_TEST;
385 
GST_START_TEST(test_transfer_state)386 GST_START_TEST (test_transfer_state)
387 {
388   GstVideoInfo v_info;
389   GstMapInfo map_info;
390   GstMemory *mem;
391 
392   gst_video_info_set_format (&v_info, GST_VIDEO_FORMAT_RGBA, 1, 1);
393   mem = create_memory (GST_GL_MEMORY_PBO_ALLOCATOR_NAME, &v_info, 0);
394 
395   /* initial state is no transfer needed */
396   fail_unless (!GST_MEMORY_FLAG_IS_SET (mem,
397           GST_GL_BASE_MEMORY_TRANSFER_NEED_UPLOAD));
398   fail_unless (!GST_MEMORY_FLAG_IS_SET (mem,
399           GST_GL_BASE_MEMORY_TRANSFER_NEED_DOWNLOAD));
400 
401   GST_DEBUG ("read-only map");
402   gst_memory_map (mem, &map_info, GST_MAP_READ);
403   gst_memory_unmap (mem, &map_info);
404   /* read map does not change transfer state */
405   fail_unless (!GST_MEMORY_FLAG_IS_SET (mem,
406           GST_GL_BASE_MEMORY_TRANSFER_NEED_UPLOAD));
407   fail_unless (!GST_MEMORY_FLAG_IS_SET (mem,
408           GST_GL_BASE_MEMORY_TRANSFER_NEED_DOWNLOAD));
409 
410   GST_DEBUG ("read/GL-only map");
411   gst_memory_map (mem, &map_info, GST_MAP_READ | GST_MAP_GL);
412   gst_memory_unmap (mem, &map_info);
413   /* read | GL map does not change transfer state */
414   fail_unless (!GST_MEMORY_FLAG_IS_SET (mem,
415           GST_GL_BASE_MEMORY_TRANSFER_NEED_UPLOAD));
416   fail_unless (!GST_MEMORY_FLAG_IS_SET (mem,
417           GST_GL_BASE_MEMORY_TRANSFER_NEED_DOWNLOAD));
418 
419   GST_DEBUG ("write-only map");
420   gst_memory_map (mem, &map_info, GST_MAP_WRITE);
421   gst_memory_unmap (mem, &map_info);
422   /* write map causes need-upload */
423   fail_unless (GST_MEMORY_FLAG_IS_SET (mem,
424           GST_GL_BASE_MEMORY_TRANSFER_NEED_UPLOAD));
425   fail_unless (!GST_MEMORY_FLAG_IS_SET (mem,
426           GST_GL_BASE_MEMORY_TRANSFER_NEED_DOWNLOAD));
427 
428   GST_DEBUG ("write/GL-only map");
429   gst_memory_map (mem, &map_info, GST_MAP_WRITE | GST_MAP_GL);
430   gst_memory_unmap (mem, &map_info);
431   /* write | GL map from need-upload causes only need-download */
432   fail_unless (!GST_MEMORY_FLAG_IS_SET (mem,
433           GST_GL_BASE_MEMORY_TRANSFER_NEED_UPLOAD));
434   fail_unless (GST_MEMORY_FLAG_IS_SET (mem,
435           GST_GL_BASE_MEMORY_TRANSFER_NEED_DOWNLOAD));
436 
437   gst_memory_unref (mem);
438 }
439 
440 GST_END_TEST;
441 
GST_START_TEST(test_separate_upload_transfer)442 GST_START_TEST (test_separate_upload_transfer)
443 {
444   GstVideoInfo v_info;
445   GstMemory *mem;
446   GstMapInfo info;
447 
448   gst_video_info_set_format (&v_info, GST_VIDEO_FORMAT_RGBA, 1, 1);
449   mem =
450       wrap_raw_data (GST_GL_MEMORY_PBO_ALLOCATOR_NAME, &v_info, 0, rgba_pixel);
451   gst_gl_memory_pbo_upload_transfer ((GstGLMemoryPBO *) mem);
452 
453   fail_unless (!GST_MEMORY_FLAG_IS_SET (mem,
454           GST_GL_BASE_MEMORY_TRANSFER_NEED_DOWNLOAD));
455 
456   /* complete the upload */
457   fail_unless (gst_memory_map (mem, &info, GST_MAP_READ | GST_MAP_GL));
458   gst_memory_unmap (mem, &info);
459 
460   /* force a download */
461   fail_unless (gst_memory_map (mem, &info, GST_MAP_WRITE | GST_MAP_GL));
462   gst_memory_unmap (mem, &info);
463 
464   /* check the downloaded data is the same */
465   fail_unless (gst_memory_map (mem, &info, GST_MAP_READ));
466   fail_unless (memcmp (info.data, rgba_pixel, G_N_ELEMENTS (rgba_pixel)) == 0,
467       "0x%02x%02x%02x%02x != 0x%02x%02x%02x%02x", (guint8) info.data[0],
468       (guint8) info.data[1], (guint8) info.data[2],
469       (guint8) info.data[3], (guint8) rgba_pixel[0], (guint8) rgba_pixel[1],
470       (guint8) rgba_pixel[2], (guint8) rgba_pixel[3]);
471   gst_memory_unmap (mem, &info);
472 
473   gst_memory_unref (mem);
474 }
475 
476 GST_END_TEST;
477 
GST_START_TEST(test_separate_download_transfer)478 GST_START_TEST (test_separate_download_transfer)
479 {
480   GstVideoInfo v_info;
481   GstMemory *mem;
482   GstMapInfo info;
483 
484   gst_video_info_set_format (&v_info, GST_VIDEO_FORMAT_RGBA, 1, 1);
485   mem =
486       wrap_raw_data (GST_GL_MEMORY_PBO_ALLOCATOR_NAME, &v_info, 0, rgba_pixel);
487 
488   /* complete the upload */
489   fail_unless (gst_memory_map (mem, &info, GST_MAP_READ | GST_MAP_GL));
490   gst_memory_unmap (mem, &info);
491 
492   /* force a download */
493   fail_unless (gst_memory_map (mem, &info, GST_MAP_WRITE | GST_MAP_GL));
494   gst_memory_unmap (mem, &info);
495 
496   gst_gl_memory_pbo_download_transfer ((GstGLMemoryPBO *) mem);
497 
498   /* check the downloaded data is the same */
499   fail_unless (gst_memory_map (mem, &info, GST_MAP_READ));
500   fail_unless (memcmp (info.data, rgba_pixel, G_N_ELEMENTS (rgba_pixel)) == 0,
501       "0x%02x%02x%02x%02x != 0x%02x%02x%02x%02x", (guint8) info.data[0],
502       (guint8) info.data[1], (guint8) info.data[2],
503       (guint8) info.data[3], (guint8) rgba_pixel[0], (guint8) rgba_pixel[1],
504       (guint8) rgba_pixel[2], (guint8) rgba_pixel[3]);
505   gst_memory_unmap (mem, &info);
506 
507   gst_memory_unref (mem);
508 }
509 
510 GST_END_TEST;
511 
512 static Suite *
gst_gl_memory_suite(void)513 gst_gl_memory_suite (void)
514 {
515   Suite *s = suite_create ("GstGLMemory");
516   TCase *tc_chain = tcase_create ("general");
517 
518   suite_add_tcase (s, tc_chain);
519   tcase_add_checked_fixture (tc_chain, setup, teardown);
520   tcase_add_test (tc_chain, test_allocator_alloc);
521   tcase_add_test (tc_chain, test_allocator_pbo_alloc);
522   tcase_add_test (tc_chain, test_allocator_create);
523   tcase_add_test (tc_chain, test_memory_copy);
524   tcase_add_test (tc_chain, test_wrap_raw);
525   tcase_add_test (tc_chain, test_wrap_gl_memory);
526   tcase_add_test (tc_chain, test_wrap_data_copy_into);
527   tcase_add_test (tc_chain, test_transfer_state);
528   tcase_add_test (tc_chain, test_separate_upload_transfer);
529   tcase_add_test (tc_chain, test_separate_download_transfer);
530 
531   return s;
532 }
533 
534 GST_CHECK_MAIN (gst_gl_memory);
535