videoscale: Add a unit test for checking if the negotiation works as expected
[platform/upstream/gstreamer.git] / tests / check / elements / videoscale.c
1 /* GStreamer
2  *
3  * unit test for videoscale
4  *
5  * Copyright (C) <2009,2010> Sebastian Dröge <sebastian.droege@collabora.co.uk>
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., 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
22
23 #include <gst/check/gstcheck.h>
24 #include <string.h>
25
26 static GstCaps **
27 videoscale_get_allowed_caps (void)
28 {
29   GstElement *scale = gst_element_factory_make ("videoscale", "scale");
30   GstPadTemplate *templ;
31   GstCaps *caps, **ret;
32   GstStructure *s;
33   gint i, n;
34
35   templ =
36       gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (scale),
37       "sink");
38   fail_unless (templ != NULL);
39
40   caps = gst_pad_template_get_caps (templ);
41
42   n = gst_caps_get_size (caps);
43   ret = g_new0 (GstCaps *, n + 1);
44
45   for (i = 0; i < n; i++) {
46     s = gst_caps_get_structure (caps, i);
47     ret[i] = gst_caps_new_empty ();
48     gst_caps_append_structure (ret[i], gst_structure_copy (s));
49   }
50
51   gst_object_unref (scale);
52
53   return ret;
54 }
55
56 typedef struct
57 {
58   GMainLoop *loop;
59   gboolean eos;
60 } OnMessageUserData;
61
62 static void
63 on_message_cb (GstBus * bus, GstMessage * message, gpointer user_data)
64 {
65   OnMessageUserData *d = user_data;
66
67   switch (GST_MESSAGE_TYPE (message)) {
68     case GST_MESSAGE_ERROR:
69     case GST_MESSAGE_WARNING:
70       g_assert_not_reached ();
71       break;
72     case GST_MESSAGE_EOS:
73       g_main_loop_quit (d->loop);
74       d->eos = TRUE;
75       break;
76     default:
77       break;
78   }
79 }
80
81 static void
82 on_sink_handoff (GstElement * element, GstBuffer * buffer, GstPad * pad,
83     gpointer user_data)
84 {
85   guint *n_buffers = user_data;
86
87   *n_buffers = *n_buffers + 1;
88 }
89
90 static void
91 run_test (const GstCaps * caps, gint src_width, gint src_height,
92     gint dest_width, gint dest_height, gint method,
93     GCallback src_handoff, gpointer src_handoff_user_data,
94     GCallback sink_handoff, gpointer sink_handoff_user_data)
95 {
96   GstElement *pipeline;
97   GstElement *src, *capsfilter1, *identity, *scale, *capsfilter2, *sink;
98   GstBus *bus;
99   GMainLoop *loop;
100   GstCaps *copy;
101   guint n_buffers = 0;
102   OnMessageUserData omud = { NULL, };
103
104   pipeline = gst_element_factory_make ("pipeline", "pipeline");
105   fail_unless (pipeline != NULL);
106
107   src = gst_element_factory_make ("videotestsrc", "src");
108   fail_unless (src != NULL);
109   g_object_set (G_OBJECT (src), "num-buffers", 5, NULL);
110
111   capsfilter1 = gst_element_factory_make ("capsfilter", "filter1");
112   fail_unless (capsfilter1 != NULL);
113   copy = gst_caps_copy (caps);
114   gst_caps_set_simple (copy, "width", G_TYPE_INT, src_width, "height",
115       G_TYPE_INT, src_height, "framerate", GST_TYPE_FRACTION, 30, 1, NULL);
116   g_object_set (G_OBJECT (capsfilter1), "caps", copy, NULL);
117   gst_caps_unref (copy);
118
119   identity = gst_element_factory_make ("identity", "identity");
120   fail_unless (identity != NULL);
121   if (src_handoff) {
122     g_object_set (G_OBJECT (identity), "signal-handoffs", TRUE, NULL);
123     g_signal_connect (identity, "handoff", G_CALLBACK (src_handoff),
124         src_handoff_user_data);
125   }
126
127   scale = gst_element_factory_make ("videoscale", "scale");
128   fail_unless (scale != NULL);
129   g_object_set (G_OBJECT (scale), "method", method, NULL);
130
131   capsfilter2 = gst_element_factory_make ("capsfilter", "filter2");
132   fail_unless (capsfilter2 != NULL);
133   copy = gst_caps_copy (caps);
134   gst_caps_set_simple (copy, "width", G_TYPE_INT, dest_width, "height",
135       G_TYPE_INT, dest_height, NULL);
136   g_object_set (G_OBJECT (capsfilter2), "caps", copy, NULL);
137   gst_caps_unref (copy);
138
139   sink = gst_element_factory_make ("fakesink", "sink");
140   fail_unless (sink != NULL);
141   g_object_set (G_OBJECT (sink), "signal-handoffs", TRUE, "async", FALSE, NULL);
142   g_signal_connect (sink, "handoff", G_CALLBACK (on_sink_handoff), &n_buffers);
143   if (sink_handoff) {
144     g_signal_connect (sink, "handoff", G_CALLBACK (sink_handoff),
145         sink_handoff_user_data);
146   }
147
148   gst_bin_add_many (GST_BIN (pipeline), src, capsfilter1, identity, scale,
149       capsfilter2, sink, NULL);
150   fail_unless (gst_element_link_many (src, capsfilter1, identity, scale,
151           capsfilter2, sink, NULL));
152
153   loop = g_main_loop_new (NULL, FALSE);
154
155   bus = gst_element_get_bus (pipeline);
156   fail_unless (bus != NULL);
157   gst_bus_add_signal_watch (bus);
158
159   omud.loop = loop;
160   omud.eos = FALSE;
161
162   g_signal_connect (bus, "message", (GCallback) on_message_cb, &omud);
163
164   gst_object_unref (bus);
165
166   fail_unless (gst_element_set_state (pipeline,
167           GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS);
168
169   g_main_loop_run (loop);
170
171   fail_unless (gst_element_set_state (pipeline,
172           GST_STATE_NULL) == GST_STATE_CHANGE_SUCCESS);
173
174   fail_unless (omud.eos == TRUE);
175   fail_unless (n_buffers == 5);
176
177   gst_object_unref (pipeline);
178   g_main_loop_unref (loop);
179 }
180
181 static void
182 on_sink_handoff_passthrough (GstElement * element, GstBuffer * buffer,
183     GstPad * pad, gpointer user_data)
184 {
185   GList **list = user_data;
186
187   *list = g_list_prepend (*list, gst_buffer_ref (buffer));
188 }
189
190 static void
191 on_src_handoff_passthrough (GstElement * element, GstBuffer * buffer,
192     gpointer user_data)
193 {
194   GList **list = user_data;
195
196   *list = g_list_prepend (*list, gst_buffer_ref (buffer));
197 }
198
199 GST_START_TEST (test_passthrough)
200 {
201   GList *l1, *l2, *src_buffers = NULL, *sink_buffers = NULL;
202   GstCaps **allowed_caps = NULL, **p;
203   gint method;
204   static const gint src_width = 640, src_height = 480;
205   static const gint dest_width = 640, dest_height = 480;
206
207   p = allowed_caps = videoscale_get_allowed_caps ();
208
209   while (*p) {
210     GstCaps *caps = *p;
211
212     for (method = 0; method < 3; method++) {
213       GST_DEBUG ("Running test for caps '%" GST_PTR_FORMAT "'"
214           " from %dx%u to %dx%d with method %d", caps, src_width, src_height,
215           dest_width, dest_height, method);
216       run_test (caps, src_width, src_height,
217           dest_width, dest_height, method,
218           G_CALLBACK (on_src_handoff_passthrough), &src_buffers,
219           G_CALLBACK (on_sink_handoff_passthrough), &sink_buffers);
220
221       fail_unless (src_buffers && sink_buffers);
222       fail_unless_equals_int (g_list_length (src_buffers),
223           g_list_length (sink_buffers));
224
225       for (l1 = src_buffers, l2 = sink_buffers; l1 && l2;
226           l1 = l1->next, l2 = l2->next) {
227         GstBuffer *a = l1->data;
228         GstBuffer *b = l2->data;
229
230         fail_unless_equals_int (GST_BUFFER_SIZE (a), GST_BUFFER_SIZE (b));
231         fail_unless (GST_BUFFER_DATA (a) == GST_BUFFER_DATA (b));
232
233         gst_buffer_unref (a);
234         gst_buffer_unref (b);
235       }
236       g_list_free (src_buffers);
237       src_buffers = NULL;
238       g_list_free (sink_buffers);
239       sink_buffers = NULL;
240     }
241
242     gst_caps_unref (caps);
243     p++;
244   }
245   g_free (allowed_caps);
246 }
247
248 GST_END_TEST;
249
250 #define CREATE_TEST(name,method,src_width,src_height,dest_width,dest_height) \
251 GST_START_TEST (name) \
252 { \
253   GstCaps **allowed_caps = NULL, **p; \
254   \
255   p = allowed_caps = videoscale_get_allowed_caps (); \
256   \
257   while (*p) { \
258     GstCaps *caps = *p; \
259     \
260     GST_DEBUG ("Running test for caps '%" GST_PTR_FORMAT "'" \
261         " from %dx%u to %dx%d with method %d", caps, src_width, src_height, \
262         dest_width, dest_height, method); \
263     run_test (caps, src_width, src_height, \
264         dest_width, dest_height, method, \
265         NULL, NULL, NULL, NULL); \
266     \
267     gst_caps_unref (caps); \
268     p++; \
269   } \
270   g_free (allowed_caps); \
271 } \
272 \
273 GST_END_TEST;
274
275 CREATE_TEST (test_downscale_640x480_320x240_method_0, 0, 640, 480, 320, 240);
276 CREATE_TEST (test_downscale_640x480_320x240_method_1, 1, 640, 480, 320, 240);
277 CREATE_TEST (test_downscale_640x480_320x240_method_2, 2, 640, 480, 320, 240);
278 CREATE_TEST (test_upscale_320x240_640x480_method_0, 0, 320, 240, 640, 480);
279 CREATE_TEST (test_upscale_320x240_640x480_method_1, 1, 320, 240, 640, 480);
280 CREATE_TEST (test_upscale_320x240_640x480_method_2, 2, 320, 240, 640, 480);
281 CREATE_TEST (test_downscale_640x480_1x1_method_0, 0, 640, 480, 1, 1);
282 CREATE_TEST (test_downscale_640x480_1x1_method_1, 1, 640, 480, 1, 1);
283 CREATE_TEST (test_downscale_640x480_1x1_method_2, 2, 640, 480, 1, 1);
284 CREATE_TEST (test_upscale_1x1_640x480_method_0, 0, 1, 1, 640, 480);
285 CREATE_TEST (test_upscale_1x1_640x480_method_1, 1, 1, 1, 640, 480);
286 CREATE_TEST (test_upscale_1x1_640x480_method_2, 2, 1, 1, 640, 480);
287 CREATE_TEST (test_downscale_641x481_111x30_method_0, 0, 641, 481, 111, 30);
288 CREATE_TEST (test_downscale_641x481_111x30_method_1, 1, 641, 481, 111, 30);
289 CREATE_TEST (test_downscale_641x481_111x30_method_2, 2, 641, 481, 111, 30);
290 CREATE_TEST (test_upscale_111x30_641x481_method_0, 0, 111, 30, 641, 481);
291 CREATE_TEST (test_upscale_111x30_641x481_method_1, 1, 111, 30, 641, 481);
292 CREATE_TEST (test_upscale_111x30_641x481_method_2, 2, 111, 30, 641, 481);
293 CREATE_TEST (test_downscale_641x481_30x111_method_0, 0, 641, 481, 30, 111);
294 CREATE_TEST (test_downscale_641x481_30x111_method_1, 1, 641, 481, 30, 111);
295 CREATE_TEST (test_downscale_641x481_30x111_method_2, 2, 641, 481, 30, 111);
296 CREATE_TEST (test_upscale_30x111_641x481_method_0, 0, 30, 111, 641, 481);
297 CREATE_TEST (test_upscale_30x111_641x481_method_1, 1, 30, 111, 641, 481);
298 CREATE_TEST (test_upscale_30x111_641x481_method_2, 2, 30, 111, 641, 481);
299 CREATE_TEST (test_downscale_640x480_320x1_method_0, 0, 640, 480, 320, 1);
300 CREATE_TEST (test_downscale_640x480_320x1_method_1, 1, 640, 480, 320, 1);
301 CREATE_TEST (test_downscale_640x480_320x1_method_2, 2, 640, 480, 320, 1);
302 CREATE_TEST (test_upscale_320x1_640x480_method_0, 0, 320, 1, 640, 480);
303 CREATE_TEST (test_upscale_320x1_640x480_method_1, 1, 320, 1, 640, 480);
304 CREATE_TEST (test_upscale_320x1_640x480_method_2, 2, 320, 1, 640, 480);
305 CREATE_TEST (test_downscale_640x480_1x240_method_0, 0, 640, 480, 1, 240);
306 CREATE_TEST (test_downscale_640x480_1x240_method_1, 1, 640, 480, 1, 240);
307 CREATE_TEST (test_downscale_640x480_1x240_method_2, 2, 640, 480, 1, 240);
308 CREATE_TEST (test_upscale_1x240_640x480_method_0, 0, 1, 240, 640, 480);
309 CREATE_TEST (test_upscale_1x240_640x480_method_1, 1, 1, 240, 640, 480);
310 CREATE_TEST (test_upscale_1x240_640x480_method_2, 2, 1, 240, 640, 480);
311
312 typedef struct
313 {
314   gint width, height;
315   gint par_n, par_d;
316   gboolean ok;
317   GMainLoop *loop;
318 } TestNegotiationData;
319
320 static void
321 _test_negotiation_message (GstBus * bus, GstMessage * message,
322     TestNegotiationData * data)
323 {
324   switch (GST_MESSAGE_TYPE (message)) {
325     case GST_MESSAGE_ERROR:
326     case GST_MESSAGE_WARNING:
327       g_assert_not_reached ();
328       break;
329     case GST_MESSAGE_EOS:
330       g_main_loop_quit (data->loop);
331       break;
332     default:
333       break;
334   }
335 }
336
337 static void
338 _test_negotiation_notify_caps (GObject * src, GParamSpec * pspec,
339     TestNegotiationData * data)
340 {
341   GstCaps *caps;
342   GstStructure *s;
343   gint width, height;
344   gint par_n = 0, par_d = 0;
345
346   g_object_get (src, "caps", &caps, NULL);
347   if (caps == NULL)
348     return;
349
350   s = gst_caps_get_structure (caps, 0);
351
352   fail_unless (gst_structure_get_int (s, "width", &width));
353   fail_unless (gst_structure_get_int (s, "height", &height));
354   fail_unless (gst_structure_get_fraction (s, "pixel-aspect-ratio", &par_n,
355           &par_d) || (data->par_n == 1 && data->par_d == 1));
356
357   gst_caps_unref (caps);
358
359   fail_unless_equals_int (width, data->width);
360   fail_unless_equals_int (height, data->height);
361   if (par_n != 0 || par_d != 0) {
362     fail_unless_equals_int (par_n, data->par_n);
363     fail_unless_equals_int (par_d, data->par_d);
364   }
365
366   data->ok = (width == data->width) && (height == data->height)
367       && (par_n == data->par_n) && (par_d == data->par_d);
368
369   g_main_loop_quit (data->loop);
370 }
371
372 static void
373 _test_negotiation (const gchar * src_templ, const gchar * sink_templ,
374     gint width, gint height, gint par_n, gint par_d)
375 {
376   GstElement *pipeline;
377   GstElement *src, *capsfilter1, *scale, *capsfilter2, *sink;
378   GstBus *bus;
379   GMainLoop *loop;
380   GstCaps *caps;
381   TestNegotiationData data = { 0, 0, 0, 0, FALSE, NULL };
382   GstPad *pad;
383
384   pipeline = gst_element_factory_make ("pipeline", "pipeline");
385   fail_unless (pipeline != NULL);
386
387   src = gst_element_factory_make ("videotestsrc", "src");
388   fail_unless (src != NULL);
389   g_object_set (G_OBJECT (src), "num-buffers", 1, NULL);
390
391   capsfilter1 = gst_element_factory_make ("capsfilter", "filter1");
392   fail_unless (capsfilter1 != NULL);
393   caps = gst_caps_from_string (src_templ);
394   fail_unless (caps != NULL);
395   g_object_set (G_OBJECT (capsfilter1), "caps", caps, NULL);
396   gst_caps_unref (caps);
397
398   scale = gst_element_factory_make ("videoscale", "scale");
399   fail_unless (scale != NULL);
400
401   capsfilter2 = gst_element_factory_make ("capsfilter", "filter2");
402   fail_unless (capsfilter2 != NULL);
403   caps = gst_caps_from_string (sink_templ);
404   fail_unless (caps != NULL);
405   g_object_set (G_OBJECT (capsfilter2), "caps", caps, NULL);
406   gst_caps_unref (caps);
407
408   pad = gst_element_get_static_pad (capsfilter2, "sink");
409   fail_unless (pad != NULL);
410   g_signal_connect (pad, "notify::caps",
411       G_CALLBACK (_test_negotiation_notify_caps), &data);
412   gst_object_unref (pad);
413
414   sink = gst_element_factory_make ("fakesink", "sink");
415   fail_unless (sink != NULL);
416   g_object_set (sink, "async", FALSE, NULL);
417
418   gst_bin_add_many (GST_BIN (pipeline), src, capsfilter1, scale, capsfilter2,
419       sink, NULL);
420   fail_unless (gst_element_link_many (src, capsfilter1, scale, capsfilter2,
421           sink, NULL));
422
423   loop = g_main_loop_new (NULL, FALSE);
424
425   bus = gst_element_get_bus (pipeline);
426   fail_unless (bus != NULL);
427   gst_bus_add_signal_watch (bus);
428
429   data.loop = loop;
430   data.width = width;
431   data.height = height;
432   data.par_n = par_n;
433   data.par_d = par_d;
434   data.ok = FALSE;
435
436   g_signal_connect (bus, "message", G_CALLBACK (_test_negotiation_message),
437       &data);
438
439   gst_object_unref (bus);
440
441   fail_unless (gst_element_set_state (pipeline,
442           GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS);
443
444   g_main_loop_run (loop);
445
446   fail_unless (data.ok == TRUE);
447
448   fail_unless (gst_element_set_state (pipeline,
449           GST_STATE_NULL) == GST_STATE_CHANGE_SUCCESS);
450
451   gst_object_unref (pipeline);
452   g_main_loop_unref (loop);
453 }
454
455 GST_START_TEST (test_negotiation)
456 {
457   _test_negotiation
458       ("video/x-raw-yuv,format=(fourcc)AYUV,width=720,height=576,pixel-aspect-ratio=16/15",
459       "video/x-raw-yuv,format=(fourcc)AYUV,width=768,height=576",
460       768, 576, 1, 1);
461
462   _test_negotiation
463       ("video/x-raw-yuv,format=(fourcc)AYUV,width=320,height=240",
464       "video/x-raw-yuv,format=(fourcc)AYUV,width=640,height=320",
465       640, 320, 2, 3);
466
467   _test_negotiation
468       ("video/x-raw-yuv,format=(fourcc)AYUV,width=320,height=240",
469       "video/x-raw-yuv,format=(fourcc)AYUV,width=640,height=320,pixel-aspect-ratio=[0/1, 1/1]",
470       640, 320, 2, 3);
471
472   _test_negotiation
473       ("video/x-raw-yuv,format=(fourcc)AYUV,width=1920,height=2560,pixel-aspect-ratio=1/1",
474       "video/x-raw-yuv,format=(fourcc)AYUV,width=[1, 2048],height=[1, 2048],pixel-aspect-ratio=1/1",
475       1536, 2048, 1, 1);
476
477   _test_negotiation
478       ("video/x-raw-yuv,format=(fourcc)AYUV,width=1920,height=2560,pixel-aspect-ratio=1/1",
479       "video/x-raw-yuv,format=(fourcc)AYUV,width=[1, 2048],height=[1, 2048]",
480       1920, 2048, 4, 5);
481
482   _test_negotiation
483       ("video/x-raw-yuv,format=(fourcc)AYUV,width=1920,height=2560",
484       "video/x-raw-yuv,format=(fourcc)AYUV,width=[1, 2048],height=[1, 2048]",
485       1920, 2048, 4, 5);
486
487   _test_negotiation
488       ("video/x-raw-yuv,format=(fourcc)AYUV,width=1920,height=2560",
489       "video/x-raw-yuv,format=(fourcc)AYUV,width=1200,height=[1, 2048],pixel-aspect-ratio=1/1",
490       1200, 1600, 1, 1);
491
492   /* Doesn't keep DAR but must be possible! */
493   _test_negotiation
494       ("video/x-raw-yuv,format=(fourcc)AYUV,width=320,height=240,pixel-aspect-ratio=1/1",
495       "video/x-raw-yuv,format=(fourcc)AYUV,width=200,height=200,pixel-aspect-ratio=1/2",
496       200, 200, 1, 2);
497 }
498
499 GST_END_TEST;
500
501 static Suite *
502 videoscale_suite (void)
503 {
504   Suite *s = suite_create ("videoscale");
505   TCase *tc_chain = tcase_create ("general");
506
507   suite_add_tcase (s, tc_chain);
508   tcase_set_timeout (tc_chain, 180);
509   tcase_add_test (tc_chain, test_passthrough);
510   tcase_add_test (tc_chain, test_downscale_640x480_320x240_method_0);
511   tcase_add_test (tc_chain, test_downscale_640x480_320x240_method_1);
512   tcase_add_test (tc_chain, test_downscale_640x480_320x240_method_2);
513   tcase_add_test (tc_chain, test_upscale_320x240_640x480_method_0);
514   tcase_add_test (tc_chain, test_upscale_320x240_640x480_method_1);
515   tcase_add_test (tc_chain, test_upscale_320x240_640x480_method_2);
516   tcase_add_test (tc_chain, test_downscale_640x480_1x1_method_0);
517   tcase_add_test (tc_chain, test_downscale_640x480_1x1_method_1);
518   tcase_add_test (tc_chain, test_downscale_640x480_1x1_method_2);
519   tcase_add_test (tc_chain, test_upscale_1x1_640x480_method_0);
520   tcase_add_test (tc_chain, test_upscale_1x1_640x480_method_1);
521   tcase_add_test (tc_chain, test_upscale_1x1_640x480_method_2);
522   tcase_add_test (tc_chain, test_downscale_641x481_111x30_method_0);
523   tcase_add_test (tc_chain, test_downscale_641x481_111x30_method_1);
524   tcase_add_test (tc_chain, test_downscale_641x481_111x30_method_2);
525   tcase_add_test (tc_chain, test_upscale_111x30_641x481_method_0);
526   tcase_add_test (tc_chain, test_upscale_111x30_641x481_method_1);
527   tcase_add_test (tc_chain, test_upscale_111x30_641x481_method_2);
528   tcase_add_test (tc_chain, test_downscale_641x481_30x111_method_0);
529   tcase_add_test (tc_chain, test_downscale_641x481_30x111_method_1);
530   tcase_add_test (tc_chain, test_downscale_641x481_30x111_method_2);
531   tcase_add_test (tc_chain, test_upscale_30x111_641x481_method_0);
532   tcase_add_test (tc_chain, test_upscale_30x111_641x481_method_1);
533   tcase_add_test (tc_chain, test_upscale_30x111_641x481_method_2);
534   tcase_add_test (tc_chain, test_downscale_640x480_320x1_method_0);
535   tcase_add_test (tc_chain, test_downscale_640x480_320x1_method_1);
536   tcase_add_test (tc_chain, test_downscale_640x480_320x1_method_2);
537   tcase_add_test (tc_chain, test_upscale_320x1_640x480_method_0);
538   tcase_add_test (tc_chain, test_upscale_320x1_640x480_method_1);
539   tcase_add_test (tc_chain, test_upscale_320x1_640x480_method_2);
540   tcase_add_test (tc_chain, test_downscale_640x480_1x240_method_0);
541   tcase_add_test (tc_chain, test_downscale_640x480_1x240_method_1);
542   tcase_add_test (tc_chain, test_downscale_640x480_1x240_method_2);
543   tcase_add_test (tc_chain, test_upscale_1x240_640x480_method_0);
544   tcase_add_test (tc_chain, test_upscale_1x240_640x480_method_1);
545   tcase_add_test (tc_chain, test_upscale_1x240_640x480_method_2);
546   tcase_add_test (tc_chain, test_negotiation);
547
548   return s;
549 }
550
551 GST_CHECK_MAIN (videoscale);