make %u in all request pad templates

This commit is contained in:
Wim Taymans 2011-11-04 11:58:22 +01:00
parent 2b29d9852c
commit a95acb7122
16 changed files with 136 additions and 138 deletions

View file

@ -89,7 +89,7 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
);
static GstStaticPadTemplate video_sink_factory =
GST_STATIC_PAD_TEMPLATE ("video_%d",
GST_STATIC_PAD_TEMPLATE ("video_%u",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_STATIC_CAPS ("video/x-raw, "
@ -158,7 +158,7 @@ static GstStaticPadTemplate video_sink_factory =
);
static GstStaticPadTemplate audio_sink_factory =
GST_STATIC_PAD_TEMPLATE ("audio_%d",
GST_STATIC_PAD_TEMPLATE ("audio_%u",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_STATIC_CAPS ("audio/x-raw, "
@ -936,15 +936,13 @@ gst_avi_mux_request_new_pad (GstElement * element,
klass = GST_ELEMENT_GET_CLASS (element);
/* FIXME-0.11: use %d instead of %02d for pad_names */
if (templ == gst_element_class_get_pad_template (klass, "audio_%d")) {
if (templ == gst_element_class_get_pad_template (klass, "audio_%u")) {
/* don't mix named and unnamed pads, if the pad already exists we fail when
* trying to add it */
if (req_name != NULL && sscanf (req_name, "audio_%02d", &pad_id) == 1) {
if (req_name != NULL && sscanf (req_name, "audio_%u", &pad_id) == 1) {
pad_name = req_name;
} else {
name = g_strdup_printf ("audio_%02d", avimux->audio_pads++);
name = g_strdup_printf ("audio_%u", avimux->audio_pads++);
pad_name = name;
}
@ -954,7 +952,7 @@ gst_avi_mux_request_new_pad (GstElement * element,
avipad->hdr.type = GST_MAKE_FOURCC ('a', 'u', 'd', 's');
/* audio goes last */
avimux->sinkpads = g_slist_append (avimux->sinkpads, avipad);
} else if (templ == gst_element_class_get_pad_template (klass, "video_%d")) {
} else if (templ == gst_element_class_get_pad_template (klass, "video_%u")) {
/* though streams are pretty generic and relatively self-contained,
* some video info goes in a single avi header -and therefore mux struct-
* so video restricted to one stream */
@ -962,7 +960,7 @@ gst_avi_mux_request_new_pad (GstElement * element,
goto too_many_video_pads;
/* setup pad */
pad_name = "video_00";
pad_name = "video_0";
avimux->video_pads++;
/* init pad specific data */

View file

@ -70,7 +70,7 @@
GST_DEBUG_CATEGORY_STATIC (gst_interleave_debug);
#define GST_CAT_DEFAULT gst_interleave_debug
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 ("audio/x-raw-int, "
@ -487,7 +487,7 @@ gst_interleave_request_new_pad (GstElement * element, GstPadTemplate * templ,
padnumber = g_atomic_int_exchange_and_add (&self->padcounter, 1);
#endif
pad_name = g_strdup_printf ("sink%d", padnumber);
pad_name = g_strdup_printf ("sink_%u", padnumber);
new_pad = GST_PAD_CAST (g_object_new (GST_TYPE_INTERLEAVE_PAD,
"name", pad_name, "direction", templ->direction,
"template", templ, NULL));

View file

@ -265,13 +265,13 @@ gst_qt_mux_base_init (gpointer g_class)
gst_element_class_add_pad_template (element_class, srctempl);
if (params->audio_sink_caps) {
audiosinktempl = gst_pad_template_new ("audio_%d",
audiosinktempl = gst_pad_template_new ("audio_%u",
GST_PAD_SINK, GST_PAD_REQUEST, params->audio_sink_caps);
gst_element_class_add_pad_template (element_class, audiosinktempl);
}
if (params->video_sink_caps) {
videosinktempl = gst_pad_template_new ("video_%d",
videosinktempl = gst_pad_template_new ("video_%u",
GST_PAD_SINK, GST_PAD_REQUEST, params->video_sink_caps);
gst_element_class_add_pad_template (element_class, videosinktempl);
}
@ -3395,19 +3395,19 @@ gst_qt_mux_request_new_pad (GstElement * element,
if (qtmux->state > GST_QT_MUX_STATE_STARTED)
goto too_late;
if (templ == gst_element_class_get_pad_template (klass, "audio_%d")) {
if (templ == gst_element_class_get_pad_template (klass, "audio_%u")) {
audio = TRUE;
if (req_name != NULL && sscanf (req_name, "audio_%02d", &pad_id) == 1) {
if (req_name != NULL && sscanf (req_name, "audio_%u", &pad_id) == 1) {
name = g_strdup (req_name);
} else {
name = g_strdup_printf ("audio_%02d", qtmux->audio_pads++);
name = g_strdup_printf ("audio_%u", qtmux->audio_pads++);
}
} else if (templ == gst_element_class_get_pad_template (klass, "video_%d")) {
} else if (templ == gst_element_class_get_pad_template (klass, "video_%u")) {
audio = FALSE;
if (req_name != NULL && sscanf (req_name, "video_%02d", &pad_id) == 1) {
if (req_name != NULL && sscanf (req_name, "video_%u", &pad_id) == 1) {
name = g_strdup (req_name);
} else {
name = g_strdup_printf ("video_%02d", qtmux->video_pads++);
name = g_strdup_printf ("video_%u", qtmux->video_pads++);
}
} else
goto wrong_template;

View file

@ -95,7 +95,7 @@ static GstStaticPadTemplate src_templ = GST_STATIC_PAD_TEMPLATE ("src",
*/
static GstStaticPadTemplate videosink_templ =
GST_STATIC_PAD_TEMPLATE ("video_%d",
GST_STATIC_PAD_TEMPLATE ("video_%u",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_STATIC_CAPS ("video/mpeg, "
@ -140,7 +140,7 @@ static GstStaticPadTemplate videosink_templ =
* * require codec data, etc as needed
*/
static GstStaticPadTemplate audiosink_templ =
GST_STATIC_PAD_TEMPLATE ("audio_%d",
GST_STATIC_PAD_TEMPLATE ("audio_%u",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_STATIC_CAPS ("audio/mpeg, "
@ -205,7 +205,7 @@ static GstStaticPadTemplate audiosink_templ =
);
static GstStaticPadTemplate subtitlesink_templ =
GST_STATIC_PAD_TEMPLATE ("subtitle_%d",
GST_STATIC_PAD_TEMPLATE ("subtitle_%u",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_STATIC_CAPS ("subtitle/x-kate"));
@ -1851,13 +1851,13 @@ gst_matroska_mux_request_new_pad (GstElement * element,
GstMatroskaTrackContext *context = NULL;
gint pad_id;
if (templ == gst_element_class_get_pad_template (klass, "audio_%d")) {
if (templ == gst_element_class_get_pad_template (klass, "audio_%u")) {
/* don't mix named and unnamed pads, if the pad already exists we fail when
* trying to add it */
if (req_name != NULL && sscanf (req_name, "audio_%d", &pad_id) == 1) {
if (req_name != NULL && sscanf (req_name, "audio_%u", &pad_id) == 1) {
pad_name = req_name;
} else {
name = g_strdup_printf ("audio_%d", mux->num_a_streams++);
name = g_strdup_printf ("audio_%u", mux->num_a_streams++);
pad_name = name;
}
setcapsfunc = GST_DEBUG_FUNCPTR (gst_matroska_mux_audio_pad_setcaps);
@ -1865,13 +1865,13 @@ gst_matroska_mux_request_new_pad (GstElement * element,
g_new0 (GstMatroskaTrackAudioContext, 1);
context->type = GST_MATROSKA_TRACK_TYPE_AUDIO;
context->name = g_strdup ("Audio");
} else if (templ == gst_element_class_get_pad_template (klass, "video_%d")) {
} else if (templ == gst_element_class_get_pad_template (klass, "video_%u")) {
/* don't mix named and unnamed pads, if the pad already exists we fail when
* trying to add it */
if (req_name != NULL && sscanf (req_name, "video_%d", &pad_id) == 1) {
if (req_name != NULL && sscanf (req_name, "video_%u", &pad_id) == 1) {
pad_name = req_name;
} else {
name = g_strdup_printf ("video_%d", mux->num_v_streams++);
name = g_strdup_printf ("video_%u", mux->num_v_streams++);
pad_name = name;
}
setcapsfunc = GST_DEBUG_FUNCPTR (gst_matroska_mux_video_pad_setcaps);
@ -1879,13 +1879,13 @@ gst_matroska_mux_request_new_pad (GstElement * element,
g_new0 (GstMatroskaTrackVideoContext, 1);
context->type = GST_MATROSKA_TRACK_TYPE_VIDEO;
context->name = g_strdup ("Video");
} else if (templ == gst_element_class_get_pad_template (klass, "subtitle_%d")) {
} else if (templ == gst_element_class_get_pad_template (klass, "subtitle_%u")) {
/* don't mix named and unnamed pads, if the pad already exists we fail when
* trying to add it */
if (req_name != NULL && sscanf (req_name, "subtitle_%d", &pad_id) == 1) {
if (req_name != NULL && sscanf (req_name, "subtitle_%u", &pad_id) == 1) {
pad_name = req_name;
} else {
name = g_strdup_printf ("subtitle_%d", mux->num_t_streams++);
name = g_strdup_printf ("subtitle_%u", mux->num_t_streams++);
pad_name = name;
}
setcapsfunc = GST_DEBUG_FUNCPTR (gst_matroska_mux_subtitle_pad_setcaps);

View file

@ -63,14 +63,14 @@ static GstStaticPadTemplate webm_src_templ = GST_STATIC_PAD_TEMPLATE ("src",
);
static GstStaticPadTemplate webm_videosink_templ =
GST_STATIC_PAD_TEMPLATE ("video_%d",
GST_STATIC_PAD_TEMPLATE ("video_%u",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_STATIC_CAPS ("video/x-vp8, " COMMON_VIDEO_CAPS)
);
static GstStaticPadTemplate webm_audiosink_templ =
GST_STATIC_PAD_TEMPLATE ("audio_%d",
GST_STATIC_PAD_TEMPLATE ("audio_%u",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_STATIC_CAPS ("audio/x-vorbis, " COMMON_AUDIO_CAPS)

View file

@ -57,7 +57,7 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
GST_STATIC_CAPS ("multipart/x-mixed-replace")
);
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_ANY /* we can take anything, really */
@ -178,13 +178,13 @@ gst_multipart_mux_request_new_pad (GstElement * element,
GstElementClass *klass = GST_ELEMENT_GET_CLASS (element);
gchar *name;
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;
multipart_mux = GST_MULTIPART_MUX (element);
/* create new pad with the name */
name = g_strdup_printf ("sink_%02d", multipart_mux->numpads);
name = g_strdup_printf ("sink_%u", multipart_mux->numpads);
newpad = gst_pad_new_from_template (templ, name);
g_free (name);

View file

@ -28,30 +28,30 @@
* #GstRtpBin is configured with a number of request pads that define the
* functionality that is activated, similar to the #GstRtpSession element.
*
* To use #GstRtpBin as an RTP receiver, request a recv_rtp_sink_\%d pad. The session
* To use #GstRtpBin as an RTP receiver, request a recv_rtp_sink_\%u pad. The session
* number must be specified in the pad name.
* Data received on the recv_rtp_sink_\%d pad will be processed in the #GstRtpSession
* Data received on the recv_rtp_sink_\%u pad will be processed in the #GstRtpSession
* manager and after being validated forwarded on #GstRtpSsrcDemux element. Each
* RTP stream is demuxed based on the SSRC and send to a #GstRtpJitterBuffer. After
* the packets are released from the jitterbuffer, they will be forwarded to a
* #GstRtpPtDemux element. The #GstRtpPtDemux element will demux the packets based
* on the payload type and will create a unique pad recv_rtp_src_\%d_\%d_\%d on
* on the payload type and will create a unique pad recv_rtp_src_\%u_\%u_\%u on
* gstrtpbin with the session number, SSRC and payload type respectively as the pad
* name.
*
* To also use #GstRtpBin as an RTCP receiver, request a recv_rtcp_sink_\%d pad. The
* To also use #GstRtpBin as an RTCP receiver, request a recv_rtcp_sink_\%u pad. The
* session number must be specified in the pad name.
*
* If you want the session manager to generate and send RTCP packets, request
* the send_rtcp_src_\%d pad with the session number in the pad name. Packet pushed
* the send_rtcp_src_\%u pad with the session number in the pad name. Packet pushed
* on this pad contain SR/RR RTCP reports that should be sent to all participants
* in the session.
*
* To use #GstRtpBin as a sender, request a send_rtp_sink_\%d pad, which will
* automatically create a send_rtp_src_\%d pad. If the session number is not provided,
* To use #GstRtpBin as a sender, request a send_rtp_sink_\%u pad, which will
* automatically create a send_rtp_src_\%u pad. If the session number is not provided,
* the pad from the lowest available session will be returned. The session manager will modify the
* SSRC in the RTP packets to its own SSRC and wil forward the packets on the
* send_rtp_src_\%d pad after updating its internal state.
* send_rtp_src_\%u pad after updating its internal state.
*
* The session manager needs the clock-rate of the payload types it is handling
* and will signal the #GstRtpSession::request-pt-map signal when it needs such a
@ -134,21 +134,21 @@ GST_DEBUG_CATEGORY_STATIC (gst_rtp_bin_debug);
/* sink pads */
static GstStaticPadTemplate rtpbin_recv_rtp_sink_template =
GST_STATIC_PAD_TEMPLATE ("recv_rtp_sink_%d",
GST_STATIC_PAD_TEMPLATE ("recv_rtp_sink_%u",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_STATIC_CAPS ("application/x-rtp")
);
static GstStaticPadTemplate rtpbin_recv_rtcp_sink_template =
GST_STATIC_PAD_TEMPLATE ("recv_rtcp_sink_%d",
GST_STATIC_PAD_TEMPLATE ("recv_rtcp_sink_%u",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_STATIC_CAPS ("application/x-rtcp")
);
static GstStaticPadTemplate rtpbin_send_rtp_sink_template =
GST_STATIC_PAD_TEMPLATE ("send_rtp_sink_%d",
GST_STATIC_PAD_TEMPLATE ("send_rtp_sink_%u",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_STATIC_CAPS ("application/x-rtp")
@ -156,21 +156,21 @@ GST_STATIC_PAD_TEMPLATE ("send_rtp_sink_%d",
/* src pads */
static GstStaticPadTemplate rtpbin_recv_rtp_src_template =
GST_STATIC_PAD_TEMPLATE ("recv_rtp_src_%d_%d_%d",
GST_STATIC_PAD_TEMPLATE ("recv_rtp_src_%u_%u_%u",
GST_PAD_SRC,
GST_PAD_SOMETIMES,
GST_STATIC_CAPS ("application/x-rtp")
);
static GstStaticPadTemplate rtpbin_send_rtcp_src_template =
GST_STATIC_PAD_TEMPLATE ("send_rtcp_src_%d",
GST_STATIC_PAD_TEMPLATE ("send_rtcp_src_%u",
GST_PAD_SRC,
GST_PAD_REQUEST,
GST_STATIC_CAPS ("application/x-rtcp")
);
static GstStaticPadTemplate rtpbin_send_rtp_src_template =
GST_STATIC_PAD_TEMPLATE ("send_rtp_src_%d",
GST_STATIC_PAD_TEMPLATE ("send_rtp_src_%u",
GST_PAD_SRC,
GST_PAD_SOMETIMES,
GST_STATIC_CAPS ("application/x-rtp")
@ -2358,8 +2358,8 @@ new_payload_found (GstElement * element, guint pt, GstPad * pad,
/* ghost the pad to the parent */
klass = GST_ELEMENT_GET_CLASS (rtpbin);
templ = gst_element_class_get_pad_template (klass, "recv_rtp_src_%d_%d_%d");
padname = g_strdup_printf ("recv_rtp_src_%d_%u_%d",
templ = gst_element_class_get_pad_template (klass, "recv_rtp_src_%u_%u_%u");
padname = g_strdup_printf ("recv_rtp_src_%u_%u_%u",
stream->session->id, stream->ssrc, pt);
gpad = gst_ghost_pad_new_from_template (padname, pad, templ);
g_free (padname);
@ -2492,7 +2492,7 @@ new_ssrc_pad_found (GstElement * element, guint ssrc, GstPad * pad,
/* get pad and link */
GST_DEBUG_OBJECT (rtpbin, "linking jitterbuffer RTP");
padname = g_strdup_printf ("src_%d", ssrc);
padname = g_strdup_printf ("src_%u", ssrc);
srcpad = gst_element_get_static_pad (element, padname);
g_free (padname);
sinkpad = gst_element_get_static_pad (stream->buffer, "sink");
@ -2501,7 +2501,7 @@ new_ssrc_pad_found (GstElement * element, guint ssrc, GstPad * pad,
gst_object_unref (srcpad);
GST_DEBUG_OBJECT (rtpbin, "linking jitterbuffer RTCP");
padname = g_strdup_printf ("rtcp_src_%d", ssrc);
padname = g_strdup_printf ("rtcp_src_%u", ssrc);
srcpad = gst_element_get_static_pad (element, padname);
g_free (padname);
sinkpad = gst_element_get_request_pad (stream->buffer, "sink_rtcp");
@ -2541,8 +2541,8 @@ new_ssrc_pad_found (GstElement * element, guint ssrc, GstPad * pad,
/* ghost the pad to the parent */
klass = GST_ELEMENT_GET_CLASS (rtpbin);
templ = gst_element_class_get_pad_template (klass, "recv_rtp_src_%d_%d_%d");
padname = g_strdup_printf ("recv_rtp_src_%d_%u_%d",
templ = gst_element_class_get_pad_template (klass, "recv_rtp_src_%u_%u_%u");
padname = g_strdup_printf ("recv_rtp_src_%u_%u_%u",
stream->session->id, stream->ssrc, 255);
gpad = gst_ghost_pad_new_from_template (padname, pad, templ);
g_free (padname);
@ -2585,7 +2585,7 @@ create_recv_rtp (GstRtpBin * rtpbin, GstPadTemplate * templ, const gchar * name)
GstPadLinkReturn lres;
/* first get the session number */
if (name == NULL || sscanf (name, "recv_rtp_sink_%d", &sessid) != 1)
if (name == NULL || sscanf (name, "recv_rtp_sink_%u", &sessid) != 1)
goto no_name;
GST_DEBUG_OBJECT (rtpbin, "finding session %d", sessid);
@ -2707,7 +2707,7 @@ create_recv_rtcp (GstRtpBin * rtpbin, GstPadTemplate * templ,
GstPadLinkReturn lres;
/* first get the session number */
if (name == NULL || sscanf (name, "recv_rtcp_sink_%d", &sessid) != 1)
if (name == NULL || sscanf (name, "recv_rtcp_sink_%u", &sessid) != 1)
goto no_name;
GST_DEBUG_OBJECT (rtpbin, "finding session %d", sessid);
@ -2810,7 +2810,7 @@ create_send_rtp (GstRtpBin * rtpbin, GstPadTemplate * templ, const gchar * name)
GstElementClass *klass;
/* first get the session number */
if (name == NULL || sscanf (name, "send_rtp_sink_%d", &sessid) != 1)
if (name == NULL || sscanf (name, "send_rtp_sink_%u", &sessid) != 1)
goto no_name;
/* get or create session */
@ -2845,8 +2845,8 @@ create_send_rtp (GstRtpBin * rtpbin, GstPadTemplate * templ, const gchar * name)
/* ghost the new source pad */
klass = GST_ELEMENT_GET_CLASS (rtpbin);
gname = g_strdup_printf ("send_rtp_src_%d", sessid);
templ = gst_element_class_get_pad_template (klass, "send_rtp_src_%d");
gname = g_strdup_printf ("send_rtp_src_%u", sessid);
templ = gst_element_class_get_pad_template (klass, "send_rtp_src_%u");
session->send_rtp_src_ghost =
gst_ghost_pad_new_from_template (gname, session->send_rtp_src, templ);
gst_pad_set_active (session->send_rtp_src_ghost, TRUE);
@ -2916,7 +2916,7 @@ create_rtcp (GstRtpBin * rtpbin, GstPadTemplate * templ, const gchar * name)
GstRtpBinSession *session;
/* first get the session number */
if (name == NULL || sscanf (name, "send_rtcp_src_%d", &sessid) != 1)
if (name == NULL || sscanf (name, "send_rtcp_src_%u", &sessid) != 1)
goto no_name;
/* get or create session */
@ -3064,16 +3064,16 @@ gst_rtp_bin_request_new_pad (GstElement * element,
GST_DEBUG_OBJECT (rtpbin, "Trying to request a pad with name %s", pad_name);
/* figure out the template */
if (templ == gst_element_class_get_pad_template (klass, "recv_rtp_sink_%d")) {
if (templ == gst_element_class_get_pad_template (klass, "recv_rtp_sink_%u")) {
result = create_recv_rtp (rtpbin, templ, pad_name);
} else if (templ == gst_element_class_get_pad_template (klass,
"recv_rtcp_sink_%d")) {
"recv_rtcp_sink_%u")) {
result = create_recv_rtcp (rtpbin, templ, pad_name);
} else if (templ == gst_element_class_get_pad_template (klass,
"send_rtp_sink_%d")) {
"send_rtp_sink_%u")) {
result = create_send_rtp (rtpbin, templ, pad_name);
} else if (templ == gst_element_class_get_pad_template (klass,
"send_rtcp_src_%d")) {
"send_rtcp_src_%u")) {
result = create_rtcp (rtpbin, templ, pad_name);
} else
goto wrong_template;

View file

@ -88,7 +88,7 @@ GST_STATIC_PAD_TEMPLATE ("sink",
);
static GstStaticPadTemplate rtp_pt_demux_src_template =
GST_STATIC_PAD_TEMPLATE ("src_%d",
GST_STATIC_PAD_TEMPLATE ("src_%u",
GST_PAD_SRC,
GST_PAD_SOMETIMES,
GST_STATIC_CAPS ("application/x-rtp, " "payload = (int) [ 0, 255 ]")
@ -323,8 +323,8 @@ gst_rtp_pt_demux_chain (GstPad * pad, GstBuffer * buf)
gchar *padname;
klass = GST_ELEMENT_GET_CLASS (rtpdemux);
templ = gst_element_class_get_pad_template (klass, "src_%d");
padname = g_strdup_printf ("src_%d", pt);
templ = gst_element_class_get_pad_template (klass, "src_%u");
padname = g_strdup_printf ("src_%u", pt);
srcpad = gst_pad_new_from_template (templ, padname);
gst_pad_use_fixed_caps (srcpad);
g_free (padname);

View file

@ -87,28 +87,28 @@ enum
};
static GstStaticPadTemplate gst_rtp_dec_recv_rtp_sink_template =
GST_STATIC_PAD_TEMPLATE ("recv_rtp_sink_%d",
GST_STATIC_PAD_TEMPLATE ("recv_rtp_sink_%u",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_STATIC_CAPS ("application/x-rtp")
);
static GstStaticPadTemplate gst_rtp_dec_recv_rtcp_sink_template =
GST_STATIC_PAD_TEMPLATE ("recv_rtcp_sink_%d",
GST_STATIC_PAD_TEMPLATE ("recv_rtcp_sink_%u",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_STATIC_CAPS ("application/x-rtcp")
);
static GstStaticPadTemplate gst_rtp_dec_recv_rtp_src_template =
GST_STATIC_PAD_TEMPLATE ("recv_rtp_src_%d_%d_%d",
GST_STATIC_PAD_TEMPLATE ("recv_rtp_src_%u_%u_%u",
GST_PAD_SRC,
GST_PAD_SOMETIMES,
GST_STATIC_CAPS ("application/x-rtp")
);
static GstStaticPadTemplate gst_rtp_dec_rtcp_src_template =
GST_STATIC_PAD_TEMPLATE ("rtcp_src_%d",
GST_STATIC_PAD_TEMPLATE ("rtcp_src_%u",
GST_PAD_SRC,
GST_PAD_REQUEST,
GST_STATIC_CAPS ("application/x-rtcp")
@ -512,9 +512,9 @@ gst_rtp_dec_chain_rtp (GstPad * pad, GstBuffer * buffer)
caps = (GstCaps *) g_value_get_boxed (&ret);
name = g_strdup_printf ("recv_rtp_src_%d_%u_%d", session->id, ssrc, pt);
name = g_strdup_printf ("recv_rtp_src_%u_%u_%u", session->id, ssrc, pt);
klass = GST_ELEMENT_GET_CLASS (rtpdec);
templ = gst_element_class_get_pad_template (klass, "recv_rtp_src_%d_%d_%d");
templ = gst_element_class_get_pad_template (klass, "recv_rtp_src_%u_%u_%u");
session->recv_rtp_src = gst_pad_new_from_template (templ, name);
g_free (name);
@ -780,7 +780,7 @@ create_recv_rtp (GstRTPDec * rtpdec, GstPadTemplate * templ, const gchar * name)
GstRTPDecSession *session;
/* first get the session number */
if (name == NULL || sscanf (name, "recv_rtp_sink_%d", &sessid) != 1)
if (name == NULL || sscanf (name, "recv_rtp_sink_%u", &sessid) != 1)
goto no_name;
GST_DEBUG_OBJECT (rtpdec, "finding session %d", sessid);
@ -836,7 +836,7 @@ create_recv_rtcp (GstRTPDec * rtpdec, GstPadTemplate * templ,
GstRTPDecSession *session;
/* first get the session number */
if (name == NULL || sscanf (name, "recv_rtcp_sink_%d", &sessid) != 1)
if (name == NULL || sscanf (name, "recv_rtcp_sink_%u", &sessid) != 1)
goto no_name;
GST_DEBUG_OBJECT (rtpdec, "finding session %d", sessid);
@ -888,7 +888,7 @@ create_rtcp (GstRTPDec * rtpdec, GstPadTemplate * templ, const gchar * name)
GstRTPDecSession *session;
/* first get the session number */
if (name == NULL || sscanf (name, "rtcp_src_%d", &sessid) != 1)
if (name == NULL || sscanf (name, "rtcp_src_%u", &sessid) != 1)
goto no_name;
/* get or create session */
@ -941,12 +941,12 @@ gst_rtp_dec_request_new_pad (GstElement * element,
klass = GST_ELEMENT_GET_CLASS (element);
/* figure out the template */
if (templ == gst_element_class_get_pad_template (klass, "recv_rtp_sink_%d")) {
if (templ == gst_element_class_get_pad_template (klass, "recv_rtp_sink_%u")) {
result = create_recv_rtp (rtpdec, templ, name);
} else if (templ == gst_element_class_get_pad_template (klass,
"recv_rtcp_sink_%d")) {
"recv_rtcp_sink_%u")) {
result = create_recv_rtcp (rtpdec, templ, name);
} else if (templ == gst_element_class_get_pad_template (klass, "rtcp_src_%d")) {
} else if (templ == gst_element_class_get_pad_template (klass, "rtcp_src_%u")) {
result = create_rtcp (rtpdec, templ, name);
} else
goto wrong_template;

View file

@ -2197,7 +2197,7 @@ new_manager_pad (GstElement * manager, GstPad * pad, GstRTSPSrc * src)
GST_RTSP_STATE_LOCK (src);
/* find stream */
name = gst_object_get_name (GST_OBJECT_CAST (pad));
if (sscanf (name, "recv_rtp_src_%d_%d_%d", &id, &ssrc, &pt) != 3)
if (sscanf (name, "recv_rtp_src_%u_%u_%u", &id, &ssrc, &pt) != 3)
goto unknown_stream;
GST_DEBUG_OBJECT (src, "stream: %u, SSRC %d, PT %d", id, ssrc, pt);
@ -2440,10 +2440,10 @@ gst_rtspsrc_stream_configure_manager (GstRTSPSrc * src, GstRTSPStream * stream,
/* we stream directly to the manager, get some pads. Each RTSP stream goes
* into a separate RTP session. */
name = g_strdup_printf ("recv_rtp_sink_%d", stream->id);
name = g_strdup_printf ("recv_rtp_sink_%u", stream->id);
stream->channelpad[0] = gst_element_get_request_pad (src->manager, name);
g_free (name);
name = g_strdup_printf ("recv_rtcp_sink_%d", stream->id);
name = g_strdup_printf ("recv_rtcp_sink_%u", stream->id);
stream->channelpad[1] = gst_element_get_request_pad (src->manager, name);
g_free (name);
@ -2602,7 +2602,7 @@ gst_rtspsrc_stream_configure_tcp (GstRTSPSrc * src, GstRTSPStream * stream,
gst_pad_set_active (stream->rtcppad, TRUE);
/* get session RTCP pad */
name = g_strdup_printf ("send_rtcp_src_%d", stream->id);
name = g_strdup_printf ("send_rtcp_src_%u", stream->id);
pad = gst_element_get_request_pad (src->manager, name);
g_free (name);
@ -2924,7 +2924,7 @@ gst_rtspsrc_stream_configure_udp_sinks (GstRTSPSrc * src,
stream->rtcppad = gst_element_get_static_pad (stream->udpsink[1], "sink");
/* get session RTCP pad */
name = g_strdup_printf ("send_rtcp_src_%d", stream->id);
name = g_strdup_printf ("send_rtcp_src_%u", stream->id);
pad = gst_element_get_request_pad (src->manager, name);
g_free (name);

View file

@ -566,7 +566,7 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
GST_VIDEO_CAPS_RGBx ";" GST_VIDEO_CAPS_BGRx)
);
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 (GST_VIDEO_CAPS_YUV ("AYUV") ";" GST_VIDEO_CAPS_BGRA ";"
@ -1203,7 +1203,7 @@ gst_videomixer_request_new_pad (GstElement * element,
mix = GST_VIDEO_MIXER (element);
if (templ == gst_element_class_get_pad_template (klass, "sink_%d")) {
if (templ == gst_element_class_get_pad_template (klass, "sink_%u")) {
gint serial = 0;
gchar *name = NULL;
GstVideoMixerCollect *mixcol = NULL;
@ -1220,7 +1220,7 @@ gst_videomixer_request_new_pad (GstElement * element,
mix->next_sinkpad = serial + 1;
}
/* create new pad with the name */
name = g_strdup_printf ("sink_%d", serial);
name = g_strdup_printf ("sink_%u", serial);
mixpad = g_object_new (GST_TYPE_VIDEO_MIXER_PAD, "name", name, "direction",
templ->direction, "template", templ, NULL);
g_free (name);

View file

@ -231,7 +231,7 @@ check_avimux_pad (GstStaticPadTemplate * srctemplate,
GST_START_TEST (test_video_pad)
{
check_avimux_pad (&srcvideotemplate, VIDEO_CAPS_STRING, "00db", "video_%d");
check_avimux_pad (&srcvideotemplate, VIDEO_CAPS_STRING, "00db", "video_%u");
}
GST_END_TEST;
@ -239,7 +239,7 @@ GST_END_TEST;
GST_START_TEST (test_audio_pad)
{
check_avimux_pad (&srcaudiotemplate, AUDIO_CAPS_STRING, "00wb", "audio_%d");
check_avimux_pad (&srcaudiotemplate, AUDIO_CAPS_STRING, "00wb", "audio_%u");
}
GST_END_TEST;

View file

@ -46,13 +46,13 @@ GST_START_TEST (test_request_pads)
interleave = gst_element_factory_make ("interleave", NULL);
fail_unless (interleave != NULL);
pad1 = gst_element_get_request_pad (interleave, "sink%d");
pad1 = gst_element_get_request_pad (interleave, "sink_%u");
fail_unless (pad1 != NULL);
fail_unless_equals_string (GST_OBJECT_NAME (pad1), "sink0");
fail_unless_equals_string (GST_OBJECT_NAME (pad1), "sink_0");
pad2 = gst_element_get_request_pad (interleave, "sink%d");
pad2 = gst_element_get_request_pad (interleave, "sink_%u");
fail_unless (pad2 != NULL);
fail_unless_equals_string (GST_OBJECT_NAME (pad2), "sink1");
fail_unless_equals_string (GST_OBJECT_NAME (pad2), "sink_1");
gst_element_release_request_pad (interleave, pad2);
gst_object_unref (pad2);
@ -138,13 +138,13 @@ GST_START_TEST (test_interleave_2ch)
queue = gst_element_factory_make ("queue", "queue");
fail_unless (queue != NULL);
sink0 = gst_element_get_request_pad (interleave, "sink%d");
sink0 = gst_element_get_request_pad (interleave, "sink_%u");
fail_unless (sink0 != NULL);
fail_unless_equals_string (GST_OBJECT_NAME (sink0), "sink0");
fail_unless_equals_string (GST_OBJECT_NAME (sink0), "sink_0");
sink1 = gst_element_get_request_pad (interleave, "sink%d");
sink1 = gst_element_get_request_pad (interleave, "sink_%u");
fail_unless (sink1 != NULL);
fail_unless_equals_string (GST_OBJECT_NAME (sink1), "sink1");
fail_unless_equals_string (GST_OBJECT_NAME (sink1), "sink_1");
mysrcpads[0] = gst_pad_new_from_static_template (&srctemplate, "src0");
fail_unless (mysrcpads[0] != NULL);
@ -259,13 +259,13 @@ GST_START_TEST (test_interleave_2ch_1eos)
queue = gst_element_factory_make ("queue", "queue");
fail_unless (queue != NULL);
sink0 = gst_element_get_request_pad (interleave, "sink%d");
sink0 = gst_element_get_request_pad (interleave, "sink_%u");
fail_unless (sink0 != NULL);
fail_unless_equals_string (GST_OBJECT_NAME (sink0), "sink0");
fail_unless_equals_string (GST_OBJECT_NAME (sink0), "sink_0");
sink1 = gst_element_get_request_pad (interleave, "sink%d");
sink1 = gst_element_get_request_pad (interleave, "sink_%u");
fail_unless (sink1 != NULL);
fail_unless_equals_string (GST_OBJECT_NAME (sink1), "sink1");
fail_unless_equals_string (GST_OBJECT_NAME (sink1), "sink_1");
mysrcpads[0] = gst_pad_new_from_static_template (&srctemplate, "src0");
fail_unless (mysrcpads[0] != NULL);
@ -486,13 +486,13 @@ GST_START_TEST (test_interleave_2ch_pipeline)
fail_unless (interleave != NULL);
gst_bin_add (GST_BIN (pipeline), gst_object_ref (interleave));
sinkpad0 = gst_element_get_request_pad (interleave, "sink%d");
sinkpad0 = gst_element_get_request_pad (interleave, "sink_%u");
fail_unless (sinkpad0 != NULL);
tmp = gst_element_get_static_pad (src1, "src");
fail_unless (gst_pad_link (tmp, sinkpad0) == GST_PAD_LINK_OK);
gst_object_unref (tmp);
sinkpad1 = gst_element_get_request_pad (interleave, "sink%d");
sinkpad1 = gst_element_get_request_pad (interleave, "sink_%u");
fail_unless (sinkpad1 != NULL);
tmp = gst_element_get_static_pad (src2, "src");
tmp2 = gst_element_get_static_pad (queue, "sink");
@ -569,13 +569,13 @@ GST_START_TEST (test_interleave_2ch_pipeline_input_chanpos)
g_object_set (interleave, "channel-positions-from-input", TRUE, NULL);
gst_bin_add (GST_BIN (pipeline), gst_object_ref (interleave));
sinkpad0 = gst_element_get_request_pad (interleave, "sink%d");
sinkpad0 = gst_element_get_request_pad (interleave, "sink_%u");
fail_unless (sinkpad0 != NULL);
tmp = gst_element_get_static_pad (src1, "src");
fail_unless (gst_pad_link (tmp, sinkpad0) == GST_PAD_LINK_OK);
gst_object_unref (tmp);
sinkpad1 = gst_element_get_request_pad (interleave, "sink%d");
sinkpad1 = gst_element_get_request_pad (interleave, "sink_%u");
fail_unless (sinkpad1 != NULL);
tmp = gst_element_get_static_pad (src2, "src");
tmp2 = gst_element_get_static_pad (queue, "sink");
@ -664,13 +664,13 @@ GST_START_TEST (test_interleave_2ch_pipeline_custom_chanpos)
g_value_array_free (arr);
gst_bin_add (GST_BIN (pipeline), gst_object_ref (interleave));
sinkpad0 = gst_element_get_request_pad (interleave, "sink%d");
sinkpad0 = gst_element_get_request_pad (interleave, "sink_%u");
fail_unless (sinkpad0 != NULL);
tmp = gst_element_get_static_pad (src1, "src");
fail_unless (gst_pad_link (tmp, sinkpad0) == GST_PAD_LINK_OK);
gst_object_unref (tmp);
sinkpad1 = gst_element_get_request_pad (interleave, "sink%d");
sinkpad1 = gst_element_get_request_pad (interleave, "sink_%u");
fail_unless (sinkpad1 != NULL);
tmp = gst_element_get_static_pad (src2, "src");
tmp2 = gst_element_get_static_pad (queue, "sink");

View file

@ -66,8 +66,8 @@ setup_src_pad (GstElement * element,
ASSERT_OBJECT_REFCOUNT (srcpad, "srcpad", 1);
gst_pad_set_active (srcpad, TRUE);
if (!(sinkpad = gst_element_get_static_pad (element, "audio_%d")))
sinkpad = gst_element_get_request_pad (element, "audio_%d");
if (!(sinkpad = gst_element_get_static_pad (element, "audio_%u")))
sinkpad = gst_element_get_request_pad (element, "audio_%u");
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 */

View file

@ -358,14 +358,14 @@ check_qtmux_pad_fragmented (GstStaticPadTemplate * srctemplate,
GST_START_TEST (test_video_pad_dd)
{
check_qtmux_pad (&srcvideotemplate, "video_%d", 0);
check_qtmux_pad (&srcvideotemplate, "video_%u", 0);
}
GST_END_TEST;
GST_START_TEST (test_audio_pad_dd)
{
check_qtmux_pad (&srcaudiotemplate, "audio_%d", 0);
check_qtmux_pad (&srcaudiotemplate, "audio_%u", 0);
}
GST_END_TEST;
@ -373,14 +373,14 @@ GST_END_TEST;
GST_START_TEST (test_video_pad_frag_dd)
{
check_qtmux_pad_fragmented (&srcvideotemplate, "video_%d", 0, FALSE);
check_qtmux_pad_fragmented (&srcvideotemplate, "video_%u", 0, FALSE);
}
GST_END_TEST;
GST_START_TEST (test_audio_pad_frag_dd)
{
check_qtmux_pad_fragmented (&srcaudiotemplate, "audio_%d", 0, FALSE);
check_qtmux_pad_fragmented (&srcaudiotemplate, "audio_%u", 0, FALSE);
}
GST_END_TEST;
@ -388,7 +388,7 @@ GST_END_TEST;
GST_START_TEST (test_video_pad_frag_dd_streamable)
{
check_qtmux_pad_fragmented (&srcvideotemplate, "video_%d", 0, TRUE);
check_qtmux_pad_fragmented (&srcvideotemplate, "video_%u", 0, TRUE);
}
GST_END_TEST;
@ -396,7 +396,7 @@ GST_END_TEST;
GST_START_TEST (test_audio_pad_frag_dd_streamable)
{
check_qtmux_pad_fragmented (&srcaudiotemplate, "audio_%d", 0, TRUE);
check_qtmux_pad_fragmented (&srcaudiotemplate, "audio_%u", 0, TRUE);
}
GST_END_TEST;
@ -405,14 +405,14 @@ GST_END_TEST;
GST_START_TEST (test_video_pad_reorder)
{
check_qtmux_pad (&srcvideotemplate, "video_%d", 1);
check_qtmux_pad (&srcvideotemplate, "video_%u", 1);
}
GST_END_TEST;
GST_START_TEST (test_audio_pad_reorder)
{
check_qtmux_pad (&srcaudiotemplate, "audio_%d", 1);
check_qtmux_pad (&srcaudiotemplate, "audio_%u", 1);
}
GST_END_TEST;
@ -420,14 +420,14 @@ GST_END_TEST;
GST_START_TEST (test_video_pad_frag_reorder)
{
check_qtmux_pad_fragmented (&srcvideotemplate, "video_%d", 1, FALSE);
check_qtmux_pad_fragmented (&srcvideotemplate, "video_%u", 1, FALSE);
}
GST_END_TEST;
GST_START_TEST (test_audio_pad_frag_reorder)
{
check_qtmux_pad_fragmented (&srcaudiotemplate, "audio_%d", 1, FALSE);
check_qtmux_pad_fragmented (&srcaudiotemplate, "audio_%u", 1, FALSE);
}
GST_END_TEST;
@ -435,7 +435,7 @@ GST_END_TEST;
GST_START_TEST (test_video_pad_frag_reorder_streamable)
{
check_qtmux_pad_fragmented (&srcvideotemplate, "video_%d", 1, TRUE);
check_qtmux_pad_fragmented (&srcvideotemplate, "video_%u", 1, TRUE);
}
GST_END_TEST;
@ -443,7 +443,7 @@ GST_END_TEST;
GST_START_TEST (test_audio_pad_frag_reorder_streamable)
{
check_qtmux_pad_fragmented (&srcaudiotemplate, "audio_%d", 1, TRUE);
check_qtmux_pad_fragmented (&srcaudiotemplate, "audio_%u", 1, TRUE);
}
GST_END_TEST;
@ -452,14 +452,14 @@ GST_END_TEST;
GST_START_TEST (test_video_pad_asc)
{
check_qtmux_pad (&srcvideotemplate, "video_%d", 2);
check_qtmux_pad (&srcvideotemplate, "video_%u", 2);
}
GST_END_TEST;
GST_START_TEST (test_audio_pad_asc)
{
check_qtmux_pad (&srcaudiotemplate, "audio_%d", 2);
check_qtmux_pad (&srcaudiotemplate, "audio_%u", 2);
}
GST_END_TEST;
@ -467,14 +467,14 @@ GST_END_TEST;
GST_START_TEST (test_video_pad_frag_asc)
{
check_qtmux_pad_fragmented (&srcvideotemplate, "video_%d", 2, FALSE);
check_qtmux_pad_fragmented (&srcvideotemplate, "video_%u", 2, FALSE);
}
GST_END_TEST;
GST_START_TEST (test_audio_pad_frag_asc)
{
check_qtmux_pad_fragmented (&srcaudiotemplate, "audio_%d", 2, FALSE);
check_qtmux_pad_fragmented (&srcaudiotemplate, "audio_%u", 2, FALSE);
}
GST_END_TEST;
@ -482,7 +482,7 @@ GST_END_TEST;
GST_START_TEST (test_video_pad_frag_asc_streamable)
{
check_qtmux_pad_fragmented (&srcvideotemplate, "video_%d", 2, TRUE);
check_qtmux_pad_fragmented (&srcvideotemplate, "video_%u", 2, TRUE);
}
GST_END_TEST;
@ -490,14 +490,14 @@ GST_END_TEST;
GST_START_TEST (test_audio_pad_frag_asc_streamable)
{
check_qtmux_pad_fragmented (&srcaudiotemplate, "audio_%d", 2, TRUE);
check_qtmux_pad_fragmented (&srcaudiotemplate, "audio_%u", 2, TRUE);
}
GST_END_TEST;
GST_START_TEST (test_reuse)
{
GstElement *qtmux = setup_qtmux (&srcvideotemplate, "video_%d");
GstElement *qtmux = setup_qtmux (&srcvideotemplate, "video_%u");
GstBuffer *inbuffer;
GstCaps *caps;
@ -520,7 +520,7 @@ GST_START_TEST (test_reuse)
/* send eos to have all written */
fail_unless (gst_pad_push_event (mysrcpad, gst_event_new_eos ()) == TRUE);
cleanup_qtmux (qtmux, "video_%d");
cleanup_qtmux (qtmux, "video_%u");
}
GST_END_TEST;
@ -844,11 +844,11 @@ test_average_bitrate_custom (const gchar * elementname,
GST_START_TEST (test_average_bitrate)
{
test_average_bitrate_custom ("mp4mux", &srcaudioaactemplate, "audio_%d");
test_average_bitrate_custom ("mp4mux", &srcvideoh264template, "video_%d");
test_average_bitrate_custom ("mp4mux", &srcaudioaactemplate, "audio_%u");
test_average_bitrate_custom ("mp4mux", &srcvideoh264template, "video_%u");
test_average_bitrate_custom ("qtmux", &srcaudioaactemplate, "audio_%d");
test_average_bitrate_custom ("qtmux", &srcvideoh264template, "video_%d");
test_average_bitrate_custom ("qtmux", &srcaudioaactemplate, "audio_%u");
test_average_bitrate_custom ("qtmux", &srcvideoh264template, "video_%u");
}
GST_END_TEST;

View file

@ -383,17 +383,17 @@ GST_START_TEST (test_request_pad_by_template_name)
GstPad *rtp_sink1, *rtp_sink2, *rtp_sink3;
rtpbin = gst_element_factory_make ("gstrtpbin", "rtpbin");
rtp_sink1 = gst_element_get_request_pad (rtpbin, "recv_rtp_sink_%d");
rtp_sink1 = gst_element_get_request_pad (rtpbin, "recv_rtp_sink_%u");
fail_unless (rtp_sink1 != NULL);
fail_unless_equals_string (GST_PAD_NAME (rtp_sink1), "recv_rtp_sink_0");
ASSERT_OBJECT_REFCOUNT (rtp_sink1, "rtp_sink1", 2);
rtp_sink2 = gst_element_get_request_pad (rtpbin, "recv_rtp_sink_%d");
rtp_sink2 = gst_element_get_request_pad (rtpbin, "recv_rtp_sink_%u");
fail_unless (rtp_sink2 != NULL);
fail_unless_equals_string (GST_PAD_NAME (rtp_sink2), "recv_rtp_sink_1");
ASSERT_OBJECT_REFCOUNT (rtp_sink2, "rtp_sink2", 2);
rtp_sink3 = gst_element_get_request_pad (rtpbin, "recv_rtp_sink_%d");
rtp_sink3 = gst_element_get_request_pad (rtpbin, "recv_rtp_sink_%u");
fail_unless (rtp_sink3 != NULL);
fail_unless_equals_string (GST_PAD_NAME (rtp_sink3), "recv_rtp_sink_2");
ASSERT_OBJECT_REFCOUNT (rtp_sink3, "rtp_sink3", 2);