--- gstreamer0.10-rtsp-0.10.8.orig/gst/rtsp-server/rtsp-media-factory.c
+++ gstreamer0.10-rtsp-0.10.8/gst/rtsp-server/rtsp-media-factory.c
@@ -23,6 +23,7 @@
 #define DEFAULT_SHARED         FALSE
 #define DEFAULT_EOS_SHUTDOWN   FALSE
 #define DEFAULT_MCAST_ADDRESS "224.2.0.3"
+#define DEFAULT_PREFER_MC      FALSE
 
 enum
 {
@@ -31,6 +32,7 @@ enum
   PROP_SHARED,
   PROP_EOS_SHUTDOWN,
   PROP_MC_OVERRIDE,
+  PROP_PREFER_MC,
   PROP_LAST
 };
 
@@ -103,6 +105,12 @@ gst_rtsp_media_factory_class_init (GstRT
 	  "Multicast Override", "Override the MC address in the SDP with another one",
       DEFAULT_MCAST_ADDRESS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
+  g_object_class_install_property (gobject_class, PROP_PREFER_MC,
+      g_param_spec_boolean ("prefer-mc", "Prefer Multicast",
+          "Prefer Multicast traffic over Unicast traffic",
+          DEFAULT_PREFER_MC, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+
   klass->gen_key = default_gen_key;
   klass->get_element = default_get_element;
   klass->construct = default_construct;
@@ -126,6 +134,7 @@ gst_rtsp_media_factory_init (GstRTSPMedi
       g_free, g_object_unref);
 
   factory->mc_override = g_strdup(DEFAULT_MCAST_ADDRESS);
+  factory->prefer_mcast = DEFAULT_PREFER_MC;
 }
 
 static void
@@ -163,6 +172,10 @@ gst_rtsp_media_factory_get_property (GOb
     case PROP_MC_OVERRIDE:
       g_value_set_string (value, gst_rtsp_media_factory_get_mc_override(factory));
       break;
+    case PROP_PREFER_MC:
+      g_value_set_boolean (value, 
+          gst_rtsp_media_factory_get_prefer_mcast (factory));
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec);
   }
@@ -188,6 +201,10 @@ gst_rtsp_media_factory_set_property (GOb
     case PROP_MC_OVERRIDE:
       gst_rtsp_media_factory_set_mc_override(factory, g_value_get_string(value));
       break;
+    case PROP_PREFER_MC:
+      gst_rtsp_media_factory_set_prefer_mcast (factory,
+          g_value_get_boolean (value));
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec);
   }
@@ -433,6 +450,49 @@ gst_rtsp_media_factory_get_mc_override (
   return result;
 }
 
+
+/**
+ * gst_rtsp_media_factory_set_prefer_mcast:
+ * @factory: a #GstRTSPMediaFactory
+ * @prefer_mcast: set to TRUE to force/prefer MCAST
+ *
+ * Configure if media created from this factory prefers multicast to
+ * unicast to send the RTP stream.
+ */
+void
+gst_rtsp_media_factory_set_prefer_mcast (GstRTSPMediaFactory *factory,
+		    gboolean prefer_mcast)
+{
+  g_return_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory));
+
+  g_mutex_lock (factory->lock);
+  factory->prefer_mcast = prefer_mcast;
+  g_mutex_unlock (factory->lock);
+}
+
+/**
+ * gst_rtsp_media_factory_get_prefer_mcast:
+ * @factory: a #GstRTSPMediaFactory
+ *
+ * Get if media created from this factory will prefer multicast traffic.
+ *
+ * Returns: %TRUE if the media will prefer multicast.
+ */
+gboolean
+gst_rtsp_media_factory_get_prefer_mcast (GstRTSPMediaFactory * factory)
+{
+  gboolean result;
+
+  g_return_val_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory), FALSE);
+
+  GST_RTSP_MEDIA_FACTORY_LOCK (factory);
+  result = factory->prefer_mcast;
+  GST_RTSP_MEDIA_FACTORY_UNLOCK (factory);
+
+  return result;
+}
+
+
 static gboolean
 compare_media (gpointer key, GstRTSPMedia * media1, GstRTSPMedia * media2)
 {
@@ -664,7 +724,12 @@ default_construct (GstRTSPMediaFactory *
   media->element = element;
 
   g_object_set(G_OBJECT(media), 
-		  "mc-override", factory->mc_override, 
+		  "mc-override", factory->mc_override,
+		  NULL);
+
+  if(factory->prefer_mcast)
+      g_object_set(G_OBJECT(media), 
+		  "protocols", GST_RTSP_LOWER_TRANS_UDP_MCAST,
 		  NULL);
 
   media->pipeline = klass->create_pipeline (factory, media);
--- gstreamer0.10-rtsp-0.10.8.orig/gst/rtsp-server/rtsp-media-factory.h
+++ gstreamer0.10-rtsp-0.10.8/gst/rtsp-server/rtsp-media-factory.h
@@ -69,6 +69,7 @@ struct _GstRTSPMediaFactory {
   GHashTable   *medias;
 
   gchar *mc_override;
+  gboolean     *prefer_mcast;
 };
 
 /**
@@ -126,6 +127,9 @@ GstRTSPAuth *         gst_rtsp_media_fac
 gchar*                gst_rtsp_media_factory_get_mc_override (GstRTSPMediaFactory *factory);
 void                  gst_rtsp_media_factory_set_mc_override (GstRTSPMediaFactory *factory, const gchar *addr);
 
+void                  gst_rtsp_media_factory_set_prefer_mcast (GstRTSPMediaFactory *factory, gboolean prefer_mcast);
+gboolean              gst_rtsp_media_factory_get_prefer_mcast (GstRTSPMediaFactory *factory);
+
 /* creating the media from the factory and a url */
 GstRTSPMedia *        gst_rtsp_media_factory_construct    (GstRTSPMediaFactory *factory,
                                                            const GstRTSPUrl *url);
