diff --git a/gst/rtsp-server/rtsp-media.c b/gst/rtsp-server/rtsp-media.c index 4b8d405d48..016f700f30 100644 --- a/gst/rtsp-server/rtsp-media.c +++ b/gst/rtsp-server/rtsp-media.c @@ -1712,6 +1712,19 @@ gst_rtsp_media_prepare (GstRTSPMedia * media, GstRTSPThread * thread) goto is_reused; priv->rtpbin = gst_element_factory_make ("rtpbin", NULL); + if (priv->rtpbin != NULL) { + GstRTSPMediaClass *klass; + gboolean success = TRUE; + + klass = GST_RTSP_MEDIA_GET_CLASS (media); + if (klass->setup_rtpbin) + success = klass->setup_rtpbin (media, priv->rtpbin); + + if (success == FALSE) { + gst_object_unref (priv->rtpbin); + priv->rtpbin = NULL; + } + } if (priv->rtpbin == NULL) goto no_rtpbin; diff --git a/gst/rtsp-server/rtsp-media.h b/gst/rtsp-server/rtsp-media.h index 7a24fcf043..016526dd88 100644 --- a/gst/rtsp-server/rtsp-media.h +++ b/gst/rtsp-server/rtsp-media.h @@ -101,6 +101,7 @@ struct _GstRTSPMediaClass { GstRTSPRangeUnit unit); gboolean (*query_position) (GstRTSPMedia *media, gint64 *position); gboolean (*query_stop) (GstRTSPMedia *media, gint64 *stop); + gboolean (*setup_rtpbin) (GstRTSPMedia *media, GstElement *rtpbin); /* signals */ void (*new_stream) (GstRTSPMedia *media, GstRTSPStream * stream);