Add vmethod for rtsp-media subclass to access rtpbin
authorYouness Alaoui <youness.alaoui@collabora.co.uk>
Tue, 11 Jun 2013 23:10:01 +0000 (19:10 -0400)
committerWim Taymans <wim.taymans@collabora.co.uk>
Fri, 2 Aug 2013 14:59:04 +0000 (16:59 +0200)
gst/rtsp-server/rtsp-media.c
gst/rtsp-server/rtsp-media.h

index 4b8d405..016f700 100644 (file)
@@ -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;
 
index 7a24fcf..016526d 100644 (file)
@@ -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);