From: Jonas Holmberg Date: Mon, 21 May 2012 10:17:35 +0000 (+0200) Subject: rtph264pay: Add unrestricted caps X-Git-Tag: RELEASE-0.11.92~59 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7bf3a1bf957769c248c08c41797bff1748d0ec74;p=platform%2Fupstream%2Fgst-plugins-good.git rtph264pay: Add unrestricted caps If there are no profile restrictions downstream, return caps with profile=constrained-baseline in the first structure and append unrestricted caps as the last structure. Fixes bug #672019 --- diff --git a/gst/rtp/gstrtph264pay.c b/gst/rtp/gstrtph264pay.c index 90a41beb1..1190795f0 100644 --- a/gst/rtp/gstrtph264pay.c +++ b/gst/rtp/gstrtph264pay.c @@ -273,6 +273,7 @@ gst_rtp_h264_pay_getcaps (GstRTPBasePayload * payload, GstPad * pad, GstCaps *template_caps; GstCaps *allowed_caps; GstCaps *caps, *icaps; + gboolean append_unrestricted; guint i; allowed_caps = @@ -296,6 +297,7 @@ gst_rtp_h264_pay_getcaps (GstRTPBasePayload * payload, GstPad * pad, caps = gst_caps_new_empty (); + append_unrestricted = FALSE; for (i = 0; i < gst_caps_get_size (allowed_caps); i++) { GstStructure *s = gst_caps_get_structure (allowed_caps, i); GstStructure *new_s = gst_structure_new_empty ("video/x-h264"); @@ -364,15 +366,20 @@ gst_rtp_h264_pay_getcaps (GstRTPBasePayload * payload, GstPad * pad, "profile", G_TYPE_STRING, "constrained-baseline", NULL); } } else { - /* No profile-level-id also means baseline */ + /* No profile-level-id means baseline or unrestricted */ gst_structure_set (new_s, "profile", G_TYPE_STRING, "constrained-baseline", NULL); + append_unrestricted = TRUE; } caps = gst_caps_merge_structure (caps, new_s); } + if (append_unrestricted) { + gst_caps_merge_structure (caps, gst_structure_new ("video/x-h264", NULL)); + } + icaps = gst_caps_intersect (caps, template_caps); gst_caps_unref (caps); caps = icaps;