rtph264pay: append profile-level-id to SDP
authorSrimanta Panda <srimanta@axis.com>
Tue, 22 Jul 2014 11:24:09 +0000 (13:24 +0200)
committerTim-Philipp Müller <tim@centricular.com>
Fri, 1 Aug 2014 15:01:07 +0000 (16:01 +0100)
Append profile-level-id to SDP if available.

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

gst/rtp/gstrtph264pay.c

index 3d835ae..d3e319b 100644 (file)
@@ -390,12 +390,19 @@ gst_rtp_h264_pay_set_sps_pps (GstRTPBasePayload * basepayload)
   }
 
   if (G_LIKELY (count)) {
-    /* profile is 24 bit. Force it to respect the limit */
-    profile = g_strdup_printf ("%06x", payloader->profile & 0xffffff);
-    /* combine into output caps */
-    res = gst_rtp_base_payload_set_outcaps (basepayload,
-        "sprop-parameter-sets", G_TYPE_STRING, sprops->str, NULL);
-    g_free (profile);
+    if (payloader->profile != 0) {
+      /* profile is 24 bit. Force it to respect the limit */
+      profile = g_strdup_printf ("%06x", payloader->profile & 0xffffff);
+      /* combine into output caps */
+      res = gst_rtp_base_payload_set_outcaps (basepayload,
+          "profile-level-id", G_TYPE_STRING, profile,
+          "sprop-parameter-sets", G_TYPE_STRING, sprops->str, NULL);
+      g_free (profile);
+    } else {
+      res = gst_rtp_base_payload_set_outcaps (basepayload,
+          "sprop-parameter-sets", G_TYPE_STRING, sprops->str, NULL);
+    }
+
   } else {
     res = gst_rtp_base_payload_set_outcaps (basepayload, NULL);
   }