gstrtpmp4gpay: set dafault value for MPEG4 without codec data in caps.

https://bugzilla.gnome.org/show_bug.cgi?id=734263

Upstream Status: Submitted

Signed-off-by: Song Bing <b06498@freescale.com>
diff --git a/gst/rtp/gstrtpmp4gpay.c b/gst/rtp/gstrtpmp4gpay.c
index 7333b49..35f2c8c 100644
--- a/gst/rtp/gstrtpmp4gpay.c
+++ b/gst/rtp/gstrtpmp4gpay.c
@@ -390,6 +390,7 @@
   const GValue *codec_data;
   const gchar *media_type = NULL;
   gboolean res;
+  const gchar *name;
 
   rtpmp4gpay = GST_RTP_MP4G_PAY (payload);
 
@@ -400,7 +401,6 @@
     GST_LOG_OBJECT (rtpmp4gpay, "got codec_data");
     if (G_VALUE_TYPE (codec_data) == GST_TYPE_BUFFER) {
       GstBuffer *buffer;
-      const gchar *name;
 
       buffer = gst_value_get_buffer (codec_data);
       GST_LOG_OBJECT (rtpmp4gpay, "configuring codec_data");
@@ -426,6 +426,23 @@
 
       rtpmp4gpay->config = gst_buffer_copy (buffer);
     }
+  } else {
+    name = gst_structure_get_name (structure);
+
+    if (!strcmp (name, "video/mpeg")) {
+      rtpmp4gpay->profile = g_strdup ("1");
+
+      /* fixed rate */
+      rtpmp4gpay->rate = 90000;
+      /* video stream type */
+      rtpmp4gpay->streamtype = "4";
+      /* no params for video */
+      rtpmp4gpay->params = NULL;
+      /* mode */
+      rtpmp4gpay->mode = "generic";
+
+      media_type = "video";
+    }
   }
   if (media_type == NULL)
     goto config_failed;