diff --git a/gst/rtp/gstrtph263ppay.c b/gst/rtp/gstrtph263ppay.c index bb10cda42b..c944a0fe48 100644 --- a/gst/rtp/gstrtph263ppay.c +++ b/gst/rtp/gstrtph263ppay.c @@ -63,7 +63,7 @@ static GstStaticPadTemplate gst_rtp_h263p_pay_sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, - GST_STATIC_CAPS ("video/x-h263, " "variant = (string) \"itu\"") + GST_STATIC_CAPS ("video/x-h263, variant = (string) itu") ); /* @@ -244,7 +244,20 @@ gst_rtp_h263p_pay_sink_getcaps (GstRTPBasePayload * payload, GstPad * pad, peercaps = gst_pad_peer_query_caps (GST_RTP_BASE_PAYLOAD_SRCPAD (payload), filter); - if (!peercaps) + + /* if we're just outputting to udpsink or fakesink or so, we should also + * accept any input compatible with our sink template caps */ + if (!peercaps || gst_caps_is_any (peercaps)) + return + gst_pad_get_pad_template_caps (GST_RTP_BASE_PAYLOAD_SINKPAD (payload)); + + /* We basically need to differentiate two use-cases here: One where there's + * a capsfilter after the payloader with caps created from an SDP; in this + * case the filter caps are fixed and we want to signal to an encoder what + * we want it to produce. The second case is simply payloader ! depayloader + * where we are dealing with the depayloader's template caps. In this case + * we should accept any input compatible with our sink template caps. */ + if (!gst_caps_is_fixed (peercaps)) return gst_pad_get_pad_template_caps (GST_RTP_BASE_PAYLOAD_SINKPAD (payload)); diff --git a/tests/check/elements/rtp-payloading.c b/tests/check/elements/rtp-payloading.c index 6e096c6f0c..7b045022e6 100644 --- a/tests/check/elements/rtp-payloading.c +++ b/tests/check/elements/rtp-payloading.c @@ -480,6 +480,26 @@ GST_START_TEST (rtp_h263p) rtp_pipeline_test (rtp_h263p_frame_data, rtp_h263p_frame_data_size, rtp_h263p_frame_count, "video/x-h263,variant=(string)itu," "h263version=(string)h263", "rtph263ppay", "rtph263pdepay", 0, 0, FALSE); + + /* payloader should accept any input that matches the template caps + * if there's just a udpsink or fakesink downstream */ + rtp_pipeline_test (rtp_h263p_frame_data, rtp_h263p_frame_data_size, + rtp_h263p_frame_count, "video/x-h263,variant=(string)itu," + "h263version=(string)h263", "rtph263ppay", "identity", 0, 0, FALSE); + + /* default output of avenc_h263p */ + rtp_pipeline_test (rtp_h263p_frame_data, rtp_h263p_frame_data_size, + rtp_h263p_frame_count, "video/x-h263,variant=(string)itu," + "h263version=(string)h263p, annex-f=(boolean)true, " + "annex-j=(boolean)true, annex-i=(boolean)true, annex-t=(boolean)true", + "rtph263ppay", "identity", 0, 0, FALSE); + + /* pay ! depay should also work with any input */ + rtp_pipeline_test (rtp_h263p_frame_data, rtp_h263p_frame_data_size, + rtp_h263p_frame_count, "video/x-h263,variant=(string)itu," + "h263version=(string)h263p, annex-f=(boolean)true, " + "annex-j=(boolean)true, annex-i=(boolean)true, annex-t=(boolean)true", + "rtph263ppay", "rtph263pdepay", 0, 0, FALSE); } GST_END_TEST;