summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.co.uk>2008-08-12 12:30:52 -0400
committerEdward Hervey <bilboed@bilboed.com>2009-02-21 17:48:55 +0100
commit963cec94583c89a85c656b1b58eb4c05e68cec11 (patch)
tree02d5711ec26b6fd67dd0698a0f8f31e14b38519c
parent4e110b544fe09e5da530086733cae5477f9813c6 (diff)
[MOVED FROM GST-P-FARSIGHT] Add padprivate to the request pads
-rw-r--r--gst/rtpmux/gstrtpmux.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gst/rtpmux/gstrtpmux.c b/gst/rtpmux/gstrtpmux.c
index 8986e79f2..7228dc8a4 100644
--- a/gst/rtpmux/gstrtpmux.c
+++ b/gst/rtpmux/gstrtpmux.c
@@ -66,6 +66,11 @@ enum
#define DEFAULT_SSRC -1
#define DEFAULT_CLOCK_RATE 0
+typedef struct {
+ gboolean have_base;
+ guint clock_base;
+} GstRTPMuxPadPrivate;
+
static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
@@ -86,6 +91,7 @@ static void gst_rtp_mux_finalize (GObject * object);
static GstPad *gst_rtp_mux_request_new_pad (GstElement * element,
GstPadTemplate * templ, const gchar * name);
+static void gst_rtp_mux_release_pad (GstElement * element, GstPad *pad);
static GstFlowReturn gst_rtp_mux_chain (GstPad * pad,
GstBuffer * buffer);
static gboolean gst_rtp_mux_setcaps (GstPad *pad, GstCaps *caps);
@@ -176,6 +182,7 @@ gst_rtp_mux_class_init (GstRTPMuxClass * klass)
0, G_MAXUINT, DEFAULT_SSRC, G_PARAM_READWRITE));
gstelement_class->request_new_pad = gst_rtp_mux_request_new_pad;
+ gstelement_class->release_pad = gst_rtp_mux_release_pad;
gstelement_class->change_state = gst_rtp_mux_change_state;
klass->chain_func = gst_rtp_mux_chain;
@@ -274,6 +281,7 @@ static void
gst_rtp_mux_setup_sinkpad (GstRTPMux * rtp_mux, GstPad * sinkpad)
{
GstRTPMuxClass *klass;
+ GstRTPMuxPadPrivate *padpriv = g_slice_new0 (GstRTPMuxPadPrivate);
klass = GST_RTP_MUX_GET_CLASS (rtp_mux);
@@ -287,6 +295,8 @@ gst_rtp_mux_setup_sinkpad (GstRTPMux * rtp_mux, GstPad * sinkpad)
/* This could break with gstreamer 0.10.9 */
gst_pad_set_active (sinkpad, TRUE);
+ gst_pad_set_element_private (sinkpad, padpriv);
+
/* dd the pad to the element */
gst_element_add_pad (GST_ELEMENT (rtp_mux), sinkpad);
}
@@ -317,6 +327,18 @@ gst_rtp_mux_request_new_pad (GstElement * element,
return newpad;
}
+static void
+gst_rtp_mux_release_pad (GstElement * element, GstPad *pad)
+{
+ GstRTPMuxPadPrivate *padpriv = gst_pad_get_element_private (pad);
+
+ if (padpriv)
+ g_slice_free (GstRTPMuxPadPrivate, padpriv);
+ gst_pad_set_element_private (pad, NULL);
+
+ gst_element_remove_pad (element, pad);
+}
+
static guint32
gst_rtp_mux_get_buffer_ts_base (GstRTPMux * rtp_mux, GstBuffer * buffer)
{