From 48d66c2c1ff59e5323fa37b3490f304496705db7 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 13 Mar 2008 16:46:04 +0000 Subject: gst/selector/gstinputselector.*: Various cleanups. Original commit message from CVS: * gst/selector/gstinputselector.c: (gst_selector_pad_class_init), (gst_selector_pad_finalize), (gst_selector_pad_get_property), (gst_selector_pad_event), (gst_input_selector_class_init), (gst_input_selector_init), (gst_input_selector_set_active_pad), (gst_input_selector_set_property), (gst_input_selector_get_property), (gst_input_selector_request_new_pad), (gst_input_selector_release_pad), (gst_input_selector_push_pending_stop), (gst_input_selector_switch): * gst/selector/gstinputselector.h: Various cleanups. Added tags to the pads. Select active pad based on the pad object instead of its name. Fix refcount in set_active_pad. Add property to get the number of pads. * gst/selector/gstoutputselector.c: (gst_output_selector_class_init), (gst_output_selector_set_property), (gst_output_selector_get_property): Various cleanups. Select the active pad based on the pad object instead of its name. Fix locking when setting the active pad. * gst/selector/gstselector-marshal.list: * tests/check/elements/selector.c: (cleanup_pad), (selector_set_active_pad), (run_input_selector_buffer_count): Fixes for pad instead of padname for pad selection. --- tests/check/elements/selector.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/check/elements/selector.c b/tests/check/elements/selector.c index c4f6ca8d..e308ac48 100644 --- a/tests/check/elements/selector.c +++ b/tests/check/elements/selector.c @@ -129,8 +129,8 @@ cleanup_pad (GstPad * pad, GstElement * element) gst_object_unref (pad); /* cleanup selector pad, reffed by this function (_get_peer) and creator */ - gst_object_unref (selpad); gst_element_release_request_pad (element, selpad); + gst_object_unref (selpad); } /* Duplicate and push given buffer many times to all input_pads */ @@ -190,7 +190,7 @@ selector_set_active_pad (GstElement * elem, GstPad * selpad) padname = gst_pad_get_name (selpad); } - g_object_set (G_OBJECT (elem), "active-pad", padname, NULL); + g_object_set (G_OBJECT (elem), "active-pad", selpad, NULL); GST_DEBUG_OBJECT (elem, "activated selector pad: %s", padname); if (selpad) { g_free (padname); @@ -333,6 +333,7 @@ run_input_selector_buffer_count (gint num_input_pads, gst_pad_remove_data_probe (output_pad, probe_id); gst_pad_set_active (output_pad, FALSE); gst_check_teardown_sink_pad (sel); + GST_DEBUG ("setting selector pad to NULL"); selector_set_active_pad (sel, NULL); // unref input-selector active pad g_list_foreach (input_pads, (GFunc) cleanup_pad, sel); g_list_free (input_pads); -- cgit v1.2.1