rtph264pay: ensure output caps are set when pushing output data
... even if some SPS/PPS has not passed by yet.
This commit is contained in:
parent
1ed37c8229
commit
e5ab3cc0a0
@ -427,13 +427,17 @@ gst_rtp_h264_pay_set_sps_pps (GstRTPBasePayload * basepayload)
|
|||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* profile is 24 bit. Force it to respect the limit */
|
if (G_LIKELY (count)) {
|
||||||
profile = g_strdup_printf ("%06x", payloader->profile & 0xffffff);
|
/* profile is 24 bit. Force it to respect the limit */
|
||||||
/* combine into output caps */
|
profile = g_strdup_printf ("%06x", payloader->profile & 0xffffff);
|
||||||
res = gst_rtp_base_payload_set_outcaps (basepayload,
|
/* combine into output caps */
|
||||||
"sprop-parameter-sets", G_TYPE_STRING, sprops->str, NULL);
|
res = gst_rtp_base_payload_set_outcaps (basepayload,
|
||||||
|
"sprop-parameter-sets", G_TYPE_STRING, sprops->str, NULL);
|
||||||
|
g_free (profile);
|
||||||
|
} else {
|
||||||
|
res = gst_rtp_base_payload_set_outcaps (basepayload, NULL);
|
||||||
|
}
|
||||||
g_string_free (sprops, TRUE);
|
g_string_free (sprops, TRUE);
|
||||||
g_free (profile);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -879,6 +883,12 @@ gst_rtp_h264_pay_payload_nal (GstRTPBasePayload * basepayload,
|
|||||||
nalType = data[0] & 0x1f;
|
nalType = data[0] & 0x1f;
|
||||||
GST_DEBUG_OBJECT (rtph264pay, "Processing Buffer with NAL TYPE=%d", nalType);
|
GST_DEBUG_OBJECT (rtph264pay, "Processing Buffer with NAL TYPE=%d", nalType);
|
||||||
|
|
||||||
|
/* should set src caps before pushing stuff,
|
||||||
|
* and if we did not see enough SPS/PPS, that may not be the case */
|
||||||
|
if (G_UNLIKELY (!gst_pad_has_current_caps (GST_RTP_BASE_PAYLOAD_SRCPAD
|
||||||
|
(basepayload))))
|
||||||
|
gst_rtp_h264_pay_set_sps_pps (basepayload);
|
||||||
|
|
||||||
send_spspps = FALSE;
|
send_spspps = FALSE;
|
||||||
|
|
||||||
/* check if we need to emit an SPS/PPS now */
|
/* check if we need to emit an SPS/PPS now */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user