+static void
+gst_rtp_dtmf_mux_lock_stream (GstRTPDTMFMux *mux, GstPad * pad)
+{
+ if (mux->special_pad != NULL) {
+ GST_WARNING_OBJECT (mux,
+ "Stream lock already acquired by pad %s",
+ GST_ELEMENT_NAME (mux->special_pad));
+ }
+
+ else
+ mux->special_pad = gst_object_ref (pad);
+}
+
+static void
+gst_rtp_dtmf_mux_unlock_stream (GstRTPDTMFMux *mux, GstPad * pad)
+{
+ if (mux->special_pad == NULL) {
+ GST_WARNING_OBJECT (mux,
+ "Stream lock not acquired, can't release it");
+ }
+
+ else if (pad != mux->special_pad) {
+ GST_WARNING_OBJECT (mux,
+ "pad %s attempted to release Stream lock"
+ " which was acquired by pad %s", GST_ELEMENT_NAME (pad),
+ GST_ELEMENT_NAME (mux->special_pad));
+ }
+
+ else {
+ gst_object_unref (mux->special_pad);
+ mux->special_pad = NULL;
+ }
+}
+