2008-05-21 Wim Taymans <wim.taymans@collabora.co.uk>
+ * tests/check/elements/avimux.c: (setup_src_pad),
+ (teardown_src_pad):
+ * tests/check/elements/icydemux.c: (icydemux_found_pad),
+ (GST_START_TEST):
+ * tests/check/elements/matroskamux.c: (setup_src_pad),
+ (teardown_src_pad), (setup_sink_pad), (teardown_sink_pad):
+ * tests/check/elements/videocrop.c: (video_crop_get_test_caps),
+ (GST_START_TEST):
+ * tests/check/elements/wavpackparse.c: (wavpackparse_found_pad),
+ (setup_wavpackparse), (cleanup_wavpackparse):
+ Don't use gst_element_get_pad(), it's a bad, bad method.
+
+2008-05-21 Wim Taymans <wim.taymans@collabora.co.uk>
+
* ext/gconf/gstgconfaudiosrc.c: (gst_gconf_audio_src_reset),
(do_toggle_element):
* ext/gconf/gstgconfvideosink.c: (gst_gconf_video_sink_reset),
fail_if (srcpad == NULL, "Could not create a srcpad");
ASSERT_OBJECT_REFCOUNT (srcpad, "srcpad", 1);
- sinkpad = gst_element_get_pad (element, sinkname);
+ if (!(sinkpad = gst_element_get_static_pad (element, sinkname)))
+ sinkpad = gst_element_get_request_pad (element, sinkname);
fail_if (sinkpad == NULL, "Could not get sink pad from %s",
GST_ELEMENT_NAME (element));
/* references are owned by: 1) us, 2) avimux, 3) collect pads */
/* hm, avimux uses _00 as suffixes for padnames */
padname = g_strdup (sinkname);
memcpy (strchr (padname, '%'), "00", 2);
- sinkpad = gst_element_get_pad (element, padname);
+ if (!(sinkpad = gst_element_get_static_pad (element, padname)))
+ sinkpad = gst_element_get_request_pad (element, padname);
g_free (padname);
/* pad refs held by 1) avimux 2) collectpads and 3) us (through _get) */
ASSERT_OBJECT_REFCOUNT (sinkpad, "sinkpad", 3);
/* sinkpad = gst_check_setup_sink_pad (icydemux, &sinktemplate, NULL); */
sinkpad = gst_pad_new_from_static_template (&sinktemplate, "sink");
fail_if (sinkpad == NULL, "Couldn't create sinkpad");
- srcpad = gst_element_get_pad (icydemux, "src");
+ srcpad = gst_element_get_static_pad (icydemux, "src");
fail_if (srcpad == NULL, "Failed to get srcpad from icydemux");
gst_pad_set_chain_function (sinkpad, gst_check_chain_func);
fail_unless (gst_pad_link (srcpad, sinkpad) == GST_PAD_LINK_OK,
push_data (buf1, G_N_ELEMENTS (buf1), icy_caps, 0);
/* one byte isn't really enough for typefinding, can't have a srcpad yet */
- fail_unless (gst_element_get_pad (icydemux, "src") == NULL);
+ fail_unless (gst_element_get_static_pad (icydemux, "src") == NULL);
push_data (buf2, G_N_ELEMENTS (buf2), icy_caps, -1);
/* should have been enough to create a audio/x-musepack source pad .. */
- icy_srcpad = gst_element_get_pad (icydemux, "src");
+ icy_srcpad = gst_element_get_static_pad (icydemux, "src");
fail_unless (icy_srcpad != NULL);
gst_object_unref (icy_srcpad);
ASSERT_OBJECT_REFCOUNT (srcpad, "srcpad", 1);
gst_pad_set_active (srcpad, TRUE);
- sinkpad = gst_element_get_pad (element, "audio_%d");
+ if (!(sinkpad = gst_element_get_static_pad (element, "audio_%d")))
+ sinkpad = gst_element_get_request_pad (element, "audio_%d");
fail_if (sinkpad == NULL, "Could not get sink pad from %s",
GST_ELEMENT_NAME (element));
/* references are owned by: 1) us, 2) matroskamux, 3) collect pads */
GstPad *srcpad, *sinkpad;
/* clean up floating src pad */
- sinkpad = gst_element_get_pad (element, "audio_0");
+ if (!(sinkpad = gst_element_get_static_pad (element, "audio_0")))
+ sinkpad = gst_element_get_request_pad (element, "audio_0");
ASSERT_OBJECT_REFCOUNT (sinkpad, "sinkpad", 2);
srcpad = gst_pad_get_peer (sinkpad);
fail_if (sinkpad == NULL, "Could not create a sinkpad");
gst_pad_set_active (sinkpad, TRUE);
- srcpad = gst_element_get_pad (element, "src");
+ srcpad = gst_element_get_static_pad (element, "src");
fail_if (srcpad == NULL, "Could not get source pad from %s",
GST_ELEMENT_NAME (element));
if (caps)
GstPad *srcpad, *sinkpad;
/* clean up floating sink pad */
- srcpad = gst_element_get_pad (element, "src");
+ srcpad = gst_element_get_static_pad (element, "src");
sinkpad = gst_pad_get_peer (srcpad);
gst_pad_unlink (srcpad, sinkpad);
GList *list = NULL;
guint i;
- srcpad = gst_element_get_pad (videocrop, "src");
+ srcpad = gst_element_get_static_pad (videocrop, "src");
fail_unless (srcpad != NULL);
allowed_caps = gst_pad_get_pad_template_caps (srcpad);
fail_unless (allowed_caps != NULL);
g_object_set (ctx.src, "num-buffers", 1, NULL);
- srcpad = gst_element_get_pad (ctx.src, "src");
+ srcpad = gst_element_get_static_pad (ctx.src, "src");
fail_unless (srcpad != NULL);
gst_pad_add_buffer_probe (srcpad, G_CALLBACK (buffer_probe_cb), &gen_buf);
gst_object_unref (srcpad);
mysinkpad = gst_pad_new_from_static_template (&sinktemplate, "sink");
fail_if (mysinkpad == NULL, "Couldn't create sinkpad");
- srcpad = gst_element_get_pad (wavpackparse, "src");
+ srcpad = gst_element_get_static_pad (wavpackparse, "src");
fail_if (srcpad == NULL, "Failed to get srcpad from wavpackparse");
gst_pad_set_chain_function (mysinkpad, gst_check_chain_func);
fail_unless (gst_pad_link (srcpad, mysinkpad) == GST_PAD_LINK_OK,
mysrcpad = gst_pad_new_from_static_template (&srctemplate, "src");
fail_if (mysrcpad == NULL, "Could not create srcpad");
- sinkpad = gst_element_get_pad (wavpackparse, "sink");
+ sinkpad = gst_element_get_static_pad (wavpackparse, "sink");
fail_if (sinkpad == NULL, "Failed to get sinkpad from wavpackparse");
fail_unless (gst_pad_link (mysrcpad, sinkpad) == GST_PAD_LINK_OK,
"Failed to link pads");
gst_element_set_bus (wavpackparse, NULL);
gst_object_unref (GST_OBJECT (bus));
- sinkpad = gst_element_get_pad (wavpackparse, "sink");
+ sinkpad = gst_element_get_static_pad (wavpackparse, "sink");
fail_if (sinkpad == NULL, "Failed to get sinkpad from wavpackparse");
fail_unless (gst_pad_unlink (mysrcpad, sinkpad), "Failed to unlink pads");
gst_pad_set_caps (mysrcpad, NULL);
gst_object_unref (sinkpad);
gst_object_unref (mysrcpad);
- srcpad = gst_element_get_pad (wavpackparse, "src");
+ srcpad = gst_element_get_static_pad (wavpackparse, "src");
fail_if (srcpad == NULL, "Failed to get srcpad from wavpackparse");
fail_unless (gst_pad_unlink (srcpad, mysinkpad), "Failed to unlink pads");
gst_pad_set_caps (mysinkpad, NULL);