mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
Don't use gst_element_get_pad().
Original commit message from CVS: * gst/gstpad.c: (gst_pad_load_and_link): * gst/gstutils.c: (gst_element_link_pads), (gst_element_unlink_pads): * libs/gst/check/gstcheck.c: (gst_check_setup_src_pad), (gst_check_teardown_src_pad), (gst_check_setup_sink_pad), (gst_check_teardown_sink_pad), (gst_check_element_push_buffer_list): * tests/check/elements/fakesink.c: (GST_START_TEST): * tests/check/elements/filesink.c: * tests/check/elements/filesrc.c: (GST_START_TEST): * tests/check/elements/multiqueue.c: (setup_multiqueue), (mq_sinkpad_to_srcpad): * tests/check/elements/tee.c: (GST_START_TEST): * tests/check/generic/sinks.c: (GST_START_TEST): * tests/check/gst/gstbin.c: (GST_START_TEST): * tests/check/gst/gstevent.c: (GST_START_TEST): * tests/check/gst/gstghostpad.c: (GST_START_TEST): * tests/check/gst/gstpipeline.c: (GST_START_TEST): * tests/check/gst/gstquery.c: (GST_START_TEST): * tests/check/gst/gstutils.c: (GST_START_TEST): * tests/check/libs/basesrc.c: (GST_START_TEST): * tests/check/pipelines/parse-launch.c: (run_delayed_test), (gst_parse_test_element_change_state): Don't use gst_element_get_pad().
This commit is contained in:
parent
3078614232
commit
cc8334905c
18 changed files with 134 additions and 96 deletions
27
ChangeLog
27
ChangeLog
|
@ -1,3 +1,30 @@
|
|||
2008-05-21 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||
|
||||
* gst/gstpad.c: (gst_pad_load_and_link):
|
||||
* gst/gstutils.c: (gst_element_link_pads),
|
||||
(gst_element_unlink_pads):
|
||||
* libs/gst/check/gstcheck.c: (gst_check_setup_src_pad),
|
||||
(gst_check_teardown_src_pad), (gst_check_setup_sink_pad),
|
||||
(gst_check_teardown_sink_pad),
|
||||
(gst_check_element_push_buffer_list):
|
||||
* tests/check/elements/fakesink.c: (GST_START_TEST):
|
||||
* tests/check/elements/filesink.c:
|
||||
* tests/check/elements/filesrc.c: (GST_START_TEST):
|
||||
* tests/check/elements/multiqueue.c: (setup_multiqueue),
|
||||
(mq_sinkpad_to_srcpad):
|
||||
* tests/check/elements/tee.c: (GST_START_TEST):
|
||||
* tests/check/generic/sinks.c: (GST_START_TEST):
|
||||
* tests/check/gst/gstbin.c: (GST_START_TEST):
|
||||
* tests/check/gst/gstevent.c: (GST_START_TEST):
|
||||
* tests/check/gst/gstghostpad.c: (GST_START_TEST):
|
||||
* tests/check/gst/gstpipeline.c: (GST_START_TEST):
|
||||
* tests/check/gst/gstquery.c: (GST_START_TEST):
|
||||
* tests/check/gst/gstutils.c: (GST_START_TEST):
|
||||
* tests/check/libs/basesrc.c: (GST_START_TEST):
|
||||
* tests/check/pipelines/parse-launch.c: (run_delayed_test),
|
||||
(gst_parse_test_element_change_state):
|
||||
Don't use gst_element_get_pad().
|
||||
|
||||
2008-05-21 Felipe Contreras <felipe.contreras@gmail.com>
|
||||
|
||||
* docs/Makefile.am:
|
||||
|
|
|
@ -3217,7 +3217,9 @@ gst_pad_load_and_link (xmlNodePtr self, GstObject * parent)
|
|||
while (field) {
|
||||
if (!strcmp ((char *) field->name, "name")) {
|
||||
name = (gchar *) xmlNodeGetContent (field);
|
||||
pad = gst_element_get_pad (GST_ELEMENT (parent), name);
|
||||
pad = gst_element_get_static_pad (GST_ELEMENT (parent), name);
|
||||
if (!pad)
|
||||
pad = gst_element_get_request_pad (GST_ELEMENT (parent), name);
|
||||
g_free (name);
|
||||
} else if (!strcmp ((char *) field->name, "peer")) {
|
||||
peer = (gchar *) xmlNodeGetContent (field);
|
||||
|
@ -3253,7 +3255,9 @@ gst_pad_load_and_link (xmlNodePtr self, GstObject * parent)
|
|||
if (target == NULL)
|
||||
goto cleanup;
|
||||
|
||||
targetpad = gst_element_get_pad (target, split[1]);
|
||||
targetpad = gst_element_get_static_pad (target, split[1]);
|
||||
if (!pad)
|
||||
targetpad = gst_element_get_request_pad (target, split[1]);
|
||||
|
||||
if (targetpad == NULL)
|
||||
goto cleanup;
|
||||
|
|
|
@ -1364,7 +1364,8 @@ gst_element_link_pads (GstElement * src, const gchar * srcpadname,
|
|||
/* get a src pad */
|
||||
if (srcpadname) {
|
||||
/* name specified, look it up */
|
||||
srcpad = gst_element_get_pad (src, srcpadname);
|
||||
if (!(srcpad = gst_element_get_static_pad (src, srcpadname)))
|
||||
srcpad = gst_element_get_request_pad (src, srcpadname);
|
||||
if (!srcpad) {
|
||||
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "no pad %s:%s",
|
||||
GST_ELEMENT_NAME (src), srcpadname);
|
||||
|
@ -1397,7 +1398,8 @@ gst_element_link_pads (GstElement * src, const gchar * srcpadname,
|
|||
/* get a destination pad */
|
||||
if (destpadname) {
|
||||
/* name specified, look it up */
|
||||
destpad = gst_element_get_pad (dest, destpadname);
|
||||
if (!(destpad = gst_element_get_static_pad (dest, destpadname)))
|
||||
destpad = gst_element_get_request_pad (dest, destpadname);
|
||||
if (!destpad) {
|
||||
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "no pad %s:%s",
|
||||
GST_ELEMENT_NAME (dest), destpadname);
|
||||
|
@ -1748,6 +1750,9 @@ gst_element_unlink_pads (GstElement * src, const gchar * srcpadname,
|
|||
GstElement * dest, const gchar * destpadname)
|
||||
{
|
||||
GstPad *srcpad, *destpad;
|
||||
gboolean srcrequest, destrequest;
|
||||
|
||||
srcrequest = destrequest = FALSE;
|
||||
|
||||
g_return_if_fail (src != NULL);
|
||||
g_return_if_fail (GST_IS_ELEMENT (src));
|
||||
|
@ -1757,23 +1762,33 @@ gst_element_unlink_pads (GstElement * src, const gchar * srcpadname,
|
|||
g_return_if_fail (destpadname != NULL);
|
||||
|
||||
/* obtain the pads requested */
|
||||
srcpad = gst_element_get_pad (src, srcpadname);
|
||||
if (!(srcpad = gst_element_get_static_pad (src, srcpadname)))
|
||||
if ((srcpad = gst_element_get_request_pad (src, srcpadname)))
|
||||
srcrequest = TRUE;
|
||||
if (srcpad == NULL) {
|
||||
GST_WARNING_OBJECT (src, "source element has no pad \"%s\"", srcpadname);
|
||||
return;
|
||||
}
|
||||
destpad = gst_element_get_pad (dest, destpadname);
|
||||
if (!(destpad = gst_element_get_static_pad (dest, destpadname)))
|
||||
if ((destpad = gst_element_get_request_pad (dest, destpadname)))
|
||||
destrequest = TRUE;
|
||||
if (destpad == NULL) {
|
||||
GST_WARNING_OBJECT (dest, "destination element has no pad \"%s\"",
|
||||
destpadname);
|
||||
gst_object_unref (srcpad);
|
||||
return;
|
||||
goto free_src;
|
||||
}
|
||||
|
||||
/* we're satisified they can be unlinked, let's do it */
|
||||
gst_pad_unlink (srcpad, destpad);
|
||||
gst_object_unref (srcpad);
|
||||
|
||||
if (destrequest)
|
||||
gst_element_release_request_pad (dest, destpad);
|
||||
gst_object_unref (destpad);
|
||||
|
||||
free_src:
|
||||
if (srcrequest)
|
||||
gst_element_release_request_pad (src, srcpad);
|
||||
gst_object_unref (srcpad);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -270,7 +270,7 @@ gst_check_setup_src_pad (GstElement * element,
|
|||
fail_if (srcpad == NULL, "Could not create a srcpad");
|
||||
ASSERT_OBJECT_REFCOUNT (srcpad, "srcpad", 1);
|
||||
|
||||
sinkpad = gst_element_get_pad (element, "sink");
|
||||
sinkpad = gst_element_get_static_pad (element, "sink");
|
||||
fail_if (sinkpad == NULL, "Could not get sink pad from %s",
|
||||
GST_ELEMENT_NAME (element));
|
||||
ASSERT_OBJECT_REFCOUNT (sinkpad, "sinkpad", 2);
|
||||
|
@ -290,7 +290,7 @@ gst_check_teardown_src_pad (GstElement * element)
|
|||
GstPad *srcpad, *sinkpad;
|
||||
|
||||
/* clean up floating src pad */
|
||||
sinkpad = gst_element_get_pad (element, "sink");
|
||||
sinkpad = gst_element_get_static_pad (element, "sink");
|
||||
ASSERT_OBJECT_REFCOUNT (sinkpad, "sinkpad", 2);
|
||||
srcpad = gst_pad_get_peer (sinkpad);
|
||||
|
||||
|
@ -323,7 +323,7 @@ gst_check_setup_sink_pad (GstElement * element, GstStaticPadTemplate * template,
|
|||
GST_DEBUG_OBJECT (element, "setting up receiving pad %p", sinkpad);
|
||||
fail_if (sinkpad == NULL, "Could not create a sinkpad");
|
||||
|
||||
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)
|
||||
|
@ -346,7 +346,7 @@ gst_check_teardown_sink_pad (GstElement * element)
|
|||
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);
|
||||
|
@ -447,7 +447,7 @@ gst_check_element_push_buffer_list (const gchar * element_name,
|
|||
src_caps = GST_BUFFER_CAPS (buffer);
|
||||
src_pad = gst_pad_new (NULL, GST_PAD_SRC);
|
||||
gst_pad_set_caps (src_pad, src_caps);
|
||||
pad_peer = gst_element_get_pad (element, "sink");
|
||||
pad_peer = gst_element_get_static_pad (element, "sink");
|
||||
fail_if (pad_peer == NULL);
|
||||
fail_unless (gst_pad_link (src_pad, pad_peer) == GST_PAD_LINK_OK,
|
||||
"Could not link source and %s sink pads", GST_ELEMENT_NAME (element));
|
||||
|
@ -473,7 +473,7 @@ gst_check_element_push_buffer_list (const gchar * element_name,
|
|||
fail_unless (GST_IS_PAD (sink_pad));
|
||||
gst_pad_set_caps (sink_pad, sink_caps);
|
||||
/* get the peer pad */
|
||||
pad_peer = gst_element_get_pad (element, "src");
|
||||
pad_peer = gst_element_get_static_pad (element, "src");
|
||||
fail_unless (gst_pad_link (pad_peer, sink_pad) == GST_PAD_LINK_OK,
|
||||
"Could not link sink and %s source pads", GST_ELEMENT_NAME (element));
|
||||
gst_object_unref (pad_peer);
|
||||
|
|
|
@ -88,7 +88,7 @@ GST_START_TEST (test_clipping)
|
|||
sink = gst_element_factory_make ("fakesink", "sink");
|
||||
fail_if (sink == NULL);
|
||||
|
||||
sinkpad = gst_element_get_pad (sink, "sink");
|
||||
sinkpad = gst_element_get_static_pad (sink, "sink");
|
||||
fail_if (sinkpad == NULL);
|
||||
|
||||
/* make element ready to accept data */
|
||||
|
@ -234,7 +234,7 @@ GST_START_TEST (test_preroll_sync)
|
|||
|
||||
gst_bin_add (GST_BIN (pipeline), sink);
|
||||
|
||||
sinkpad = gst_element_get_pad (sink, "sink");
|
||||
sinkpad = gst_element_get_static_pad (sink, "sink");
|
||||
fail_if (sinkpad == NULL);
|
||||
|
||||
/* make pipeline and element ready to accept data */
|
||||
|
@ -315,7 +315,7 @@ GST_START_TEST (test_eos)
|
|||
|
||||
gst_bin_add (GST_BIN (pipeline), sink);
|
||||
|
||||
sinkpad = gst_element_get_pad (sink, "sink");
|
||||
sinkpad = gst_element_get_static_pad (sink, "sink");
|
||||
fail_if (sinkpad == NULL);
|
||||
|
||||
/* make pipeline and element ready to accept data */
|
||||
|
@ -464,7 +464,7 @@ GST_START_TEST (test_eos2)
|
|||
|
||||
gst_bin_add (GST_BIN (pipeline), sink);
|
||||
|
||||
sinkpad = gst_element_get_pad (sink, "sink");
|
||||
sinkpad = gst_element_get_static_pad (sink, "sink");
|
||||
fail_if (sinkpad == NULL);
|
||||
|
||||
/* make pipeline and element ready to accept data */
|
||||
|
|
|
@ -76,7 +76,7 @@ cleanup_filesink (GstElement * filesink)
|
|||
GstFormat fmt = format; \
|
||||
GstPad *pad; \
|
||||
gint64 pos; \
|
||||
pad = gst_element_get_pad (filesink, "sink"); \
|
||||
pad = gst_element_get_static_pad (filesink, "sink"); \
|
||||
fail_unless (gst_pad_query_position (pad, &fmt, &pos)); \
|
||||
fail_unless_equals_int (pos, position); \
|
||||
gst_object_unref (pad); \
|
||||
|
|
|
@ -180,7 +180,7 @@ GST_START_TEST (test_pull)
|
|||
"could not set to ready");
|
||||
|
||||
/* get the source pad */
|
||||
pad = gst_element_get_pad (src, "src");
|
||||
pad = gst_element_get_static_pad (src, "src");
|
||||
fail_unless (pad != NULL);
|
||||
|
||||
/* activate the pad in pull mode */
|
||||
|
|
|
@ -49,11 +49,7 @@ setup_multiqueue (GstElement * pipe, GstElement * inputs[],
|
|||
if (inputs != NULL && inputs[i] != NULL) {
|
||||
gst_bin_add (GST_BIN (pipe), inputs[i]);
|
||||
|
||||
srcpad = gst_element_get_pad (inputs[i], "src");
|
||||
if (srcpad == NULL)
|
||||
srcpad = gst_element_get_pad (inputs[i], "src%d");
|
||||
if (srcpad == NULL)
|
||||
srcpad = gst_element_get_pad (inputs[i], "src_%d");
|
||||
srcpad = gst_element_get_static_pad (inputs[i], "src");
|
||||
fail_unless (srcpad != NULL, "failed to find src pad for input #%u", i);
|
||||
|
||||
fail_unless_equals_int (GST_PAD_LINK_OK, gst_pad_link (srcpad, sinkpad));
|
||||
|
@ -74,18 +70,14 @@ setup_multiqueue (GstElement * pipe, GstElement * inputs[],
|
|||
fail_unless (srcpad == NULL);
|
||||
|
||||
g_snprintf (padname, sizeof (padname), "src%d", i);
|
||||
srcpad = gst_element_get_pad (mq, padname);
|
||||
srcpad = gst_element_get_static_pad (mq, padname);
|
||||
fail_unless (srcpad != NULL, "failed to get multiqueue src pad #%u", i);
|
||||
fail_unless (GST_PAD_IS_SRC (srcpad),
|
||||
"%s:%s is not a source pad?!", GST_DEBUG_PAD_NAME (srcpad));
|
||||
|
||||
gst_bin_add (GST_BIN (pipe), outputs[i]);
|
||||
|
||||
sinkpad = gst_element_get_pad (outputs[i], "sink");
|
||||
if (sinkpad == NULL)
|
||||
sinkpad = gst_element_get_pad (outputs[i], "sink%d");
|
||||
if (sinkpad == NULL)
|
||||
sinkpad = gst_element_get_pad (outputs[i], "sink_%d");
|
||||
sinkpad = gst_element_get_static_pad (outputs[i], "sink");
|
||||
fail_unless (sinkpad != NULL, "failed to find sink pad of output #%u", i);
|
||||
fail_unless (GST_PAD_IS_SINK (sinkpad));
|
||||
|
||||
|
@ -263,7 +255,7 @@ mq_sinkpad_to_srcpad (GstElement * mq, GstPad * sink)
|
|||
mq_sinkpad_name = gst_pad_get_name (sink);
|
||||
fail_unless (g_str_has_prefix (mq_sinkpad_name, "sink"));
|
||||
mq_srcpad_name = g_strdup_printf ("src%s", mq_sinkpad_name + 4);
|
||||
srcpad = gst_element_get_pad (mq, mq_srcpad_name);
|
||||
srcpad = gst_element_get_static_pad (mq, mq_srcpad_name);
|
||||
fail_unless (srcpad != NULL);
|
||||
|
||||
g_free (mq_sinkpad_name);
|
||||
|
|
|
@ -79,7 +79,7 @@ GST_START_TEST (test_num_buffers)
|
|||
req_pads[i] = gst_element_get_request_pad (tee, "src%d");
|
||||
fail_unless (req_pads[i] != NULL);
|
||||
|
||||
qpad = gst_element_get_pad (queues[i], "sink");
|
||||
qpad = gst_element_get_static_pad (queues[i], "sink");
|
||||
fail_unless_equals_int (gst_pad_link (req_pads[i], qpad), GST_PAD_LINK_OK);
|
||||
gst_object_unref (qpad);
|
||||
}
|
||||
|
|
|
@ -136,8 +136,8 @@ GST_START_TEST (test_src_sink)
|
|||
gst_bin_add (GST_BIN (pipeline), src);
|
||||
gst_bin_add (GST_BIN (pipeline), sink);
|
||||
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
sinkpad = gst_element_get_pad (sink, "sink");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
sinkpad = gst_element_get_static_pad (sink, "sink");
|
||||
gst_pad_link (srcpad, sinkpad);
|
||||
gst_object_unref (srcpad);
|
||||
gst_object_unref (sinkpad);
|
||||
|
@ -182,8 +182,8 @@ GST_START_TEST (test_livesrc_remove)
|
|||
gst_bin_add (GST_BIN (pipeline), src);
|
||||
gst_bin_add (GST_BIN (pipeline), sink);
|
||||
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
sinkpad = gst_element_get_pad (sink, "sink");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
sinkpad = gst_element_get_static_pad (sink, "sink");
|
||||
gst_pad_link (srcpad, sinkpad);
|
||||
gst_object_unref (srcpad);
|
||||
gst_object_unref (sinkpad);
|
||||
|
@ -235,8 +235,8 @@ GST_START_TEST (test_livesrc_sink)
|
|||
gst_bin_add (GST_BIN (pipeline), src);
|
||||
gst_bin_add (GST_BIN (pipeline), sink);
|
||||
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
sinkpad = gst_element_get_pad (sink, "sink");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
sinkpad = gst_element_get_static_pad (sink, "sink");
|
||||
gst_pad_link (srcpad, sinkpad);
|
||||
gst_object_unref (srcpad);
|
||||
gst_object_unref (sinkpad);
|
||||
|
@ -358,8 +358,8 @@ GST_START_TEST (test_livesrc2_sink)
|
|||
gst_bin_add (GST_BIN (pipeline), src);
|
||||
gst_bin_add (GST_BIN (pipeline), sink);
|
||||
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
sinkpad = gst_element_get_pad (sink, "sink");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
sinkpad = gst_element_get_static_pad (sink, "sink");
|
||||
gst_pad_link (srcpad, sinkpad);
|
||||
gst_object_unref (srcpad);
|
||||
gst_object_unref (sinkpad);
|
||||
|
@ -427,8 +427,8 @@ GST_START_TEST (test_livesrc3_sink)
|
|||
gst_bin_add (GST_BIN (pipeline), src);
|
||||
gst_bin_add (GST_BIN (pipeline), sink);
|
||||
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
sinkpad = gst_element_get_pad (sink, "sink");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
sinkpad = gst_element_get_static_pad (sink, "sink");
|
||||
gst_pad_link (srcpad, sinkpad);
|
||||
gst_object_unref (srcpad);
|
||||
gst_object_unref (sinkpad);
|
||||
|
@ -524,8 +524,8 @@ GST_START_TEST (test_unlinked_live)
|
|||
gst_bin_add (GST_BIN (pipeline), sink);
|
||||
|
||||
/* link non live source to sink */
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
sinkpad = gst_element_get_pad (sink, "sink");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
sinkpad = gst_element_get_static_pad (sink, "sink");
|
||||
gst_pad_link (srcpad, sinkpad);
|
||||
gst_object_unref (srcpad);
|
||||
gst_object_unref (sinkpad);
|
||||
|
@ -596,8 +596,8 @@ GST_START_TEST (test_delayed_async)
|
|||
fail_unless (pending == GST_STATE_VOID_PENDING, "have pending");
|
||||
|
||||
/* link live source to sink */
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
sinkpad = gst_element_get_pad (sink, "sink");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
sinkpad = gst_element_get_static_pad (sink, "sink");
|
||||
gst_pad_link (srcpad, sinkpad);
|
||||
gst_object_unref (srcpad);
|
||||
gst_object_unref (sinkpad);
|
||||
|
@ -655,8 +655,8 @@ GST_START_TEST (test_added_async)
|
|||
fail_unless (pending == GST_STATE_VOID_PENDING, "have pending");
|
||||
|
||||
/* link live source to sink */
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
sinkpad = gst_element_get_pad (sink, "sink");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
sinkpad = gst_element_get_static_pad (sink, "sink");
|
||||
gst_pad_link (srcpad, sinkpad);
|
||||
gst_object_unref (srcpad);
|
||||
gst_object_unref (sinkpad);
|
||||
|
@ -796,7 +796,7 @@ GST_START_TEST (test_add_live2)
|
|||
|
||||
GST_DEBUG ("blocking srcpad");
|
||||
/* block source pad */
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
gst_pad_set_blocked_async (srcpad, TRUE, pad_blocked_cb, NULL);
|
||||
|
||||
/* set source to PAUSED without adding it to the pipeline */
|
||||
|
@ -817,7 +817,7 @@ GST_START_TEST (test_add_live2)
|
|||
GST_DEBUG ("linking pads");
|
||||
|
||||
/* link to sink */
|
||||
sinkpad = gst_element_get_pad (sink, "sink");
|
||||
sinkpad = gst_element_get_static_pad (sink, "sink");
|
||||
gst_pad_link (srcpad, sinkpad);
|
||||
gst_object_unref (srcpad);
|
||||
gst_object_unref (sinkpad);
|
||||
|
@ -863,8 +863,8 @@ GST_START_TEST (test_bin_live)
|
|||
gst_bin_add (GST_BIN (bin), sink);
|
||||
gst_bin_add (GST_BIN (pipeline), bin);
|
||||
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
sinkpad = gst_element_get_pad (sink, "sink");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
sinkpad = gst_element_get_static_pad (sink, "sink");
|
||||
gst_pad_link (srcpad, sinkpad);
|
||||
gst_object_unref (srcpad);
|
||||
gst_object_unref (sinkpad);
|
||||
|
@ -920,7 +920,7 @@ GST_START_TEST (test_fake_eos)
|
|||
sink = gst_element_factory_make ("fakesink", "sink");
|
||||
g_object_set (G_OBJECT (sink), "sync", TRUE, NULL);
|
||||
|
||||
sinkpad = gst_element_get_pad (sink, "sink");
|
||||
sinkpad = gst_element_get_static_pad (sink, "sink");
|
||||
|
||||
gst_bin_add (GST_BIN_CAST (pipeline), sink);
|
||||
|
||||
|
@ -1057,7 +1057,7 @@ GST_START_TEST (test_async_done)
|
|||
g_signal_connect (sink, "preroll-handoff", (GCallback) async_done_handoff,
|
||||
sink);
|
||||
|
||||
sinkpad = gst_element_get_pad (sink, "sink");
|
||||
sinkpad = gst_element_get_static_pad (sink, "sink");
|
||||
|
||||
ret = gst_element_set_state (sink, GST_STATE_PAUSED);
|
||||
fail_unless (ret == GST_STATE_CHANGE_ASYNC, "no ASYNC state return");
|
||||
|
@ -1195,7 +1195,7 @@ GST_START_TEST (test_async_done_eos)
|
|||
g_object_set (G_OBJECT (sink), "sync", TRUE, NULL);
|
||||
g_object_set (G_OBJECT (sink), "preroll-queue-len", 1, NULL);
|
||||
|
||||
sinkpad = gst_element_get_pad (sink, "sink");
|
||||
sinkpad = gst_element_get_static_pad (sink, "sink");
|
||||
|
||||
ret = gst_element_set_state (sink, GST_STATE_PAUSED);
|
||||
fail_unless (ret == GST_STATE_CHANGE_ASYNC, "no ASYNC state return");
|
||||
|
|
|
@ -456,9 +456,9 @@ GST_START_TEST (test_add_linked)
|
|||
sink = gst_element_factory_make ("fakesink", NULL);
|
||||
fail_if (sink == NULL, "Could not create fakesink");
|
||||
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
fail_unless (srcpad != NULL);
|
||||
sinkpad = gst_element_get_pad (sink, "sink");
|
||||
sinkpad = gst_element_get_static_pad (sink, "sink");
|
||||
fail_unless (sinkpad != NULL);
|
||||
|
||||
fail_unless (gst_pad_link (srcpad, sinkpad) == GST_PAD_LINK_OK);
|
||||
|
|
|
@ -419,11 +419,11 @@ GST_START_TEST (send_custom_events)
|
|||
g_object_set (G_OBJECT (fakesink), "silent", TRUE, "sync", TRUE, NULL);
|
||||
|
||||
/* add pad-probes to faksrc.src and fakesink.sink */
|
||||
fail_if ((srcpad = gst_element_get_pad (fakesrc, "src")) == NULL);
|
||||
fail_if ((srcpad = gst_element_get_static_pad (fakesrc, "src")) == NULL);
|
||||
gst_pad_add_event_probe (srcpad, (GCallback) event_probe,
|
||||
GINT_TO_POINTER (TRUE));
|
||||
|
||||
fail_if ((sinkpad = gst_element_get_pad (fakesink, "sink")) == NULL);
|
||||
fail_if ((sinkpad = gst_element_get_static_pad (fakesink, "sink")) == NULL);
|
||||
gst_pad_add_event_probe (sinkpad, (GCallback) event_probe,
|
||||
GINT_TO_POINTER (FALSE));
|
||||
|
||||
|
|
|
@ -44,13 +44,13 @@ GST_START_TEST (test_remove1)
|
|||
ASSERT_OBJECT_REFCOUNT (b1, "pipeline", 1);
|
||||
ASSERT_OBJECT_REFCOUNT (b2, "bin", 1);
|
||||
|
||||
sinkpad = gst_element_get_pad (sink, "sink");
|
||||
sinkpad = gst_element_get_static_pad (sink, "sink");
|
||||
gst_element_add_pad (b2, gst_ghost_pad_new ("sink", sinkpad));
|
||||
gst_object_unref (sinkpad);
|
||||
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
/* get the ghostpad */
|
||||
sinkpad = gst_element_get_pad (b2, "sink");
|
||||
sinkpad = gst_element_get_static_pad (b2, "sink");
|
||||
|
||||
ret = gst_pad_link (srcpad, sinkpad);
|
||||
fail_unless (ret == GST_PAD_LINK_OK);
|
||||
|
@ -62,7 +62,7 @@ GST_START_TEST (test_remove1)
|
|||
ASSERT_OBJECT_REFCOUNT (b2, "bin", 1);
|
||||
gst_bin_remove (GST_BIN (b1), b2);
|
||||
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
/* pad cannot be linked now */
|
||||
fail_if (gst_pad_is_linked (srcpad));
|
||||
gst_object_unref (srcpad);
|
||||
|
@ -92,14 +92,14 @@ GST_START_TEST (test_remove2)
|
|||
fail_unless (gst_bin_add (GST_BIN (b1), b2));
|
||||
ASSERT_OBJECT_REFCOUNT (src, "src", 1);
|
||||
|
||||
sinkpad = gst_element_get_pad (sink, "sink");
|
||||
sinkpad = gst_element_get_static_pad (sink, "sink");
|
||||
gst_element_add_pad (b2, gst_ghost_pad_new ("sink", sinkpad));
|
||||
gst_object_unref (sinkpad);
|
||||
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
ASSERT_OBJECT_REFCOUNT (srcpad, "srcpad", 2); /* since we got one */
|
||||
/* get the ghostpad */
|
||||
sinkpad = gst_element_get_pad (b2, "sink");
|
||||
sinkpad = gst_element_get_static_pad (b2, "sink");
|
||||
ASSERT_OBJECT_REFCOUNT (sinkpad, "sinkpad", 2); /* since we got one */
|
||||
|
||||
GST_DEBUG ("linking srcpad and sinkpad");
|
||||
|
@ -116,7 +116,7 @@ GST_START_TEST (test_remove2)
|
|||
/* now remove the sink from the bin */
|
||||
gst_bin_remove (GST_BIN (b2), sink);
|
||||
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
/* pad is still linked to ghostpad */
|
||||
fail_if (!gst_pad_is_linked (srcpad));
|
||||
ASSERT_OBJECT_REFCOUNT (src, "src", 1);
|
||||
|
@ -172,7 +172,7 @@ GST_START_TEST (test_ghost_pads_notarget)
|
|||
|
||||
srcpad = gst_ghost_pad_new_no_target ("src", GST_PAD_SRC);
|
||||
fail_unless (srcpad != NULL);
|
||||
sinkpad = gst_element_get_pad (sink, "sink");
|
||||
sinkpad = gst_element_get_static_pad (sink, "sink");
|
||||
fail_unless (sinkpad != NULL);
|
||||
|
||||
ret = gst_pad_link (srcpad, sinkpad);
|
||||
|
@ -226,9 +226,9 @@ GST_START_TEST (test_link)
|
|||
fail_unless (gst_bin_add (GST_BIN (b1), src));
|
||||
fail_unless (gst_bin_add (GST_BIN (b1), b2));
|
||||
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
fail_unless (srcpad != NULL);
|
||||
sinkpad = gst_element_get_pad (sink, "sink");
|
||||
sinkpad = gst_element_get_static_pad (sink, "sink");
|
||||
fail_unless (sinkpad != NULL);
|
||||
|
||||
/* linking in different hierarchies should fail */
|
||||
|
@ -292,18 +292,18 @@ GST_START_TEST (test_ghost_pads)
|
|||
fail_unless (GST_IS_GHOST_PAD (b2->srcpads->data));
|
||||
GST_OBJECT_UNLOCK (b2);
|
||||
|
||||
fsrc = gst_element_get_pad (src, "src");
|
||||
fsrc = gst_element_get_static_pad (src, "src");
|
||||
fail_unless (fsrc != NULL);
|
||||
gsink = GST_PAD (gst_object_ref (b2->sinkpads->data));
|
||||
fail_unless (gsink != NULL);
|
||||
gsrc = GST_PAD (gst_object_ref (b2->srcpads->data));
|
||||
fail_unless (gsrc != NULL);
|
||||
fsink = gst_element_get_pad (sink, "sink");
|
||||
fsink = gst_element_get_static_pad (sink, "sink");
|
||||
fail_unless (fsink != NULL);
|
||||
|
||||
isink = gst_element_get_pad (i1, "sink");
|
||||
isink = gst_element_get_static_pad (i1, "sink");
|
||||
fail_unless (isink != NULL);
|
||||
isrc = gst_element_get_pad (i1, "src");
|
||||
isrc = gst_element_get_static_pad (i1, "src");
|
||||
fail_unless (isrc != NULL);
|
||||
gisrc = gst_pad_get_peer (isink);
|
||||
fail_unless (gisrc != NULL);
|
||||
|
@ -393,14 +393,14 @@ GST_START_TEST (test_ghost_pads_bin)
|
|||
|
||||
src = gst_element_factory_make ("fakesrc", "src");
|
||||
gst_bin_add (srcbin, src);
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
srcghost = gst_ghost_pad_new ("src", srcpad);
|
||||
gst_object_unref (srcpad);
|
||||
gst_element_add_pad (GST_ELEMENT (srcbin), srcghost);
|
||||
|
||||
sink = gst_element_factory_make ("fakesink", "sink");
|
||||
gst_bin_add (sinkbin, sink);
|
||||
sinkpad = gst_element_get_pad (sink, "sink");
|
||||
sinkpad = gst_element_get_static_pad (sink, "sink");
|
||||
sinkghost = gst_ghost_pad_new ("sink", sinkpad);
|
||||
gst_object_unref (sinkpad);
|
||||
gst_element_add_pad (GST_ELEMENT (sinkbin), sinkghost);
|
||||
|
@ -456,7 +456,7 @@ GST_START_TEST (test_ghost_pads_block)
|
|||
|
||||
src = gst_element_factory_make ("fakesrc", "src");
|
||||
gst_bin_add (srcbin, src);
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
srcghost = gst_ghost_pad_new ("src", srcpad);
|
||||
gst_element_add_pad (GST_ELEMENT (srcbin), srcghost);
|
||||
gst_object_unref (srcpad);
|
||||
|
@ -497,7 +497,7 @@ GST_START_TEST (test_ghost_pads_probes)
|
|||
|
||||
src = gst_element_factory_make ("fakesrc", "src");
|
||||
gst_bin_add (srcbin, src);
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
srcghost = gst_ghost_pad_new ("src", srcpad);
|
||||
gst_element_add_pad (GST_ELEMENT (srcbin), srcghost);
|
||||
gst_object_unref (srcpad);
|
||||
|
|
|
@ -271,7 +271,7 @@ GST_START_TEST (test_base_time)
|
|||
gst_bin_add_many (GST_BIN (pipeline), fakesrc, fakesink, NULL);
|
||||
gst_element_link (fakesrc, fakesink);
|
||||
|
||||
sink = gst_element_get_pad (fakesink, "sink");
|
||||
sink = gst_element_get_static_pad (fakesink, "sink");
|
||||
gst_pad_add_buffer_probe (sink, G_CALLBACK (sink_pad_probe), &observed);
|
||||
|
||||
fail_unless (gst_element_set_state (pipeline, GST_STATE_PAUSED)
|
||||
|
|
|
@ -226,7 +226,7 @@ GST_START_TEST (test_queries)
|
|||
"Could not query duration of fakesink");
|
||||
|
||||
/* Query pads */
|
||||
fail_unless ((pad = gst_element_get_pad (src, "src")) != NULL,
|
||||
fail_unless ((pad = gst_element_get_static_pad (src, "src")) != NULL,
|
||||
"Could not get source pad of fakesrc");
|
||||
fail_unless (gst_pad_query (pad, pos),
|
||||
"Could not query position of fakesrc src pad");
|
||||
|
|
|
@ -80,7 +80,7 @@ GST_START_TEST (test_buffer_probe_n_times)
|
|||
gst_bin_add_many (GST_BIN (pipeline), fakesrc, fakesink, NULL);
|
||||
gst_element_link (fakesrc, fakesink);
|
||||
|
||||
pad = gst_element_get_pad (fakesink, "sink");
|
||||
pad = gst_element_get_static_pad (fakesink, "sink");
|
||||
|
||||
/* add the probes we need for the test */
|
||||
gst_pad_add_data_probe (pad, G_CALLBACK (data_probe), SPECIAL_POINTER (0));
|
||||
|
@ -173,7 +173,7 @@ GST_START_TEST (test_buffer_probe_once)
|
|||
gst_bin_add_many (GST_BIN (pipeline), fakesrc, fakesink, NULL);
|
||||
gst_element_link (fakesrc, fakesink);
|
||||
|
||||
pad = gst_element_get_pad (fakesink, "sink");
|
||||
pad = gst_element_get_static_pad (fakesink, "sink");
|
||||
id1 = gst_pad_add_data_probe (pad, G_CALLBACK (data_probe_once), &id1);
|
||||
id2 = gst_pad_add_buffer_probe (pad, G_CALLBACK (buffer_probe_once), &id2);
|
||||
id3 = gst_pad_add_event_probe (pad, G_CALLBACK (event_probe_once), &id3);
|
||||
|
@ -382,7 +382,7 @@ GST_START_TEST (test_parse_bin_from_description)
|
|||
g_assert (bin != NULL);
|
||||
|
||||
s = g_string_new ("");
|
||||
if ((ghost_pad = gst_element_get_pad (bin, "sink"))) {
|
||||
if ((ghost_pad = gst_element_get_static_pad (bin, "sink"))) {
|
||||
g_assert (GST_IS_GHOST_PAD (ghost_pad));
|
||||
|
||||
target_pad = gst_ghost_pad_get_target (GST_GHOST_PAD (ghost_pad));
|
||||
|
@ -399,7 +399,7 @@ GST_START_TEST (test_parse_bin_from_description)
|
|||
gst_object_unref (ghost_pad);
|
||||
}
|
||||
|
||||
if ((ghost_pad = gst_element_get_pad (bin, "src"))) {
|
||||
if ((ghost_pad = gst_element_get_static_pad (bin, "src"))) {
|
||||
g_assert (GST_IS_GHOST_PAD (ghost_pad));
|
||||
|
||||
target_pad = gst_ghost_pad_get_target (GST_GHOST_PAD (ghost_pad));
|
||||
|
|
|
@ -73,7 +73,7 @@ GST_START_TEST (basesrc_eos_events_push_live_op)
|
|||
g_object_set (src, "can-activate-pull", FALSE, NULL);
|
||||
|
||||
/* set up event probe to count EOS events */
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
fail_unless (srcpad != NULL);
|
||||
|
||||
probe = gst_pad_add_event_probe (srcpad,
|
||||
|
@ -153,7 +153,7 @@ GST_START_TEST (basesrc_eos_events_push)
|
|||
g_object_set (src, "num-buffers", 8, NULL);
|
||||
|
||||
/* set up event probe to count EOS events */
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
fail_unless (srcpad != NULL);
|
||||
|
||||
probe = gst_pad_add_event_probe (srcpad,
|
||||
|
@ -220,7 +220,7 @@ GST_START_TEST (basesrc_eos_events_pull_live_op)
|
|||
g_object_set (src, "can-activate-pull", TRUE, NULL);
|
||||
|
||||
/* set up event probe to count EOS events */
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
fail_unless (srcpad != NULL);
|
||||
|
||||
probe = gst_pad_add_event_probe (srcpad,
|
||||
|
@ -292,7 +292,7 @@ GST_START_TEST (basesrc_eos_events_pull)
|
|||
g_object_set (src, "num-buffers", 8, NULL);
|
||||
|
||||
/* set up event probe to count EOS events */
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
fail_unless (srcpad != NULL);
|
||||
|
||||
probe = gst_pad_add_event_probe (srcpad,
|
||||
|
@ -362,7 +362,7 @@ GST_START_TEST (basesrc_eos_events_push_live_eos)
|
|||
g_object_set (src, "can-activate-pull", FALSE, NULL);
|
||||
|
||||
/* set up event probe to count EOS events */
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
fail_unless (srcpad != NULL);
|
||||
|
||||
probe = gst_pad_add_event_probe (srcpad,
|
||||
|
@ -439,7 +439,7 @@ GST_START_TEST (basesrc_eos_events_pull_live_eos)
|
|||
g_object_set (src, "can-activate-pull", TRUE, NULL);
|
||||
|
||||
/* set up event probe to count EOS events */
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
fail_unless (srcpad != NULL);
|
||||
|
||||
probe = gst_pad_add_event_probe (srcpad,
|
||||
|
|
|
@ -369,7 +369,7 @@ run_delayed_test (const gchar * pipe_str, const gchar * peer,
|
|||
fail_if (sink == NULL, "Test sink element was not created");
|
||||
|
||||
/* The src should not yet have a src pad */
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
fail_unless (srcpad == NULL, "Source element already has a source pad");
|
||||
|
||||
/* Set the state to PAUSED and wait until the src at least reaches that
|
||||
|
@ -383,7 +383,7 @@ run_delayed_test (const gchar * pipe_str, const gchar * peer,
|
|||
/* Now, the source element should have a src pad, and if "peer" was passed,
|
||||
* then the src pad should have gotten linked to the 'sink' pad of that
|
||||
* peer */
|
||||
srcpad = gst_element_get_pad (src, "src");
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
fail_if (srcpad == NULL, "Source element did not create source pad");
|
||||
|
||||
peerpad = gst_pad_get_peer (srcpad);
|
||||
|
@ -402,7 +402,7 @@ run_delayed_test (const gchar * pipe_str, const gchar * peer,
|
|||
|
||||
fail_if (peer_elem == NULL, "Could not retrieve peer %s", peer);
|
||||
|
||||
sinkpad = gst_element_get_pad (peer_elem, "sink");
|
||||
sinkpad = gst_element_get_static_pad (peer_elem, "sink");
|
||||
fail_if (sinkpad == NULL, "Peer element did not have a 'sink' pad");
|
||||
|
||||
fail_unless (peerpad == sinkpad,
|
||||
|
@ -521,7 +521,7 @@ gst_parse_test_element_change_state (GstElement * element,
|
|||
if (src->fakesrc == NULL)
|
||||
return GST_STATE_CHANGE_FAILURE;
|
||||
|
||||
pad = gst_element_get_pad (src->fakesrc, "src");
|
||||
pad = gst_element_get_static_pad (src->fakesrc, "src");
|
||||
if (pad == NULL)
|
||||
return GST_STATE_CHANGE_FAILURE;
|
||||
|
||||
|
|
Loading…
Reference in a new issue