fix pad template names for request pads

This commit is contained in:
Wim Taymans 2011-11-04 10:48:50 +01:00
parent 771cbbb17c
commit cf8481b990
15 changed files with 39 additions and 39 deletions

View file

@ -101,7 +101,7 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
GST_STATIC_CAPS ("application/ogg")
);
static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink_%d",
static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink_%u",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_STATIC_CAPS ("video/x-theora; "
@ -383,7 +383,7 @@ gst_ogg_mux_request_new_pad (GstElement * element,
klass = GST_ELEMENT_GET_CLASS (element);
if (templ != gst_element_class_get_pad_template (klass, "sink_%d"))
if (templ != gst_element_class_get_pad_template (klass, "sink_%u"))
goto wrong_template;
{
@ -407,7 +407,7 @@ gst_ogg_mux_request_new_pad (GstElement * element,
}
/* create new pad with the name */
GST_DEBUG_OBJECT (ogg_mux, "Creating new pad for serial %d", serial);
name = g_strdup_printf ("sink_%d", serial);
name = g_strdup_printf ("sink_%u", serial);
newpad = gst_pad_new_from_template (templ, name);
g_free (name);

View file

@ -89,7 +89,7 @@ GST_STATIC_PAD_TEMPLATE ("src",
);
static GstStaticPadTemplate gst_adder_sink_template =
GST_STATIC_PAD_TEMPLATE ("sink%d",
GST_STATIC_PAD_TEMPLATE ("sink_%u",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_STATIC_CAPS (CAPS)
@ -945,7 +945,7 @@ gst_adder_request_new_pad (GstElement * element, GstPadTemplate * templ,
padcount = g_atomic_int_exchange_and_add (&adder->padcount, 1);
#endif
name = g_strdup_printf ("sink%d", padcount);
name = g_strdup_printf ("sink_%u", padcount);
newpad = gst_pad_new_from_template (templ, name);
GST_DEBUG_OBJECT (adder, "request new pad %s", name);
g_free (name);

View file

@ -133,22 +133,22 @@ GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY);
static GstStaticPadTemplate video_sink_template =
GST_STATIC_PAD_TEMPLATE ("video_%d",
GST_STATIC_PAD_TEMPLATE ("video_%u",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_STATIC_CAPS_ANY);
static GstStaticPadTemplate audio_sink_template =
GST_STATIC_PAD_TEMPLATE ("audio_%d",
GST_STATIC_PAD_TEMPLATE ("audio_%u",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_STATIC_CAPS_ANY);
/* static GstStaticPadTemplate text_sink_template = */
/* GST_STATIC_PAD_TEMPLATE ("text_%d", */
/* GST_STATIC_PAD_TEMPLATE ("text_%u", */
/* GST_PAD_SINK, */
/* GST_PAD_REQUEST, */
/* GST_STATIC_CAPS_ANY); */
static GstStaticPadTemplate private_sink_template =
GST_STATIC_PAD_TEMPLATE ("private_%d",
GST_STATIC_PAD_TEMPLATE ("private_%u",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_STATIC_CAPS_ANY);
@ -706,11 +706,11 @@ gst_encode_bin_request_new_pad (GstElement * element,
if (res == NULL) {
GType ptype = G_TYPE_NONE;
if (!strcmp (templ->name_template, "video_%d"))
if (!strcmp (templ->name_template, "video_%u"))
ptype = GST_TYPE_ENCODING_VIDEO_PROFILE;
else if (!strcmp (templ->name_template, "audio_%d"))
else if (!strcmp (templ->name_template, "audio_%u"))
ptype = GST_TYPE_ENCODING_AUDIO_PROFILE;
/* else if (!strcmp (templ->name_template, "text_%d")) */
/* else if (!strcmp (templ->name_template, "text_%u")) */
/* ptype = GST_TYPE_ENCODING_TEXT_PROFILE; */
/* FIXME : Check uniqueness of pad */
@ -1133,7 +1133,7 @@ _create_stream_group (GstEncodeBin * ebin, GstEncodingProfile * sprof,
sinkpad = gst_element_get_static_pad (sgroup->inqueue, "sink");
if (sinkpadname == NULL) {
gchar *pname =
g_strdup_printf ("%s_%d", gst_encoding_profile_get_type_nick (sprof),
g_strdup_printf ("%s_%u", gst_encoding_profile_get_type_nick (sprof),
ebin->last_pad_id++);
GST_DEBUG ("Adding ghost pad %s", pname);
sgroup->ghostpad = gst_ghost_pad_new (pname, sinkpad);

View file

@ -28,7 +28,7 @@ static GstStaticPadTemplate src_template =
GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY);
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink_%d",
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink_%u",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_STATIC_CAPS_ANY);

View file

@ -25,7 +25,7 @@
#include "gststreamsplitter.h"
static GstStaticPadTemplate src_template =
GST_STATIC_PAD_TEMPLATE ("src_%d", GST_PAD_SRC, GST_PAD_REQUEST,
GST_STATIC_PAD_TEMPLATE ("src_%u", GST_PAD_SRC, GST_PAD_REQUEST,
GST_STATIC_CAPS_ANY);
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",

View file

@ -56,7 +56,7 @@ GST_STATIC_PAD_TEMPLATE ("sink",
GST_STATIC_CAPS_ANY);
static GstStaticPadTemplate decoder_bin_src_template =
GST_STATIC_PAD_TEMPLATE ("src%d",
GST_STATIC_PAD_TEMPLATE ("src_%u",
GST_PAD_SRC,
GST_PAD_SOMETIMES,
GST_STATIC_CAPS_ANY);
@ -92,7 +92,7 @@ struct _GstDecodeBin
GList *probes; /* list of PadProbeData */
GList *factories; /* factories we can use for selecting elements */
gint numpads;
guint numpads;
gint numwaiting;
gboolean have_type;
@ -917,7 +917,7 @@ close_pad_link (GstElement * element, GstPad * pad, GstCaps * caps,
}
/* make a unique name for this new pad */
padname = g_strdup_printf ("src%d", decode_bin->numpads);
padname = g_strdup_printf ("src_%u", decode_bin->numpads);
decode_bin->numpads++;
/* make it a ghostpad */

View file

@ -104,7 +104,7 @@ GST_STATIC_PAD_TEMPLATE ("sink",
GST_STATIC_CAPS_ANY);
static GstStaticPadTemplate decoder_bin_src_template =
GST_STATIC_PAD_TEMPLATE ("src%d",
GST_STATIC_PAD_TEMPLATE ("src_%u",
GST_PAD_SRC,
GST_PAD_SOMETIMES,
GST_STATIC_CAPS_ANY);
@ -152,7 +152,7 @@ struct _GstDecodeBin
GMutex *expose_lock; /* Protects exposal and removal of groups */
GstDecodeChain *decode_chain; /* Top level decode chain */
gint nbpads; /* unique identifier for source pads */
guint nbpads; /* unique identifier for source pads */
GMutex *factories_lock;
guint32 factories_cookie; /* Cookie from last time when factories was updated */
@ -3578,7 +3578,7 @@ gst_decode_bin_expose (GstDecodeBin * dbin)
gchar *padname;
/* 1. rewrite name */
padname = g_strdup_printf ("src%d", dbin->nbpads);
padname = g_strdup_printf ("src_%u", dbin->nbpads);
dbin->nbpads++;
GST_DEBUG_OBJECT (dbin, "About to expose dpad %s as %s",
GST_OBJECT_NAME (dpad), padname);

View file

@ -198,7 +198,7 @@ struct _GstPlaySink
gchar *font_desc; /* font description */
gchar *subtitle_encoding; /* subtitle encoding */
guint connection_speed; /* connection speed in bits/sec (0 = unknown) */
gint count;
guint count;
gboolean volume_changed; /* volume/mute changed while no audiochain */
gboolean mute_changed; /* ... has been created yet */
gint64 av_offset;
@ -2258,7 +2258,7 @@ gst_play_sink_reconfigure (GstPlaySink * playsink)
playsink->video_sinkpad_stream_synchronizer =
gst_element_get_request_pad (GST_ELEMENT_CAST
(playsink->stream_synchronizer), "sink_%d");
(playsink->stream_synchronizer), "sink_%u");
it = gst_pad_iterate_internal_links
(playsink->video_sinkpad_stream_synchronizer);
g_assert (it);
@ -2420,7 +2420,7 @@ gst_play_sink_reconfigure (GstPlaySink * playsink)
playsink->audio_sinkpad_stream_synchronizer =
gst_element_get_request_pad (GST_ELEMENT_CAST
(playsink->stream_synchronizer), "sink_%d");
(playsink->stream_synchronizer), "sink_%u");
it = gst_pad_iterate_internal_links
(playsink->audio_sinkpad_stream_synchronizer);
g_assert (it);
@ -2542,7 +2542,7 @@ gst_play_sink_reconfigure (GstPlaySink * playsink)
playsink->text_sinkpad_stream_synchronizer =
gst_element_get_request_pad (GST_ELEMENT_CAST
(playsink->stream_synchronizer), "sink_%d");
(playsink->stream_synchronizer), "sink_%u");
it = gst_pad_iterate_internal_links
(playsink->text_sinkpad_stream_synchronizer);
g_assert (it);
@ -3181,7 +3181,7 @@ gst_play_sink_request_pad (GstPlaySink * playsink, GstPlaySinkType type)
gchar *padname;
/* we need a unique padname for the flushing pad. */
padname = g_strdup_printf ("flushing_%d", playsink->count);
padname = g_strdup_printf ("flushing_%u", playsink->count);
res = gst_ghost_pad_new_no_target (padname, GST_PAD_SINK);
g_free (padname);
playsink->count++;

View file

@ -32,7 +32,7 @@ GST_DEBUG_CATEGORY_STATIC (stream_selector_debug);
#define GST_CAT_DEFAULT stream_selector_debug
static GstStaticPadTemplate gst_stream_selector_sink_factory =
GST_STATIC_PAD_TEMPLATE ("sink%d",
GST_STATIC_PAD_TEMPLATE ("sink_%u",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_STATIC_CAPS_ANY);
@ -647,7 +647,7 @@ gst_stream_selector_request_new_pad (GstElement * element,
g_return_val_if_fail (templ->direction == GST_PAD_SINK, NULL);
GST_LOG_OBJECT (sel, "Creating new pad %d", sel->padcount);
GST_OBJECT_LOCK (sel);
name = g_strdup_printf ("sink%d", sel->padcount++);
name = g_strdup_printf ("sink_%u", sel->padcount++);
sinkpad = g_object_new (GST_TYPE_SELECTOR_PAD,
"name", name, "direction", templ->direction, "template", templ, NULL);
g_free (name);

View file

@ -43,11 +43,11 @@ GST_DEBUG_CATEGORY_STATIC (stream_synchronizer_debug);
g_mutex_unlock (GST_STREAM_SYNCHRONIZER_CAST(obj)->lock); \
} G_STMT_END
static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src_%d",
static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src_%u",
GST_PAD_SRC,
GST_PAD_SOMETIMES,
GST_STATIC_CAPS_ANY);
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink_%d",
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink_%u",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_STATIC_CAPS_ANY);
@ -677,7 +677,7 @@ gst_stream_synchronizer_request_new_pad (GstElement * element,
stream->transform = self;
stream->stream_number = self->current_stream_number;
tmp = g_strdup_printf ("sink_%d", self->current_stream_number);
tmp = g_strdup_printf ("sink_%u", self->current_stream_number);
stream->sinkpad = gst_pad_new_from_static_template (&sinktemplate, tmp);
g_free (tmp);
gst_pad_set_element_private (stream->sinkpad, stream);
@ -694,7 +694,7 @@ gst_stream_synchronizer_request_new_pad (GstElement * element,
gst_pad_set_chain_function (stream->sinkpad,
GST_DEBUG_FUNCPTR (gst_stream_synchronizer_sink_chain));
tmp = g_strdup_printf ("src_%d", self->current_stream_number);
tmp = g_strdup_printf ("src_%u", self->current_stream_number);
stream->srcpad = gst_pad_new_from_static_template (&srctemplate, tmp);
g_free (tmp);
gst_pad_set_element_private (stream->srcpad, stream);

View file

@ -675,7 +675,7 @@ GST_START_TEST (test_remove_pad)
fail_unless (res == TRUE, NULL);
/* create an unconnected sinkpad in adder */
pad = gst_element_get_request_pad (adder, "sink%d");
pad = gst_element_get_request_pad (adder, "sink_%u");
fail_if (pad == NULL, NULL);
srcpad = gst_element_get_static_pad (adder, "src");
@ -777,7 +777,7 @@ GST_START_TEST (test_clip)
/* create an unconnected sinkpad in adder, should also automatically activate
* the pad */
sinkpad = gst_element_get_request_pad (adder, "sink%d");
sinkpad = gst_element_get_request_pad (adder, "sink_%u");
fail_if (sinkpad == NULL, NULL);
/* send segment to adder */

View file

@ -392,10 +392,10 @@ GST_START_TEST (test_request_pad_cleanup)
GstPad *pad;
oggmux = gst_element_factory_make ("oggmux", NULL);
pad = gst_element_get_request_pad (oggmux, "sink_%d");
pad = gst_element_get_request_pad (oggmux, "sink_%u");
fail_unless (pad != NULL);
gst_object_unref (pad);
pad = gst_element_get_request_pad (oggmux, "sink_%d");
pad = gst_element_get_request_pad (oggmux, "sink_%u");
fail_unless (pad != NULL);
gst_object_unref (pad);
gst_object_unref (oggmux);

View file

@ -64,7 +64,7 @@ add_source (gdouble freq)
info->srcpad = gst_element_get_static_pad (info->element, "src");
/* get new pad from adder, adder will now wait for data on this pad */
info->sinkpad = gst_element_get_request_pad (adder, "sink%d");
info->sinkpad = gst_element_get_request_pad (adder, "sink_%u");
/* link pad to adder */
gst_pad_link (info->srcpad, info->sinkpad);

View file

@ -74,7 +74,7 @@ add_source (gdouble freq, gfloat pos)
info->fx_sinkpad = gst_element_get_static_pad (info->fx, "sink");
/* get new pad from adder, adder will now wait for data on this pad */
info->adder_sinkpad = gst_element_get_request_pad (adder, "sink%d");
info->adder_sinkpad = gst_element_get_request_pad (adder, "sink_%u");
/* link src to fx and fx to adder */
gst_pad_link (info->fx_srcpad, info->adder_sinkpad);

View file

@ -80,7 +80,7 @@ add_source (gdouble freq, gfloat pos)
gst_element_add_pad (info->bin, info->bin_srcpad);
/* get new pad from adder, adder will now wait for data on this pad */
info->adder_sinkpad = gst_element_get_request_pad (adder, "sink%d");
info->adder_sinkpad = gst_element_get_request_pad (adder, "sink_%u");
/* link inside the bin */
gst_pad_link (info->src_srcpad, info->fx_sinkpad);