diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2012-09-16 15:48:02 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2012-09-16 15:48:02 +0200 |
commit | 1419862c50cfec0cccc93ef351d49e1388997c09 (patch) | |
tree | 5391b61b40730269da5c8aa01abd15cb394f8479 /tests | |
parent | 12b5ef6573776d56693ef252815fe784c4e55890 (diff) | |
download | gstreamer-plugins-bad-1419862c50cfec0cccc93ef351d49e1388997c09.tar.gz |
vp8: Remove plugin, moved to gst-plugins-good
Diffstat (limited to 'tests')
-rw-r--r-- | tests/check/Makefile.am | 7 | ||||
-rw-r--r-- | tests/check/elements/.gitignore | 2 | ||||
-rw-r--r-- | tests/check/elements/vp8dec.c | 178 | ||||
-rw-r--r-- | tests/check/elements/vp8enc.c | 168 |
4 files changed, 0 insertions, 355 deletions
diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am index 64b816d73..c1a87298e 100644 --- a/tests/check/Makefile.am +++ b/tests/check/Makefile.am @@ -123,12 +123,6 @@ else check_mimic= endif -if USE_VP8 -check_vp8=elements/vp8enc elements/vp8dec -else -check_vp8= -endif - if HAVE_ORC check_orc = orc/cog orc/bayer else @@ -229,7 +223,6 @@ check_PROGRAMS = \ $(check_uvch264) \ libs/vc1parser \ $(check_schro) \ - $(check_vp8) \ elements/viewfinderbin \ $(check_zbar) \ $(check_orc) \ diff --git a/tests/check/elements/.gitignore b/tests/check/elements/.gitignore index 48604ef9a..573814731 100644 --- a/tests/check/elements/.gitignore +++ b/tests/check/elements/.gitignore @@ -49,6 +49,4 @@ videorecordingbin viewfinderbin voaacenc voamrwbenc -vp8dec -vp8enc zbar diff --git a/tests/check/elements/vp8dec.c b/tests/check/elements/vp8dec.c deleted file mode 100644 index 25648401a..000000000 --- a/tests/check/elements/vp8dec.c +++ /dev/null @@ -1,178 +0,0 @@ -/* GStreamer - * - * Copyright (c) 2010 Sebastian Dröge <sebastian.droege@collabora.co.uk> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include <gst/check/gstcheck.h> - -static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", - GST_PAD_SINK, - GST_PAD_ALWAYS, - GST_STATIC_CAPS ("video/x-raw, " - "format = (string) I420, " - "width = (int) [1, MAX], " - "height = (int) [1, MAX], " "framerate = (fraction) [0, MAX]")); - -static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src", - GST_PAD_SRC, - GST_PAD_ALWAYS, - GST_STATIC_CAPS ("video/x-raw, " - "format = (string) I420, " - "width = (int) [1, MAX], " - "height = (int) [1, MAX], " "framerate = (fraction) [0, MAX]")); - -static GstPad *sinkpad, *srcpad; - -static GstElement * -setup_vp8dec (const gchar * src_caps_str) -{ - GstElement *bin; - GstElement *vp8enc, *vp8dec; - GstCaps *srccaps = NULL; - GstBus *bus; - GstPad *ghostpad, *targetpad; - - if (src_caps_str) { - srccaps = gst_caps_from_string (src_caps_str); - fail_unless (srccaps != NULL); - } - - bin = gst_bin_new ("bin"); - - vp8enc = gst_check_setup_element ("vp8enc"); - fail_unless (vp8enc != NULL); - vp8dec = gst_check_setup_element ("vp8dec"); - fail_unless (vp8dec != NULL); - - gst_bin_add_many (GST_BIN (bin), vp8enc, vp8dec, NULL); - fail_unless (gst_element_link_pads (vp8enc, "src", vp8dec, "sink")); - - targetpad = gst_element_get_static_pad (vp8enc, "sink"); - fail_unless (targetpad != NULL); - ghostpad = gst_ghost_pad_new ("sink", targetpad); - fail_unless (ghostpad != NULL); - gst_element_add_pad (bin, ghostpad); - gst_object_unref (targetpad); - - targetpad = gst_element_get_static_pad (vp8dec, "src"); - fail_unless (targetpad != NULL); - ghostpad = gst_ghost_pad_new ("src", targetpad); - fail_unless (ghostpad != NULL); - gst_element_add_pad (bin, ghostpad); - gst_object_unref (targetpad); - - srcpad = gst_check_setup_src_pad (bin, &srctemplate); - sinkpad = gst_check_setup_sink_pad (bin, &sinktemplate); - gst_pad_set_active (srcpad, TRUE); - gst_pad_set_active (sinkpad, TRUE); - fail_unless (gst_pad_set_caps (srcpad, srccaps)); - - bus = gst_bus_new (); - gst_element_set_bus (bin, bus); - - fail_unless (gst_element_set_state (bin, - GST_STATE_PLAYING) != GST_STATE_CHANGE_FAILURE, - "could not set to playing"); - - if (srccaps) - gst_caps_unref (srccaps); - - buffers = NULL; - return bin; -} - -static void -cleanup_vp8dec (GstElement * bin) -{ - GstBus *bus; - - /* Free parsed buffers */ - gst_check_drop_buffers (); - - bus = GST_ELEMENT_BUS (bin); - gst_bus_set_flushing (bus, TRUE); - gst_object_unref (bus); - - gst_pad_set_active (srcpad, FALSE); - gst_pad_set_active (sinkpad, FALSE); - - gst_check_teardown_src_pad (bin); - gst_check_teardown_sink_pad (bin); - gst_check_teardown_element (bin); -} - -GST_START_TEST (test_decode_simple) -{ - GstElement *bin; - GstBuffer *buffer; - gint i; - GList *l; - GstSegment seg; - - bin = - setup_vp8dec - ("video/x-raw,format=(string)I420,width=(int)320,height=(int)240,framerate=(fraction)25/1"); - - gst_segment_init (&seg, GST_FORMAT_TIME); - seg.stop = gst_util_uint64_scale (20, GST_SECOND, 25); - fail_unless (gst_pad_push_event (srcpad, gst_event_new_segment (&seg))); - - buffer = gst_buffer_new_and_alloc (320 * 240 + 2 * 160 * 120); - gst_buffer_memset (buffer, 0, 0, -1); - - for (i = 0; i < 20; i++) { - GST_BUFFER_TIMESTAMP (buffer) = gst_util_uint64_scale (i, GST_SECOND, 25); - GST_BUFFER_DURATION (buffer) = gst_util_uint64_scale (1, GST_SECOND, 25); - fail_unless (gst_pad_push (srcpad, gst_buffer_ref (buffer)) == GST_FLOW_OK); - } - - gst_buffer_unref (buffer); - - fail_unless (gst_pad_push_event (srcpad, gst_event_new_eos ())); - - /* All buffers must be there now */ - fail_unless_equals_int (g_list_length (buffers), 20); - - for (l = buffers, i = 0; l; l = l->next, i++) { - buffer = l->data; - - fail_unless_equals_uint64 (GST_BUFFER_TIMESTAMP (buffer), - gst_util_uint64_scale (i, GST_SECOND, 25)); - fail_unless_equals_uint64 (GST_BUFFER_DURATION (buffer), - gst_util_uint64_scale (1, GST_SECOND, 25)); - } - - cleanup_vp8dec (bin); -} - -GST_END_TEST; - -static Suite * -vp8dec_suite (void) -{ - Suite *s = suite_create ("vp8dec"); - TCase *tc_chain = tcase_create ("general"); - - suite_add_tcase (s, tc_chain); - - tcase_add_test (tc_chain, test_decode_simple); - - return s; -} - -GST_CHECK_MAIN (vp8dec); diff --git a/tests/check/elements/vp8enc.c b/tests/check/elements/vp8enc.c deleted file mode 100644 index 19be2479a..000000000 --- a/tests/check/elements/vp8enc.c +++ /dev/null @@ -1,168 +0,0 @@ -/* GStreamer - * - * Copyright (c) 2010 Sebastian Dröge <sebastian.droege@collabora.co.uk> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include <gst/check/gstcheck.h> - -static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", - GST_PAD_SINK, - GST_PAD_ALWAYS, - GST_STATIC_CAPS ("video/x-vp8, " - "width = (int) [1, MAX], " - "height = (int) [1, MAX], " "framerate = (fraction) [0, MAX]")); - -static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src", - GST_PAD_SRC, - GST_PAD_ALWAYS, - GST_STATIC_CAPS ("video/x-raw, " - "format = (string) I420, " - "width = (int) [1, MAX], " - "height = (int) [1, MAX], " "framerate = (fraction) [0, MAX]")); - -static GstPad *sinkpad, *srcpad; - -static GstElement * -setup_vp8enc (const gchar * src_caps_str) -{ - GstElement *vp8enc; - GstCaps *srccaps = NULL; - GstBus *bus; - - if (src_caps_str) { - srccaps = gst_caps_from_string (src_caps_str); - fail_unless (srccaps != NULL); - } - - vp8enc = gst_check_setup_element ("vp8enc"); - fail_unless (vp8enc != NULL); - srcpad = gst_check_setup_src_pad (vp8enc, &srctemplate); - sinkpad = gst_check_setup_sink_pad (vp8enc, &sinktemplate); - gst_pad_set_active (srcpad, TRUE); - gst_pad_set_active (sinkpad, TRUE); - fail_unless (gst_pad_set_caps (srcpad, srccaps)); - - bus = gst_bus_new (); - gst_element_set_bus (vp8enc, bus); - - fail_unless (gst_element_set_state (vp8enc, - GST_STATE_PLAYING) != GST_STATE_CHANGE_FAILURE, - "could not set to playing"); - - if (srccaps) - gst_caps_unref (srccaps); - - buffers = NULL; - return vp8enc; -} - -static void -cleanup_vp8enc (GstElement * vp8enc) -{ - GstBus *bus; - - /* Free parsed buffers */ - gst_check_drop_buffers (); - - bus = GST_ELEMENT_BUS (vp8enc); - gst_bus_set_flushing (bus, TRUE); - gst_object_unref (bus); - - gst_pad_set_active (srcpad, FALSE); - gst_pad_set_active (sinkpad, FALSE); - gst_check_teardown_src_pad (vp8enc); - gst_check_teardown_sink_pad (vp8enc); - gst_check_teardown_element (vp8enc); -} - -GST_START_TEST (test_encode_simple) -{ - GstElement *vp8enc; - GstBuffer *buffer; - gint i; - GList *l; - GstCaps *outcaps; - GstSegment seg; - - vp8enc = - setup_vp8enc - ("video/x-raw,format=(string)I420,width=(int)320,height=(int)240,framerate=(fraction)25/1"); - - g_object_set (vp8enc, "max-latency", 5, NULL); - - gst_segment_init (&seg, GST_FORMAT_TIME); - seg.stop = gst_util_uint64_scale (20, GST_SECOND, 25); - fail_unless (gst_pad_push_event (srcpad, gst_event_new_segment (&seg))); - - buffer = gst_buffer_new_and_alloc (320 * 240 + 2 * 160 * 120); - gst_buffer_memset (buffer, 0, 0, -1); - - for (i = 0; i < 20; i++) { - GST_BUFFER_TIMESTAMP (buffer) = gst_util_uint64_scale (i, GST_SECOND, 25); - GST_BUFFER_DURATION (buffer) = gst_util_uint64_scale (1, GST_SECOND, 25); - fail_unless (gst_pad_push (srcpad, gst_buffer_ref (buffer)) == GST_FLOW_OK); - } - - gst_buffer_unref (buffer); - - /* Only 5 buffers are allowed to be queued now */ - fail_unless (g_list_length (buffers) > 15); - - fail_unless (gst_pad_push_event (srcpad, gst_event_new_eos ())); - - - /* All buffers must be there now */ - fail_unless_equals_int (g_list_length (buffers), 20); - - outcaps = - gst_caps_from_string - ("video/x-vp8,width=(int)320,height=(int)240,framerate=(fraction)25/1"); - - for (l = buffers, i = 0; l; l = l->next, i++) { - buffer = l->data; - - if (i == 0) - fail_if (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_DELTA_UNIT)); - - fail_unless_equals_uint64 (GST_BUFFER_TIMESTAMP (buffer), - gst_util_uint64_scale (i, GST_SECOND, 25)); - fail_unless_equals_uint64 (GST_BUFFER_DURATION (buffer), - gst_util_uint64_scale (1, GST_SECOND, 25)); - } - - gst_caps_unref (outcaps); - - cleanup_vp8enc (vp8enc); -} - -GST_END_TEST; - -static Suite * -vp8enc_suite (void) -{ - Suite *s = suite_create ("vp8enc"); - TCase *tc_chain = tcase_create ("general"); - - suite_add_tcase (s, tc_chain); - - tcase_add_test (tc_chain, test_encode_simple); - - return s; -} - -GST_CHECK_MAIN (vp8enc); |