[gst-cvs] gst-plugins-bad: rtpmux: Simplify request pad creation

Olivier Crête tester at kemper.freedesktop.org
Wed Jun 2 17:58:24 PDT 2010


Module: gst-plugins-bad
Branch: master
Commit: 1c03b56146b3817207b0e80d1886456bba372e36
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=1c03b56146b3817207b0e80d1886456bba372e36

Author: Olivier Crête <olivier.crete at collabora.co.uk>
Date:   Thu May  6 18:10:45 2010 -0400

rtpmux: Simplify request pad creation

---

 gst/rtpmux/gstrtpmux.c |   33 +--------------------------------
 gst/rtpmux/gstrtpmux.h |    3 ---
 2 files changed, 1 insertions(+), 35 deletions(-)

diff --git a/gst/rtpmux/gstrtpmux.c b/gst/rtpmux/gstrtpmux.c
index e5f49fc..851ea06 100644
--- a/gst/rtpmux/gstrtpmux.c
+++ b/gst/rtpmux/gstrtpmux.c
@@ -221,37 +221,6 @@ gst_rtp_mux_init (GstRTPMux * object, GstRTPMuxClass * g_class)
   object->seqnum_offset = DEFAULT_SEQNUM_OFFSET;
 }
 
-static GstPad *
-gst_rtp_mux_create_sinkpad (GstRTPMux * rtp_mux, GstPadTemplate * templ,
-    const gchar * req_name)
-{
-  GstPad *newpad = NULL;
-  GstPadTemplate *class_templ;
-
-  class_templ =
-      gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (rtp_mux),
-      "sink_%d");
-
-  if (templ == class_templ) {
-    gchar *tmpname = NULL;
-    const gchar *name = NULL;
-
-    /* create new pad with the name */
-    if (req_name)
-      name = req_name;
-    else
-      name = tmpname = g_strdup_printf ("sink_%02d", rtp_mux->numpads);
-    newpad = gst_pad_new_from_template (templ, name);
-    g_free (tmpname);
-
-    rtp_mux->numpads++;
-  } else {
-    GST_WARNING_OBJECT (rtp_mux, "this is not our template!\n");
-  }
-
-  return newpad;
-}
-
 static void
 gst_rtp_mux_setup_sinkpad (GstRTPMux * rtp_mux, GstPad * sinkpad)
 {
@@ -294,7 +263,7 @@ gst_rtp_mux_request_new_pad (GstElement * element,
     return NULL;
   }
 
-  newpad = gst_rtp_mux_create_sinkpad (rtp_mux, templ, req_name);
+  newpad = gst_pad_new_from_template (templ, req_name);
   if (newpad)
     gst_rtp_mux_setup_sinkpad (rtp_mux, newpad);
   else
diff --git a/gst/rtpmux/gstrtpmux.h b/gst/rtpmux/gstrtpmux.h
index a3fc133..77a394b 100644
--- a/gst/rtpmux/gstrtpmux.h
+++ b/gst/rtpmux/gstrtpmux.h
@@ -50,9 +50,6 @@ struct _GstRTPMux
   /* pad */
   GstPad *srcpad;
 
-  /* sinkpads */
-  gint numpads;
-
   guint32 ts_base;
   guint16 seqnum_base;
 





More information about the Gstreamer-commits mailing list