From 9c7aa550ed0ea0b6962c7e3c1f42d7af253ea0fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= Date: Mon, 5 May 2014 23:20:11 -0400 Subject: transmitter: Remove recvonly-filter It was pretty much useless anyway. --- tests/check/Makefile.am | 4 - tests/check/transmitter/fake-filter.c | 156 ---------------------------------- tests/check/transmitter/fake-filter.h | 66 -------------- tests/check/transmitter/multicast.c | 38 +-------- tests/check/transmitter/nice.c | 34 +------- tests/check/transmitter/rawudp.c | 45 +--------- tests/check/transmitter/shm.c | 29 +------ 7 files changed, 9 insertions(+), 363 deletions(-) delete mode 100644 tests/check/transmitter/fake-filter.c delete mode 100644 tests/check/transmitter/fake-filter.h (limited to 'tests') diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am index c911dbd5..5e6f07a1 100644 --- a/tests/check/Makefile.am +++ b/tests/check/Makefile.am @@ -101,8 +101,6 @@ transmitter_multicast_SOURCES = \ testutils.h \ transmitter/generic.c \ transmitter/generic.h \ - transmitter/fake-filter.c \ - transmitter/fake-filter.h \ transmitter/multicast.c transmitter_multicast_LDADD = $(LDADD) $(GST_BASE_LIBS) @@ -111,8 +109,6 @@ transmitter_nice_SOURCES = \ check-threadsafe.h \ transmitter/generic.c \ transmitter/generic.h \ - transmitter/fake-filter.c \ - transmitter/fake-filter.h \ transmitter/nice.c transmitter_nice_LDADD = $(LDADD) $(GST_BASE_LIBS) diff --git a/tests/check/transmitter/fake-filter.c b/tests/check/transmitter/fake-filter.c deleted file mode 100644 index 491a9455..00000000 --- a/tests/check/transmitter/fake-filter.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Farstream Voice+Video library - * - * Copyright 2008-2012 Collabora Ltd, - * Copyright 2008 Nokia Corporation - * @author: Olivier Crete - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "fake-filter.h" - -GST_DEBUG_CATEGORY (fake_filter_debug); -#define GST_CAT_DEFAULT (fake_filter_debug) - - -static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", - GST_PAD_SINK, - GST_PAD_ALWAYS, - GST_STATIC_CAPS_ANY); - -static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src", - GST_PAD_SRC, - GST_PAD_ALWAYS, - GST_STATIC_CAPS_ANY); - -static void fs_fake_filter_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec); -static void fs_fake_filter_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec); - -/* signals and args */ - -enum -{ - PROP_0, - PROP_SENDING -}; - -G_DEFINE_TYPE (FsFakeFilter, fs_fake_filter, GST_TYPE_BASE_TRANSFORM); - - -static void -fs_fake_filter_class_init (FsFakeFilterClass *klass) -{ - GObjectClass *gobject_class; - GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); - - gobject_class = (GObjectClass *) klass; - - GST_DEBUG_CATEGORY_INIT - (fake_filter_debug, "fsfakefilter", 0, "fsfakefilter"); - - gobject_class->set_property = fs_fake_filter_set_property; - gobject_class->get_property = fs_fake_filter_get_property; - - gst_element_class_add_pad_template (gstelement_class, - gst_static_pad_template_get (&srctemplate)); - gst_element_class_add_pad_template (gstelement_class, - gst_static_pad_template_get (&sinktemplate)); - - gst_element_class_set_metadata (gstelement_class, - "Fake Filter element", - "Filter", - "This element ignores the sending property", - "Olivier Crete "); - - g_object_class_install_property (gobject_class, - PROP_SENDING, - g_param_spec_boolean ("sending", - "Sending RTP?", - "If set to FALSE, it assumes that all RTP has been dropped", - FALSE, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); -} - -static void -fs_fake_filter_init (FsFakeFilter *fakefilter) -{ -} - -static void -fs_fake_filter_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - switch (prop_id) - { - case PROP_SENDING: - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} -static void -fs_fake_filter_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - switch (prop_id) - { - case PROP_SENDING: - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - - -gboolean -fs_fake_filter_plugin_init (GstPlugin *plugin) -{ - return gst_element_register (plugin, "fsfakefilter", - GST_RANK_MARGINAL, FS_TYPE_FAKE_FILTER); -} - -gboolean -fs_fake_filter_register (void) -{ - return gst_plugin_register_static ( - GST_VERSION_MAJOR, - GST_VERSION_MINOR, - "fsfakefilter", - "FakeFilter", - fs_fake_filter_plugin_init, - VERSION, - "LGPL", - "Farstream", - "Farstream", - "Farstream testing suite"); -} diff --git a/tests/check/transmitter/fake-filter.h b/tests/check/transmitter/fake-filter.h deleted file mode 100644 index deaf833d..00000000 --- a/tests/check/transmitter/fake-filter.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Farstream Voice+Video library - * - * Copyright 2008 Collabora Ltd, - * Copyright 2008 Nokia Corporation - * @author: Olivier Crete - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef __FS_FAKE_FILTER_H__ -#define __FS_FAKE_FILTER_H__ - -#include -#include - -G_BEGIN_DECLS - -/* #define's don't like whitespacey bits */ -#define FS_TYPE_FAKE_FILTER \ - (fs_fake_filter_get_type()) -#define FS_FAKE_FILTER(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), \ - FS_TYPE_FAKE_FILTER,FsFakeFilter)) -#define FS_FAKE_FILTER_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), \ - FS_TYPE_FAKE_FILTER,FsFakeFilterClass)) -#define FS_IS_FAKE_FILTER(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj),FS_TYPE_FAKE_FILTER)) -#define FS_IS_FAKE_FILTER_CLASS(obj) \ - (G_TYPE_CHECK_CLASS_TYPE((klass),FS_TYPE_FAKE_FILTER)) - -typedef struct _FsFakeFilter FsFakeFilter; -typedef struct _FsFakeFilterClass FsFakeFilterClass; -typedef struct _FsFakeFilterPrivate FsFakeFilterPrivate; - -struct _FsFakeFilter -{ - GstBaseTransform parent; -}; - -struct _FsFakeFilterClass -{ - GstBaseTransformClass parent_class; -}; - -GType fs_fake_filter_get_type (void); - -gboolean fs_fake_filter_register (void); - - -G_END_DECLS - -#endif /* __FS_FAKE_FILTER_H__ */ diff --git a/tests/check/transmitter/multicast.c b/tests/check/transmitter/multicast.c index 406bd1ea..cfd9895b 100644 --- a/tests/check/transmitter/multicast.c +++ b/tests/check/transmitter/multicast.c @@ -28,7 +28,6 @@ #include "check-threadsafe.h" #include "generic.h" -#include "fake-filter.h" #include "testutils.h" gint buffer_count[2] = {0, 0}; @@ -38,8 +37,7 @@ GstElement *pipeline = NULL; gboolean src_setup[2] = {FALSE, FALSE}; enum { - FLAG_NOT_SENDING = 1<<0, - FLAG_RECVONLY_FILTER = 1<<1 + FLAG_NOT_SENDING = 1 << 0 }; @@ -108,16 +106,6 @@ _start_pipeline (gpointer user_data) return FALSE; } - -static GstElement * -_get_recvonly_filter (FsTransmitter *trans, guint component, gpointer user_data) -{ - if (component == 1) - return NULL; - - return gst_element_factory_make ("fsfakefilter", NULL); -} - static void run_multicast_transmitter_test (gint n_parameters, GParameter *params, gint flags) @@ -133,12 +121,9 @@ run_multicast_transmitter_test (gint n_parameters, GParameter *params, buffer_count[0] = 0; buffer_count[1] = 0; - if (flags & FLAG_NOT_SENDING && flags & FLAG_RECVONLY_FILTER) + if (flags & FLAG_NOT_SENDING) buffer_count[0] = 20; - if (flags & FLAG_RECVONLY_FILTER) - fail_unless (fs_fake_filter_register ()); - loop = g_main_loop_new (NULL, FALSE); trans = fs_transmitter_new ("multicast", 2, 0, &error); @@ -153,11 +138,6 @@ run_multicast_transmitter_test (gint n_parameters, GParameter *params, g_object_get (trans, "tos", &tos, NULL); ts_fail_unless (tos == 2); - if (flags & FLAG_RECVONLY_FILTER) - ts_fail_unless (g_signal_connect (trans, "get-recvonly-filter", - G_CALLBACK (_get_recvonly_filter), NULL)); - - pipeline = setup_pipeline (trans, G_CALLBACK (_handoff_handler)); st = fs_transmitter_new_stream_transmitter (trans, NULL, n_parameters, params, @@ -262,17 +242,9 @@ GST_START_TEST (test_multicasttransmitter_run_local_candidates) } GST_END_TEST; -GST_START_TEST (test_multicasttransmitter_with_filter) -{ - run_multicast_transmitter_test (0, NULL, - FLAG_RECVONLY_FILTER); -} -GST_END_TEST; - GST_START_TEST (test_multicasttransmitter_sending_half) { - run_multicast_transmitter_test (0, NULL, - FLAG_NOT_SENDING | FLAG_RECVONLY_FILTER); + run_multicast_transmitter_test (0, NULL, FLAG_NOT_SENDING); } GST_END_TEST; @@ -306,10 +278,6 @@ multicasttransmitter_suite (void) tcase_add_test (tc_chain, test_multicasttransmitter_run_local_candidates); suite_add_tcase (s, tc_chain); - tc_chain = tcase_create ("multicast_transmitter-with-filter"); - tcase_add_test (tc_chain, test_multicasttransmitter_with_filter); - suite_add_tcase (s, tc_chain); - tc_chain = tcase_create ("multicast_transmitter_sending_half"); tcase_add_test (tc_chain, test_multicasttransmitter_sending_half); suite_add_tcase (s, tc_chain); diff --git a/tests/check/transmitter/nice.c b/tests/check/transmitter/nice.c index a0ec84fd..a085996e 100644 --- a/tests/check/transmitter/nice.c +++ b/tests/check/transmitter/nice.c @@ -30,7 +30,6 @@ #include "check-threadsafe.h" #include "generic.h" -#include "fake-filter.h" enum { @@ -38,7 +37,6 @@ enum { FLAG_IS_LOCAL = 1 << 1, FLAG_FORCE_CANDIDATES = 1 << 2, FLAG_NOT_SENDING = 1 << 3, - FLAG_RECVONLY_FILTER = 1 << 4 }; @@ -372,15 +370,6 @@ fs_nice_test_participant_class_init (FsNiceTestParticipantClass *klass) { } -static GstElement * -_get_recvonly_filter (FsTransmitter *trans, guint component, gpointer user_data) -{ - if (component == 1) - return NULL; - - return gst_element_factory_make ("fsfakefilter", NULL); -} - static void run_nice_transmitter_test (gint n_parameters, GParameter *params, gint flags) @@ -401,9 +390,6 @@ run_nice_transmitter_test (gint n_parameters, GParameter *params, is_address_local = (flags & FLAG_IS_LOCAL); force_candidates = (flags & FLAG_FORCE_CANDIDATES); - if (flags & FLAG_RECVONLY_FILTER) - ts_fail_unless (fs_fake_filter_register ()); - if (flags & FLAG_NOT_SENDING) { buffer_count[0][0] = 20; @@ -421,10 +407,6 @@ run_nice_transmitter_test (gint n_parameters, GParameter *params, } ts_fail_if (trans == NULL, "No transmitter create, yet error is still NULL"); - if (flags & FLAG_RECVONLY_FILTER) - ts_fail_unless (g_signal_connect (trans, "get-recvonly-filter", - G_CALLBACK (_get_recvonly_filter), NULL)); - trans2 = fs_transmitter_new ("nice", 2, 0, &error); if (error) { ts_fail ("Error creating transmitter: (%s:%d) %s", @@ -432,10 +414,6 @@ run_nice_transmitter_test (gint n_parameters, GParameter *params, } ts_fail_if (trans2 == NULL, "No transmitter create, yet error is still NULL"); - if (flags & FLAG_RECVONLY_FILTER) - ts_fail_unless (g_signal_connect (trans2, "get-recvonly-filter", - G_CALLBACK (_get_recvonly_filter), NULL)); - pipeline = setup_pipeline (trans, G_CALLBACK (_handoff_handler1)); pipeline2 = setup_pipeline (trans2, G_CALLBACK (_handoff_handler2)); @@ -855,15 +833,9 @@ GST_START_TEST (test_nicetransmitter_invalid_arguments) } GST_END_TEST; -GST_START_TEST (test_nicetransmitter_with_filter) -{ - run_nice_transmitter_test (0, NULL, FLAG_RECVONLY_FILTER); -} -GST_END_TEST; - GST_START_TEST (test_nicetransmitter_sending_half) { - run_nice_transmitter_test (0, NULL, FLAG_NOT_SENDING | FLAG_RECVONLY_FILTER); + run_nice_transmitter_test (0, NULL, FLAG_NOT_SENDING); } GST_END_TEST; @@ -911,10 +883,6 @@ nicetransmitter_suite (void) tcase_add_test (tc_chain, test_nicetransmitter_invalid_arguments); suite_add_tcase (s, tc_chain); - tc_chain = tcase_create ("nicetransmitter-with-filter"); - tcase_add_test (tc_chain, test_nicetransmitter_with_filter); - suite_add_tcase (s, tc_chain); - tc_chain = tcase_create ("nicetransmitter-sending-half"); tcase_add_test (tc_chain, test_nicetransmitter_sending_half); suite_add_tcase (s, tc_chain); diff --git a/tests/check/transmitter/rawudp.c b/tests/check/transmitter/rawudp.c index c35c8acd..71e38f37 100644 --- a/tests/check/transmitter/rawudp.c +++ b/tests/check/transmitter/rawudp.c @@ -58,8 +58,7 @@ enum { FLAG_HAS_STUN = 1 << 0, FLAG_IS_LOCAL = 1 << 1, FLAG_NO_SOURCE = 1 << 2, - FLAG_NOT_SENDING = 1 << 3, - FLAG_RECVONLY_FILTER = 1 << 4 + FLAG_NOT_SENDING = 1 << 3 }; #define RTP_PORT 9828 @@ -264,15 +263,6 @@ sync_error_handler (GstBus *bus, GstMessage *message, gpointer blob) } -static GstElement * -get_recvonly_filter (FsTransmitter *trans, guint component, gpointer user_data) -{ - if (component == 1) - return NULL; - - return gst_element_factory_make ("identity", NULL); -} - static void run_rawudp_transmitter_test (gint n_parameters, GParameter *params, gint flags) @@ -292,7 +282,7 @@ run_rawudp_transmitter_test (gint n_parameters, GParameter *params, has_stun = flags & FLAG_HAS_STUN; associate_on_source = !(flags & FLAG_NO_SOURCE); - if ((flags & FLAG_NOT_SENDING) && (flags & FLAG_RECVONLY_FILTER)) + if ((flags & FLAG_NOT_SENDING)) { buffer_count[0] = 20; received_known[0] = 20; @@ -312,11 +302,6 @@ run_rawudp_transmitter_test (gint n_parameters, GParameter *params, g_object_get (trans, "tos", &tos, NULL); ts_fail_unless (tos == 2); - if (flags & FLAG_RECVONLY_FILTER) - ts_fail_unless (g_signal_connect (trans, "get-recvonly-filter", - G_CALLBACK (get_recvonly_filter), NULL)); - - pipeline = setup_pipeline (trans, G_CALLBACK (_handoff_handler)); bus = gst_element_get_bus (pipeline); @@ -773,25 +758,6 @@ GST_END_TEST; #endif /* HAVE_GUPNP */ -GST_START_TEST (test_rawudptransmitter_with_filter) -{ - GParameter params[2]; - - memset (params, 0, sizeof (GParameter) * 2); - - params[0].name = "associate-on-source"; - g_value_init (¶ms[0].value, G_TYPE_BOOLEAN); - g_value_set_boolean (¶ms[0].value, TRUE); - - params[1].name = "upnp-discovery"; - g_value_init (¶ms[1].value, G_TYPE_BOOLEAN); - g_value_set_boolean (¶ms[1].value, FALSE); - - run_rawudp_transmitter_test (2, params, - FLAG_RECVONLY_FILTER); -} -GST_END_TEST; - GST_START_TEST (test_rawudptransmitter_sending_half) { GParameter params[2]; @@ -806,8 +772,7 @@ GST_START_TEST (test_rawudptransmitter_sending_half) g_value_init (¶ms[1].value, G_TYPE_BOOLEAN); g_value_set_boolean (¶ms[1].value, FALSE); - run_rawudp_transmitter_test (2, params, - FLAG_NOT_SENDING | FLAG_RECVONLY_FILTER); + run_rawudp_transmitter_test (2, params, FLAG_NOT_SENDING); } GST_END_TEST; @@ -1027,10 +992,6 @@ rawudptransmitter_suite (void) } #endif - tc_chain = tcase_create ("rawudptransmitter-with-filter"); - tcase_add_test (tc_chain, test_rawudptransmitter_with_filter); - suite_add_tcase (s, tc_chain); - tc_chain = tcase_create ("rawudptransmitter-sending-half"); tcase_add_test (tc_chain, test_rawudptransmitter_sending_half); suite_add_tcase (s, tc_chain); diff --git a/tests/check/transmitter/shm.c b/tests/check/transmitter/shm.c index 54c9ad10..e0d60ebe 100644 --- a/tests/check/transmitter/shm.c +++ b/tests/check/transmitter/shm.c @@ -52,7 +52,6 @@ guint connected_count; enum { FLAG_NO_SOURCE = 1 << 2, FLAG_NOT_SENDING = 1 << 3, - FLAG_RECVONLY_FILTER = 1 << 4, FLAG_LOCAL_CANDIDATES = 1 << 5 }; @@ -194,15 +193,6 @@ sync_error_handler (GstBus *bus, GstMessage *message, gpointer blob) } -static GstElement * -get_recvonly_filter (FsTransmitter *trans, guint component, gpointer user_data) -{ - if (component == 1) - return NULL; - - return gst_element_factory_make ("identity", NULL); -} - static void run_shm_transmitter_test (gint flags) { @@ -258,7 +248,7 @@ run_shm_transmitter_test (gint flags) associate_on_source = !(flags & FLAG_NO_SOURCE); - if ((flags & FLAG_NOT_SENDING) && (flags & FLAG_RECVONLY_FILTER)) + if (flags & FLAG_NOT_SENDING) { buffer_count[0] = 20; received_known[0] = 20; @@ -272,11 +262,6 @@ run_shm_transmitter_test (gint flags) ts_fail_if (trans == NULL, "No transmitter create, yet error is still NULL"); g_clear_error (&error); - if (flags & FLAG_RECVONLY_FILTER) - ts_fail_unless (g_signal_connect (trans, "get-recvonly-filter", - G_CALLBACK (get_recvonly_filter), NULL)); - - pipeline = setup_pipeline (trans, G_CALLBACK (_handoff_handler)); bus = gst_element_get_bus (pipeline); @@ -410,15 +395,9 @@ GST_START_TEST (test_shmtransmitter_run_basic) } GST_END_TEST; -GST_START_TEST (test_shmtransmitter_with_filter) -{ - run_shm_transmitter_test (FLAG_RECVONLY_FILTER); -} -GST_END_TEST; - GST_START_TEST (test_shmtransmitter_sending_half) { - run_shm_transmitter_test (FLAG_NOT_SENDING | FLAG_RECVONLY_FILTER); + run_shm_transmitter_test (FLAG_NOT_SENDING); } GST_END_TEST; @@ -448,10 +427,6 @@ shmtransmitter_suite (void) tcase_add_test (tc_chain, test_shmtransmitter_run_basic); suite_add_tcase (s, tc_chain); - tc_chain = tcase_create ("shmtransmitter-with-filter"); - tcase_add_test (tc_chain, test_shmtransmitter_with_filter); - suite_add_tcase (s, tc_chain); - tc_chain = tcase_create ("shmtransmitter-sending-half"); tcase_add_test (tc_chain, test_shmtransmitter_sending_half); suite_add_tcase (s, tc_chain); -- cgit v1.2.1