mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-29 10:38:27 +00:00
Introduce gst_element_request_pad_simple
The name `gst_element_get_request_pad()` is confusing to people learning GStreamer. `gst_element_request_pad_simple()` aims at providing the exact same functionality, while making it more explicit it is a simplified `gst_element_request_pad()`. `gst_element_request_pad_simple()` is consistent with other functions such as `gst_element_seek_simple`. This commit deprecates `gst_element_get_request_pad()` so that a compilation warning is emitted when used and incite developers to use the more explicit `gst_element_request_pad_simple()`. See also https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/743#note_886586 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/802>
This commit is contained in:
parent
77ab7b42b3
commit
1a8dfdfc54
16 changed files with 103 additions and 70 deletions
|
@ -152,7 +152,7 @@ static gboolean gst_element_default_query (GstElement * element,
|
|||
GstQuery * query);
|
||||
|
||||
static GstPadTemplate
|
||||
* gst_element_class_get_request_pad_template (GstElementClass *
|
||||
* gst_element_class_request_pad_simple_template (GstElementClass *
|
||||
element_class, const gchar * name);
|
||||
|
||||
static void gst_element_call_async_func (gpointer data, gpointer user_data);
|
||||
|
@ -1167,11 +1167,34 @@ _gst_element_request_pad (GstElement * element, GstPadTemplate * templ,
|
|||
return newpad;
|
||||
}
|
||||
|
||||
#ifndef GST_REMOVE_DEPRECATED
|
||||
/**
|
||||
* gst_element_get_request_pad:
|
||||
* @element: a #GstElement to find a request pad of.
|
||||
* @name: the name of the request #GstPad to retrieve.
|
||||
*
|
||||
* The name of this function is confusing to people learning GStreamer.
|
||||
* gst_element_request_pad_simple() aims at making it more explicit it is
|
||||
* a simplified gst_element_request_pad().
|
||||
*
|
||||
* Deprecated: 1.20: Prefer using gst_element_request_pad_simple() which
|
||||
* provides the exact same functionality.
|
||||
*
|
||||
* Returns: (transfer full) (nullable): requested #GstPad if found,
|
||||
* otherwise %NULL. Release after usage.
|
||||
*/
|
||||
GstPad *
|
||||
gst_element_get_request_pad (GstElement * element, const gchar * name)
|
||||
{
|
||||
return gst_element_request_pad_simple (element, name);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* gst_element_request_pad_simple:
|
||||
* @element: a #GstElement to find a request pad of.
|
||||
* @name: the name of the request #GstPad to retrieve.
|
||||
*
|
||||
* Retrieves a pad from the element by name (e.g. "src_\%d"). This version only
|
||||
* retrieves request pads. The pad should be released with
|
||||
* gst_element_release_request_pad().
|
||||
|
@ -1180,11 +1203,18 @@ _gst_element_request_pad (GstElement * element, GstPadTemplate * templ,
|
|||
* gst_element_request_pad() if the pads should have a specific name (e.g.
|
||||
* @name is "src_1" instead of "src_\%u").
|
||||
*
|
||||
* Note that this function was introduced in GStreamer 1.20 in order to provide
|
||||
* a better name to gst_element_get_request_pad(). Prior to 1.20, users
|
||||
* should use gst_element_get_request_pad() which provides the same
|
||||
* functionality.
|
||||
*
|
||||
* Returns: (transfer full) (nullable): requested #GstPad if found,
|
||||
* otherwise %NULL. Release after usage.
|
||||
*
|
||||
* Since: 1.20
|
||||
*/
|
||||
GstPad *
|
||||
gst_element_get_request_pad (GstElement * element, const gchar * name)
|
||||
gst_element_request_pad_simple (GstElement * element, const gchar * name)
|
||||
{
|
||||
GstPadTemplate *templ = NULL;
|
||||
GstPad *pad;
|
||||
|
@ -1198,7 +1228,7 @@ gst_element_get_request_pad (GstElement * element, const gchar * name)
|
|||
|
||||
class = GST_ELEMENT_GET_CLASS (element);
|
||||
|
||||
templ = gst_element_class_get_request_pad_template (class, name);
|
||||
templ = gst_element_class_request_pad_simple_template (class, name);
|
||||
if (templ) {
|
||||
req_name = strstr (name, "%") ? NULL : name;
|
||||
templ_found = TRUE;
|
||||
|
@ -1811,7 +1841,7 @@ gst_element_get_pad_template (GstElement * element, const gchar * name)
|
|||
}
|
||||
|
||||
static GstPadTemplate *
|
||||
gst_element_class_get_request_pad_template (GstElementClass *
|
||||
gst_element_class_request_pad_simple_template (GstElementClass *
|
||||
element_class, const gchar * name)
|
||||
{
|
||||
GstPadTemplate *tmpl;
|
||||
|
|
|
@ -1038,9 +1038,12 @@ void gst_element_no_more_pads (GstElement *element);
|
|||
GST_API
|
||||
GstPad* gst_element_get_static_pad (GstElement *element, const gchar *name);
|
||||
|
||||
GST_API
|
||||
GST_API G_DEPRECATED_FOR(gst_element_request_pad_simple)
|
||||
GstPad* gst_element_get_request_pad (GstElement *element, const gchar *name);
|
||||
|
||||
GST_API
|
||||
GstPad* gst_element_request_pad_simple (GstElement *element, const gchar *name);
|
||||
|
||||
GST_API
|
||||
GstPad* gst_element_request_pad (GstElement *element, GstPadTemplate *templ,
|
||||
const gchar * name, const GstCaps *caps);
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
* GST_PAD_TEMPLATE_DIRECTION().
|
||||
*
|
||||
* The GST_PAD_TEMPLATE_NAME_TEMPLATE () is important for GST_PAD_REQUEST pads
|
||||
* because it has to be used as the name in the gst_element_get_request_pad()
|
||||
* because it has to be used as the name in the gst_element_request_pad_simple()
|
||||
* call to instantiate a pad from this template.
|
||||
*
|
||||
* Padtemplates can be created with gst_pad_template_new() or with
|
||||
|
|
|
@ -1825,7 +1825,7 @@ gst_element_link_pads_full (GstElement * src, const gchar * srcpadname,
|
|||
if (srcpadname) {
|
||||
/* name specified, look it up */
|
||||
if (!(srcpad = gst_element_get_static_pad (src, srcpadname))) {
|
||||
if ((srcpad = gst_element_get_request_pad (src, srcpadname)))
|
||||
if ((srcpad = gst_element_request_pad_simple (src, srcpadname)))
|
||||
srcrequest = TRUE;
|
||||
}
|
||||
if (!srcpad) {
|
||||
|
@ -1864,7 +1864,7 @@ gst_element_link_pads_full (GstElement * src, const gchar * srcpadname,
|
|||
if (destpadname) {
|
||||
/* name specified, look it up */
|
||||
if (!(destpad = gst_element_get_static_pad (dest, destpadname))) {
|
||||
if ((destpad = gst_element_get_request_pad (dest, destpadname)))
|
||||
if ((destpad = gst_element_request_pad_simple (dest, destpadname)))
|
||||
destrequest = TRUE;
|
||||
}
|
||||
if (!destpad) {
|
||||
|
@ -2324,14 +2324,14 @@ gst_element_unlink_pads (GstElement * src, const gchar * srcpadname,
|
|||
|
||||
/* obtain the pads requested */
|
||||
if (!(srcpad = gst_element_get_static_pad (src, srcpadname)))
|
||||
if ((srcpad = gst_element_get_request_pad (src, srcpadname)))
|
||||
if ((srcpad = gst_element_request_pad_simple (src, srcpadname)))
|
||||
srcrequest = TRUE;
|
||||
if (srcpad == NULL) {
|
||||
GST_WARNING_OBJECT (src, "source element has no pad \"%s\"", srcpadname);
|
||||
return;
|
||||
}
|
||||
if (!(destpad = gst_element_get_static_pad (dest, destpadname)))
|
||||
if ((destpad = gst_element_get_request_pad (dest, destpadname)))
|
||||
if ((destpad = gst_element_request_pad_simple (dest, destpadname)))
|
||||
destrequest = TRUE;
|
||||
if (destpad == NULL) {
|
||||
GST_WARNING_OBJECT (dest, "destination element has no pad \"%s\"",
|
||||
|
|
|
@ -596,7 +596,7 @@ gst_check_setup_src_pad_by_name_from_template (GstElement * element,
|
|||
|
||||
sinkpad = gst_element_get_static_pad (element, name);
|
||||
if (sinkpad == NULL)
|
||||
sinkpad = gst_element_get_request_pad (element, name);
|
||||
sinkpad = gst_element_request_pad_simple (element, name);
|
||||
fail_if (sinkpad == NULL, "Could not get sink pad from %s",
|
||||
GST_ELEMENT_NAME (element));
|
||||
fail_unless (gst_pad_link (srcpad, sinkpad) == GST_PAD_LINK_OK,
|
||||
|
@ -721,7 +721,7 @@ gst_check_setup_sink_pad_by_name_from_template (GstElement * element,
|
|||
|
||||
srcpad = gst_element_get_static_pad (element, name);
|
||||
if (srcpad == NULL)
|
||||
srcpad = gst_element_get_request_pad (element, name);
|
||||
srcpad = gst_element_request_pad_simple (element, name);
|
||||
fail_if (srcpad == NULL, "Could not get source pad from %s",
|
||||
GST_ELEMENT_NAME (element));
|
||||
gst_pad_set_chain_function (sinkpad, gst_check_chain_func);
|
||||
|
|
|
@ -540,7 +540,7 @@ gst_harness_link_element_srcpad (GstHarness * h,
|
|||
element_srcpad_name);
|
||||
GstPadLinkReturn link;
|
||||
if (srcpad == NULL)
|
||||
srcpad = gst_element_get_request_pad (h->element, element_srcpad_name);
|
||||
srcpad = gst_element_request_pad_simple (h->element, element_srcpad_name);
|
||||
g_assert (srcpad);
|
||||
link = gst_pad_link (srcpad, h->sinkpad);
|
||||
g_assert_cmpint (link, ==, GST_PAD_LINK_OK);
|
||||
|
@ -559,7 +559,7 @@ gst_harness_link_element_sinkpad (GstHarness * h,
|
|||
element_sinkpad_name);
|
||||
GstPadLinkReturn link;
|
||||
if (sinkpad == NULL)
|
||||
sinkpad = gst_element_get_request_pad (h->element, element_sinkpad_name);
|
||||
sinkpad = gst_element_request_pad_simple (h->element, element_sinkpad_name);
|
||||
g_assert (sinkpad);
|
||||
link = gst_pad_link (h->srcpad, sinkpad);
|
||||
g_assert_cmpint (link, ==, GST_PAD_LINK_OK);
|
||||
|
|
|
@ -120,13 +120,13 @@ GST_START_TEST (test_concat_simple_time)
|
|||
concat = gst_element_factory_make ("concat", NULL);
|
||||
fail_unless (concat != NULL);
|
||||
|
||||
sink1 = gst_element_get_request_pad (concat, "sink_%u");
|
||||
sink1 = gst_element_request_pad_simple (concat, "sink_%u");
|
||||
fail_unless (sink1 != NULL);
|
||||
|
||||
sink2 = gst_element_get_request_pad (concat, "sink_%u");
|
||||
sink2 = gst_element_request_pad_simple (concat, "sink_%u");
|
||||
fail_unless (sink2 != NULL);
|
||||
|
||||
sink3 = gst_element_get_request_pad (concat, "sink_%u");
|
||||
sink3 = gst_element_request_pad_simple (concat, "sink_%u");
|
||||
fail_unless (sink3 != NULL);
|
||||
|
||||
src = gst_element_get_static_pad (concat, "src");
|
||||
|
@ -242,13 +242,13 @@ GST_START_TEST (test_concat_simple_bytes)
|
|||
concat = gst_element_factory_make ("concat", NULL);
|
||||
fail_unless (concat != NULL);
|
||||
|
||||
sink1 = gst_element_get_request_pad (concat, "sink_%u");
|
||||
sink1 = gst_element_request_pad_simple (concat, "sink_%u");
|
||||
fail_unless (sink1 != NULL);
|
||||
|
||||
sink2 = gst_element_get_request_pad (concat, "sink_%u");
|
||||
sink2 = gst_element_request_pad_simple (concat, "sink_%u");
|
||||
fail_unless (sink2 != NULL);
|
||||
|
||||
sink3 = gst_element_get_request_pad (concat, "sink_%u");
|
||||
sink3 = gst_element_request_pad_simple (concat, "sink_%u");
|
||||
fail_unless (sink3 != NULL);
|
||||
|
||||
src = gst_element_get_static_pad (concat, "src");
|
||||
|
|
|
@ -44,11 +44,11 @@ setup_test_objects (struct TestData *td, GstPadChainFunction chain_func)
|
|||
td->funnelsrc = gst_element_get_static_pad (td->funnel, "src");
|
||||
fail_unless (td->funnelsrc != NULL);
|
||||
|
||||
td->funnelsink11 = gst_element_get_request_pad (td->funnel, "sink_11");
|
||||
td->funnelsink11 = gst_element_request_pad_simple (td->funnel, "sink_11");
|
||||
fail_unless (td->funnelsink11 != NULL);
|
||||
fail_unless (!strcmp (GST_OBJECT_NAME (td->funnelsink11), "sink_11"));
|
||||
|
||||
td->funnelsink22 = gst_element_get_request_pad (td->funnel, "sink_22");
|
||||
td->funnelsink22 = gst_element_request_pad_simple (td->funnel, "sink_22");
|
||||
fail_unless (td->funnelsink22 != NULL);
|
||||
fail_unless (!strcmp (GST_OBJECT_NAME (td->funnelsink22), "sink_22"));
|
||||
|
||||
|
@ -197,7 +197,7 @@ GST_START_TEST (test_funnel_eos)
|
|||
gst_object_unref (td.funnelsink11);
|
||||
fail_unless (num_eos == 2);
|
||||
|
||||
td.funnelsink11 = gst_element_get_request_pad (td.funnel, "sink_11");
|
||||
td.funnelsink11 = gst_element_request_pad_simple (td.funnel, "sink_11");
|
||||
fail_unless (td.funnelsink11 != NULL);
|
||||
fail_unless (!strcmp (GST_OBJECT_NAME (td.funnelsink11), "sink_11"));
|
||||
|
||||
|
@ -214,7 +214,7 @@ GST_START_TEST (test_funnel_eos)
|
|||
fail_unless (num_eos == 2);
|
||||
|
||||
/* send only eos to check, it handles empty streams */
|
||||
td.funnelsink11 = gst_element_get_request_pad (td.funnel, "sink_11");
|
||||
td.funnelsink11 = gst_element_request_pad_simple (td.funnel, "sink_11");
|
||||
fail_unless (td.funnelsink11 != NULL);
|
||||
fail_unless (!strcmp (GST_OBJECT_NAME (td.funnelsink11), "sink_11"));
|
||||
|
||||
|
@ -235,7 +235,7 @@ GST_START_TEST (test_funnel_eos)
|
|||
gst_object_unref (td.funnelsink11);
|
||||
fail_unless (num_eos == 3);
|
||||
|
||||
td.funnelsink11 = gst_element_get_request_pad (td.funnel, "sink_11");
|
||||
td.funnelsink11 = gst_element_request_pad_simple (td.funnel, "sink_11");
|
||||
fail_unless (td.funnelsink11 != NULL);
|
||||
fail_unless (!strcmp (GST_OBJECT_NAME (td.funnelsink11), "sink_11"));
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ setup_multiqueue (GstElement * pipe, GstElement * inputs[],
|
|||
GstPad *srcpad = NULL;
|
||||
|
||||
/* create multiqueue sink (and source) pad */
|
||||
sinkpad = gst_element_get_request_pad (mq, "sink_%u");
|
||||
sinkpad = gst_element_request_pad_simple (mq, "sink_%u");
|
||||
fail_unless (sinkpad != NULL,
|
||||
"failed to create multiqueue request pad #%u", i);
|
||||
|
||||
|
@ -67,7 +67,7 @@ setup_multiqueue (GstElement * pipe, GstElement * inputs[],
|
|||
|
||||
/* only the sink pads are by request, the source pads are sometimes pads,
|
||||
* so this should return NULL */
|
||||
srcpad = gst_element_get_request_pad (mq, "src_%u");
|
||||
srcpad = gst_element_request_pad_simple (mq, "src_%u");
|
||||
fail_unless (srcpad == NULL);
|
||||
|
||||
g_snprintf (padname, sizeof (padname), "src_%u", i);
|
||||
|
@ -194,21 +194,21 @@ GST_START_TEST (test_request_pads)
|
|||
|
||||
mq = gst_element_factory_make ("multiqueue", NULL);
|
||||
|
||||
sink1 = gst_element_get_request_pad (mq, "foo_%u");
|
||||
sink1 = gst_element_request_pad_simple (mq, "foo_%u");
|
||||
fail_unless (sink1 == NULL,
|
||||
"Expected NULL pad, as there is no request pad template for 'foo_%%u'");
|
||||
|
||||
sink1 = gst_element_get_request_pad (mq, "src_%u");
|
||||
sink1 = gst_element_request_pad_simple (mq, "src_%u");
|
||||
fail_unless (sink1 == NULL,
|
||||
"Expected NULL pad, as there is no request pad template for 'src_%%u'");
|
||||
|
||||
sink1 = gst_element_get_request_pad (mq, "sink_%u");
|
||||
sink1 = gst_element_request_pad_simple (mq, "sink_%u");
|
||||
fail_unless (sink1 != NULL);
|
||||
fail_unless (GST_IS_PAD (sink1));
|
||||
fail_unless (GST_PAD_IS_SINK (sink1));
|
||||
GST_LOG ("Got pad %s:%s", GST_DEBUG_PAD_NAME (sink1));
|
||||
|
||||
sink2 = gst_element_get_request_pad (mq, "sink_%u");
|
||||
sink2 = gst_element_request_pad_simple (mq, "sink_%u");
|
||||
fail_unless (sink2 != NULL);
|
||||
fail_unless (GST_IS_PAD (sink2));
|
||||
fail_unless (GST_PAD_IS_SINK (sink2));
|
||||
|
@ -251,21 +251,21 @@ GST_START_TEST (test_request_pads_named)
|
|||
|
||||
mq = gst_element_factory_make ("multiqueue", NULL);
|
||||
|
||||
sink1 = gst_element_get_request_pad (mq, "sink_1");
|
||||
sink1 = gst_element_request_pad_simple (mq, "sink_1");
|
||||
fail_unless (sink1 != NULL);
|
||||
fail_unless (GST_IS_PAD (sink1));
|
||||
fail_unless (GST_PAD_IS_SINK (sink1));
|
||||
fail_unless_equals_string (GST_PAD_NAME (sink1), "sink_1");
|
||||
GST_LOG ("Got pad %s:%s", GST_DEBUG_PAD_NAME (sink1));
|
||||
|
||||
sink3 = gst_element_get_request_pad (mq, "sink_3");
|
||||
sink3 = gst_element_request_pad_simple (mq, "sink_3");
|
||||
fail_unless (sink3 != NULL);
|
||||
fail_unless (GST_IS_PAD (sink3));
|
||||
fail_unless (GST_PAD_IS_SINK (sink3));
|
||||
fail_unless_equals_string (GST_PAD_NAME (sink3), "sink_3");
|
||||
GST_LOG ("Got pad %s:%s", GST_DEBUG_PAD_NAME (sink3));
|
||||
|
||||
sink2 = gst_element_get_request_pad (mq, "sink_2");
|
||||
sink2 = gst_element_request_pad_simple (mq, "sink_2");
|
||||
fail_unless (sink2 != NULL);
|
||||
fail_unless (GST_IS_PAD (sink2));
|
||||
fail_unless (GST_PAD_IS_SINK (sink2));
|
||||
|
@ -273,7 +273,7 @@ GST_START_TEST (test_request_pads_named)
|
|||
GST_LOG ("Got pad %s:%s", GST_DEBUG_PAD_NAME (sink2));
|
||||
|
||||
/* This gets us the first unused id, sink0 */
|
||||
sink4 = gst_element_get_request_pad (mq, "sink_%u");
|
||||
sink4 = gst_element_request_pad_simple (mq, "sink_%u");
|
||||
fail_unless (sink4 != NULL);
|
||||
fail_unless (GST_IS_PAD (sink4));
|
||||
fail_unless (GST_PAD_IS_SINK (sink4));
|
||||
|
@ -431,7 +431,7 @@ construct_n_pads (GstElement * mq, struct PadData *pad_data, gint n_pads,
|
|||
g_free (name);
|
||||
gst_pad_set_query_function (inpad, mq_dummypad_query);
|
||||
|
||||
mq_sinkpad = gst_element_get_request_pad (mq, "sink_%u");
|
||||
mq_sinkpad = gst_element_request_pad_simple (mq, "sink_%u");
|
||||
fail_unless (mq_sinkpad != NULL);
|
||||
fail_unless (gst_pad_link (inpad, mq_sinkpad) == GST_PAD_LINK_OK);
|
||||
|
||||
|
@ -749,7 +749,7 @@ GST_START_TEST (test_sparse_stream)
|
|||
g_free (name);
|
||||
gst_pad_set_query_function (inputpads[i], mq_dummypad_query);
|
||||
|
||||
mq_sinkpad = gst_element_get_request_pad (mq, "sink_%u");
|
||||
mq_sinkpad = gst_element_request_pad_simple (mq, "sink_%u");
|
||||
fail_unless (mq_sinkpad != NULL);
|
||||
fail_unless (gst_pad_link (inputpads[i], mq_sinkpad) == GST_PAD_LINK_OK);
|
||||
|
||||
|
@ -950,7 +950,7 @@ GST_START_TEST (test_initial_fill_above_high_threshold)
|
|||
inputpad = gst_pad_new ("dummysrc", GST_PAD_SRC);
|
||||
gst_pad_set_query_function (inputpad, mq_dummypad_query);
|
||||
|
||||
mq_sinkpad = gst_element_get_request_pad (mq, "sink_%u");
|
||||
mq_sinkpad = gst_element_request_pad_simple (mq, "sink_%u");
|
||||
fail_unless (mq_sinkpad != NULL);
|
||||
fail_unless (gst_pad_link (inputpad, mq_sinkpad) == GST_PAD_LINK_OK);
|
||||
|
||||
|
@ -1038,7 +1038,7 @@ GST_START_TEST (test_watermark_and_fill_level)
|
|||
inputpad = gst_pad_new ("dummysrc", GST_PAD_SRC);
|
||||
gst_pad_set_query_function (inputpad, mq_dummypad_query);
|
||||
|
||||
mq_sinkpad = gst_element_get_request_pad (mq, "sink_%u");
|
||||
mq_sinkpad = gst_element_request_pad_simple (mq, "sink_%u");
|
||||
fail_unless (mq_sinkpad != NULL);
|
||||
fail_unless (gst_pad_link (inputpad, mq_sinkpad) == GST_PAD_LINK_OK);
|
||||
|
||||
|
@ -1136,7 +1136,7 @@ GST_START_TEST (test_high_threshold_change)
|
|||
inputpad = gst_pad_new ("dummysrc", GST_PAD_SRC);
|
||||
gst_pad_set_query_function (inputpad, mq_dummypad_query);
|
||||
|
||||
mq_sinkpad = gst_element_get_request_pad (mq, "sink_%u");
|
||||
mq_sinkpad = gst_element_request_pad_simple (mq, "sink_%u");
|
||||
fail_unless (mq_sinkpad != NULL);
|
||||
fail_unless (gst_pad_link (inputpad, mq_sinkpad) == GST_PAD_LINK_OK);
|
||||
|
||||
|
@ -1231,7 +1231,7 @@ GST_START_TEST (test_low_threshold_change)
|
|||
inputpad = gst_pad_new ("dummysrc", GST_PAD_SRC);
|
||||
gst_pad_set_query_function (inputpad, mq_dummypad_query);
|
||||
|
||||
mq_sinkpad = gst_element_get_request_pad (mq, "sink_%u");
|
||||
mq_sinkpad = gst_element_request_pad_simple (mq, "sink_%u");
|
||||
fail_unless (mq_sinkpad != NULL);
|
||||
fail_unless (gst_pad_link (inputpad, mq_sinkpad) == GST_PAD_LINK_OK);
|
||||
|
||||
|
@ -1319,7 +1319,7 @@ GST_START_TEST (test_limit_changes)
|
|||
inputpad = gst_pad_new ("dummysrc", GST_PAD_SRC);
|
||||
gst_pad_set_query_function (inputpad, mq_dummypad_query);
|
||||
|
||||
mq_sinkpad = gst_element_get_request_pad (mq, "sink_%u");
|
||||
mq_sinkpad = gst_element_request_pad_simple (mq, "sink_%u");
|
||||
fail_unless (mq_sinkpad != NULL);
|
||||
fail_unless (gst_pad_link (inputpad, mq_sinkpad) == GST_PAD_LINK_OK);
|
||||
|
||||
|
@ -1440,7 +1440,7 @@ GST_START_TEST (test_buffering_with_none_pts)
|
|||
outputpad = gst_pad_new ("dummysink", GST_PAD_SINK);
|
||||
gst_pad_set_chain_function (outputpad, pad_chain_block);
|
||||
gst_pad_set_event_function (outputpad, pad_event_always_ok);
|
||||
mq_sinkpad = gst_element_get_request_pad (mq, "sink_%u");
|
||||
mq_sinkpad = gst_element_request_pad_simple (mq, "sink_%u");
|
||||
mq_srcpad = gst_element_get_static_pad (mq, "src_0");
|
||||
fail_unless (mq_sinkpad != NULL);
|
||||
fail_unless (gst_pad_link (inputpad, mq_sinkpad) == GST_PAD_LINK_OK);
|
||||
|
@ -1536,7 +1536,7 @@ GST_START_TEST (test_initial_events_nodelay)
|
|||
|
||||
inputpad = gst_pad_new ("dummysrc", GST_PAD_SRC);
|
||||
|
||||
mq_sinkpad = gst_element_get_request_pad (mq, "sink_%u");
|
||||
mq_sinkpad = gst_element_request_pad_simple (mq, "sink_%u");
|
||||
fail_unless (mq_sinkpad != NULL);
|
||||
fail_unless (gst_pad_link (inputpad, mq_sinkpad) == GST_PAD_LINK_OK);
|
||||
|
||||
|
@ -1641,7 +1641,7 @@ GST_START_TEST (test_stream_status_messages)
|
|||
|
||||
gst_bin_add (GST_BIN (pipe), mq);
|
||||
|
||||
pad = gst_element_get_request_pad (mq, "sink_%u");
|
||||
pad = gst_element_request_pad_simple (mq, "sink_%u");
|
||||
gst_object_unref (pad);
|
||||
|
||||
gst_element_set_state (pipe, GST_STATE_PAUSED);
|
||||
|
@ -1649,7 +1649,7 @@ GST_START_TEST (test_stream_status_messages)
|
|||
check_for_stream_status_msg (pipe, mq, GST_STREAM_STATUS_TYPE_CREATE);
|
||||
check_for_stream_status_msg (pipe, mq, GST_STREAM_STATUS_TYPE_ENTER);
|
||||
|
||||
pad = gst_element_get_request_pad (mq, "sink_%u");
|
||||
pad = gst_element_request_pad_simple (mq, "sink_%u");
|
||||
gst_object_unref (pad);
|
||||
|
||||
check_for_stream_status_msg (pipe, mq, GST_STREAM_STATUS_TYPE_CREATE);
|
||||
|
|
|
@ -85,7 +85,7 @@ setup_output_pad (GstElement * element, GstStaticPadTemplate * tmpl)
|
|||
GINT_TO_POINTER (probe_id));
|
||||
|
||||
/* request src pad */
|
||||
srcpad = gst_element_get_request_pad (element, "src_%u");
|
||||
srcpad = gst_element_request_pad_simple (element, "src_%u");
|
||||
fail_if (srcpad == NULL, "Could not get source pad from %s",
|
||||
GST_ELEMENT_NAME (element));
|
||||
|
||||
|
@ -303,7 +303,7 @@ setup_input_pad (GstElement * element)
|
|||
fail_if (input_pad == NULL, "Could not create a input_pad");
|
||||
|
||||
/* request sink pad */
|
||||
sinkpad = gst_element_get_request_pad (element, "sink_%u");
|
||||
sinkpad = gst_element_request_pad_simple (element, "sink_%u");
|
||||
fail_if (sinkpad == NULL, "Could not get sink pad from %s",
|
||||
GST_ELEMENT_NAME (element));
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ GST_START_TEST (test_num_buffers)
|
|||
g_object_set (sinks[i], "signal-handoffs", TRUE, NULL);
|
||||
g_signal_connect (sinks[i], "handoff", (GCallback) handoff, &counts[i]);
|
||||
|
||||
req_pads[i] = gst_element_get_request_pad (tee, "src_%u");
|
||||
req_pads[i] = gst_element_request_pad_simple (tee, "src_%u");
|
||||
fail_unless (req_pads[i] != NULL);
|
||||
|
||||
qpad = gst_element_get_static_pad (queues[i], "sink");
|
||||
|
@ -142,7 +142,7 @@ GST_START_TEST (test_stress)
|
|||
for (i = 0; i < 50000; i++) {
|
||||
GstPad *pad;
|
||||
|
||||
pad = gst_element_get_request_pad (tee, "src_%u");
|
||||
pad = gst_element_request_pad_simple (tee, "src_%u");
|
||||
gst_element_release_request_pad (tee, pad);
|
||||
gst_object_unref (pad);
|
||||
|
||||
|
@ -201,7 +201,7 @@ buffer_alloc_harness_setup (BufferAllocHarness * h, gint countdown)
|
|||
h->tee_sinkpad = gst_element_get_static_pad (h->tee, "sink");
|
||||
fail_if (h->tee_sinkpad == NULL);
|
||||
|
||||
h->tee_srcpad = gst_element_get_request_pad (h->tee, "src_%u");
|
||||
h->tee_srcpad = gst_element_request_pad_simple (h->tee, "src_%u");
|
||||
fail_if (h->tee_srcpad == NULL);
|
||||
|
||||
h->final_sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
|
||||
|
@ -353,7 +353,7 @@ GST_START_TEST (test_internal_links)
|
|||
fail_unless (res == GST_ITERATOR_DONE);
|
||||
fail_unless (g_value_get_object (&val1) == NULL);
|
||||
|
||||
srcpad1 = gst_element_get_request_pad (tee, "src_%u");
|
||||
srcpad1 = gst_element_request_pad_simple (tee, "src_%u");
|
||||
fail_unless (srcpad1 != NULL);
|
||||
|
||||
/* iterator should resync */
|
||||
|
@ -373,7 +373,7 @@ GST_START_TEST (test_internal_links)
|
|||
fail_unless (res == GST_ITERATOR_DONE);
|
||||
fail_unless (g_value_get_object (&val1) == NULL);
|
||||
|
||||
srcpad2 = gst_element_get_request_pad (tee, "src_%u");
|
||||
srcpad2 = gst_element_request_pad_simple (tee, "src_%u");
|
||||
fail_unless (srcpad2 != NULL);
|
||||
|
||||
/* iterator should resync */
|
||||
|
@ -467,9 +467,9 @@ GST_START_TEST (test_flow_aggregation)
|
|||
fail_unless (tee != NULL);
|
||||
teesink = gst_element_get_static_pad (tee, "sink");
|
||||
fail_unless (teesink != NULL);
|
||||
teesrc1 = gst_element_get_request_pad (tee, "src_%u");
|
||||
teesrc1 = gst_element_request_pad_simple (tee, "src_%u");
|
||||
fail_unless (teesrc1 != NULL);
|
||||
teesrc2 = gst_element_get_request_pad (tee, "src_%u");
|
||||
teesrc2 = gst_element_request_pad_simple (tee, "src_%u");
|
||||
fail_unless (teesrc2 != NULL);
|
||||
|
||||
GST_DEBUG ("Creating mysink1");
|
||||
|
@ -602,16 +602,16 @@ GST_START_TEST (test_request_pads)
|
|||
|
||||
tee = gst_check_setup_element ("tee");
|
||||
|
||||
srcpad1 = gst_element_get_request_pad (tee, "src_%u");
|
||||
srcpad1 = gst_element_request_pad_simple (tee, "src_%u");
|
||||
fail_unless (srcpad1 != NULL);
|
||||
fail_unless_equals_string (GST_OBJECT_NAME (srcpad1), "src_0");
|
||||
srcpad2 = gst_element_get_request_pad (tee, "src_100");
|
||||
srcpad2 = gst_element_request_pad_simple (tee, "src_100");
|
||||
fail_unless (srcpad2 != NULL);
|
||||
fail_unless_equals_string (GST_OBJECT_NAME (srcpad2), "src_100");
|
||||
srcpad3 = gst_element_get_request_pad (tee, "src_10");
|
||||
srcpad3 = gst_element_request_pad_simple (tee, "src_10");
|
||||
fail_unless (srcpad3 != NULL);
|
||||
fail_unless_equals_string (GST_OBJECT_NAME (srcpad3), "src_10");
|
||||
srcpad4 = gst_element_get_request_pad (tee, "src_%u");
|
||||
srcpad4 = gst_element_request_pad_simple (tee, "src_%u");
|
||||
fail_unless (srcpad4 != NULL);
|
||||
|
||||
gst_object_unref (srcpad1);
|
||||
|
@ -661,11 +661,11 @@ GST_START_TEST (test_allow_not_linked)
|
|||
|
||||
fail_unless (gst_pad_push (srcpad, gst_buffer_ref (buffer)) == GST_FLOW_OK);
|
||||
|
||||
src1 = gst_element_get_request_pad (tee, "src_%u");
|
||||
src1 = gst_element_request_pad_simple (tee, "src_%u");
|
||||
|
||||
fail_unless (gst_pad_push (srcpad, gst_buffer_ref (buffer)) == GST_FLOW_OK);
|
||||
|
||||
src2 = gst_element_get_request_pad (tee, "src_%u");
|
||||
src2 = gst_element_request_pad_simple (tee, "src_%u");
|
||||
|
||||
fail_unless (gst_pad_push (srcpad, gst_buffer_ref (buffer)) == GST_FLOW_OK);
|
||||
|
||||
|
@ -850,7 +850,7 @@ GST_START_TEST (test_allocation_query_allow_not_linked)
|
|||
add_sink_pad_and_setup_query_func (tee, allocation_query3);
|
||||
/* This unlinked pad is what will make a difference between having
|
||||
* allow-not-linked set or not */
|
||||
srcpad = gst_element_get_request_pad (tee, "src_%u");
|
||||
srcpad = gst_element_request_pad_simple (tee, "src_%u");
|
||||
caps = gst_caps_new_empty_simple ("test/test");
|
||||
|
||||
/* Without allow-not-linked the query should fail */
|
||||
|
|
|
@ -729,7 +729,7 @@ GST_START_TEST (test_request_pad_templates)
|
|||
pad_name = (const gchar *) key;
|
||||
templ_name = (const gchar *) value;
|
||||
|
||||
pad = gst_element_get_request_pad (GST_ELEMENT (test), pad_name);
|
||||
pad = gst_element_request_pad_simple (GST_ELEMENT (test), pad_name);
|
||||
fail_unless (pad != NULL);
|
||||
gst_element_release_request_pad (GST_ELEMENT (test), pad);
|
||||
gst_object_unref (pad);
|
||||
|
@ -748,7 +748,7 @@ GST_START_TEST (test_request_pad_templates)
|
|||
while (item) {
|
||||
pad_name = (const gchar *) (item->data);
|
||||
item = g_slist_next (item);
|
||||
pad = gst_element_get_request_pad (GST_ELEMENT (test), pad_name);
|
||||
pad = gst_element_request_pad_simple (GST_ELEMENT (test), pad_name);
|
||||
fail_unless (pad == NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -984,12 +984,12 @@ GST_START_TEST (test_pad_proxy_query_caps_aggregation)
|
|||
tee = gst_element_factory_make ("tee", "tee");
|
||||
|
||||
sink1 = gst_element_factory_make ("fakesink", "sink1");
|
||||
tee_src1 = gst_element_get_request_pad (tee, "src_%u");
|
||||
tee_src1 = gst_element_request_pad_simple (tee, "src_%u");
|
||||
sink1_sink = gst_element_get_static_pad (sink1, "sink");
|
||||
fail_unless_equals_int (gst_pad_link (tee_src1, sink1_sink), GST_PAD_LINK_OK);
|
||||
|
||||
sink2 = gst_element_factory_make ("fakesink", "sink2");
|
||||
tee_src2 = gst_element_get_request_pad (tee, "src_%u");
|
||||
tee_src2 = gst_element_request_pad_simple (tee, "src_%u");
|
||||
sink2_sink = gst_element_get_static_pad (sink2, "sink");
|
||||
fail_unless_equals_int (gst_pad_link (tee_src2, sink2_sink), GST_PAD_LINK_OK);
|
||||
|
||||
|
|
|
@ -388,7 +388,7 @@ _chain_data_init (ChainData * data, GstElement * agg, ...)
|
|||
g_free (pad_name);
|
||||
gst_pad_set_active (data->srcpad, TRUE);
|
||||
data->aggregator = agg;
|
||||
data->sinkpad = gst_element_get_request_pad (agg, "sink_%u");
|
||||
data->sinkpad = gst_element_request_pad_simple (agg, "sink_%u");
|
||||
fail_unless (GST_IS_PAD (data->sinkpad));
|
||||
fail_unless (gst_pad_link (data->srcpad, data->sinkpad) == GST_PAD_LINK_OK);
|
||||
|
||||
|
|
|
@ -836,7 +836,7 @@ setup_src_pad (GstElement * element,
|
|||
GstPad *srcpad, *sinkpad;
|
||||
|
||||
srcpad = gst_pad_new_from_static_template (tmpl, "src");
|
||||
sinkpad = gst_element_get_request_pad (element, name);
|
||||
sinkpad = gst_element_request_pad_simple (element, name);
|
||||
fail_unless (gst_pad_link (srcpad, sinkpad) == GST_PAD_LINK_OK,
|
||||
"Could not link source and %s sink pads", GST_ELEMENT_NAME (element));
|
||||
gst_pad_set_event_function (srcpad, src_event);
|
||||
|
|
|
@ -69,7 +69,7 @@ sink_do_reconfigure (App * app)
|
|||
|
||||
for (i = 0; i < NUM_STREAM; i++) {
|
||||
sync_sinkpad[i] =
|
||||
gst_element_get_request_pad (app->stream_synchronizer, "sink_%u");
|
||||
gst_element_request_pad_simple (app->stream_synchronizer, "sink_%u");
|
||||
it = gst_pad_iterate_internal_links (sync_sinkpad[i]);
|
||||
g_assert (it);
|
||||
gst_iterator_next (it, &item);
|
||||
|
@ -210,7 +210,7 @@ main (gint argc, gchar * argv[])
|
|||
|
||||
for (stream_cnt = 0; stream_cnt < NUM_STREAM; stream_cnt++) {
|
||||
funnel_sinkpad[stream_cnt] =
|
||||
gst_element_get_request_pad (app->funnel, "sink_%u");
|
||||
gst_element_request_pad_simple (app->funnel, "sink_%u");
|
||||
oggmux_srcpad[stream_cnt] =
|
||||
gst_element_get_static_pad (app->oggmux[stream_cnt], "src");
|
||||
gst_pad_link (oggmux_srcpad[stream_cnt], funnel_sinkpad[stream_cnt]);
|
||||
|
|
Loading…
Reference in a new issue