mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:26:14 +00:00
rtph264pay: Don't ignore the return value from set_outcaps
https://bugzilla.gnome.org/show_bug.cgi?id=607353
This commit is contained in:
parent
2261bd8346
commit
7a0590b1f1
1 changed files with 22 additions and 8 deletions
|
@ -238,7 +238,7 @@ gst_rtp_h264_pay_finalize (GObject * object)
|
||||||
|
|
||||||
/* take the currently configured SPS and PPS lists and set them on the caps as
|
/* take the currently configured SPS and PPS lists and set them on the caps as
|
||||||
* sprop-parameter-sets */
|
* sprop-parameter-sets */
|
||||||
static void
|
static gboolean
|
||||||
gst_rtp_h264_pay_set_sps_pps (GstBaseRTPPayload * basepayload)
|
gst_rtp_h264_pay_set_sps_pps (GstBaseRTPPayload * basepayload)
|
||||||
{
|
{
|
||||||
GstRtpH264Pay *payloader = GST_RTP_H264_PAY (basepayload);
|
GstRtpH264Pay *payloader = GST_RTP_H264_PAY (basepayload);
|
||||||
|
@ -247,6 +247,7 @@ gst_rtp_h264_pay_set_sps_pps (GstBaseRTPPayload * basepayload)
|
||||||
GList *walk;
|
GList *walk;
|
||||||
GString *sprops;
|
GString *sprops;
|
||||||
guint count;
|
guint count;
|
||||||
|
gboolean res;
|
||||||
|
|
||||||
sprops = g_string_new ("");
|
sprops = g_string_new ("");
|
||||||
count = 0;
|
count = 0;
|
||||||
|
@ -274,11 +275,13 @@ gst_rtp_h264_pay_set_sps_pps (GstBaseRTPPayload * basepayload)
|
||||||
/* profile is 24 bit. Force it to respect the limit */
|
/* profile is 24 bit. Force it to respect the limit */
|
||||||
profile = g_strdup_printf ("%06x", payloader->profile & 0xffffff);
|
profile = g_strdup_printf ("%06x", payloader->profile & 0xffffff);
|
||||||
/* combine into output caps */
|
/* combine into output caps */
|
||||||
gst_basertppayload_set_outcaps (basepayload, "profile-level-id",
|
res = gst_basertppayload_set_outcaps (basepayload, "profile-level-id",
|
||||||
G_TYPE_STRING, profile,
|
G_TYPE_STRING, profile,
|
||||||
"sprop-parameter-sets", G_TYPE_STRING, sprops->str, NULL);
|
"sprop-parameter-sets", G_TYPE_STRING, sprops->str, NULL);
|
||||||
g_string_free (sprops, TRUE);
|
g_string_free (sprops, TRUE);
|
||||||
g_free (profile);
|
g_free (profile);
|
||||||
|
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -393,7 +396,8 @@ gst_rtp_h264_pay_setcaps (GstBaseRTPPayload * basepayload, GstCaps * caps)
|
||||||
size -= nal_size;
|
size -= nal_size;
|
||||||
}
|
}
|
||||||
/* and update the caps with the collected data */
|
/* and update the caps with the collected data */
|
||||||
gst_rtp_h264_pay_set_sps_pps (basepayload);
|
if (!gst_rtp_h264_pay_set_sps_pps (basepayload))
|
||||||
|
return FALSE;
|
||||||
} else {
|
} else {
|
||||||
GST_DEBUG_OBJECT (rtph264pay, "have bytestream h264");
|
GST_DEBUG_OBJECT (rtph264pay, "have bytestream h264");
|
||||||
rtph264pay->packetized = FALSE;
|
rtph264pay->packetized = FALSE;
|
||||||
|
@ -945,10 +949,12 @@ gst_rtp_h264_pay_handle_buffer (GstBaseRTPPayload * basepayload,
|
||||||
rtph264pay->sprop_parameter_sets != NULL) {
|
rtph264pay->sprop_parameter_sets != NULL) {
|
||||||
/* explicitly set profile and sprop, use those */
|
/* explicitly set profile and sprop, use those */
|
||||||
if (rtph264pay->update_caps) {
|
if (rtph264pay->update_caps) {
|
||||||
gst_basertppayload_set_outcaps (basepayload, "profile-level-id",
|
if (!gst_basertppayload_set_outcaps (basepayload, "profile-level-id",
|
||||||
G_TYPE_STRING, rtph264pay->profile_level_id,
|
G_TYPE_STRING, rtph264pay->profile_level_id,
|
||||||
"sprop-parameter-sets", G_TYPE_STRING,
|
"sprop-parameter-sets", G_TYPE_STRING,
|
||||||
rtph264pay->sprop_parameter_sets, NULL);
|
rtph264pay->sprop_parameter_sets, NULL))
|
||||||
|
goto caps_rejected;
|
||||||
|
|
||||||
rtph264pay->update_caps = FALSE;
|
rtph264pay->update_caps = FALSE;
|
||||||
|
|
||||||
GST_DEBUG
|
GST_DEBUG
|
||||||
|
@ -972,7 +978,8 @@ gst_rtp_h264_pay_handle_buffer (GstBaseRTPPayload * basepayload,
|
||||||
|
|
||||||
/* if has new SPS & PPS, update the output caps */
|
/* if has new SPS & PPS, update the output caps */
|
||||||
if (G_UNLIKELY (update))
|
if (G_UNLIKELY (update))
|
||||||
gst_rtp_h264_pay_set_sps_pps (basepayload);
|
if (!gst_rtp_h264_pay_set_sps_pps (basepayload))
|
||||||
|
goto caps_rejected;
|
||||||
|
|
||||||
/* second pass to payload and push */
|
/* second pass to payload and push */
|
||||||
data = nal_data;
|
data = nal_data;
|
||||||
|
@ -999,6 +1006,13 @@ gst_rtp_h264_pay_handle_buffer (GstBaseRTPPayload * basepayload,
|
||||||
gst_buffer_unref (buffer);
|
gst_buffer_unref (buffer);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
caps_rejected:
|
||||||
|
|
||||||
|
GST_WARNING_OBJECT (basepayload, "Could not set outcaps");
|
||||||
|
g_array_set_size (nal_queue, 0);
|
||||||
|
gst_buffer_unref (buffer);
|
||||||
|
return GST_FLOW_NOT_NEGOTIATED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue