gst/rtp/gstrtpilbcpay.c: Set the encoding-name in the rtp caps to all uppercase, as required by the caps spec.

Original commit message from CVS:
Patch by: Tommi Myöhänen  <ext-tommi dot myohanen at nokia dot com>
* gst/rtp/gstrtpilbcpay.c: (gst_rtpilbcpay_setcaps):
Set the encoding-name in the rtp caps to all uppercase, as required by
the caps spec.
Some small cleanups in the error paths. Fixes #453037.
This commit is contained in:
Tommi Myöhänen 2007-07-03 09:59:46 +00:00 committed by Wim Taymans
parent 6f765c5f1d
commit f925b3151e
2 changed files with 39 additions and 16 deletions

View file

@ -1,3 +1,12 @@
2007-07-03 Wim Taymans,,, <set EMAIL_ADDRESS environment variable>
Patch by: Tommi Myöhänen <ext-tommi dot myohanen at nokia dot com>
* gst/rtp/gstrtpilbcpay.c: (gst_rtpilbcpay_setcaps):
Set the encoding-name in the rtp caps to all uppercase, as required by
the caps spec.
Some small cleanups in the error paths. Fixes #453037.
2007-06-28 Sebastian Dröge <slomo@circular-chaos.org> 2007-06-28 Sebastian Dröge <slomo@circular-chaos.org>
* ext/wavpack/gstwavpackparse.c: * ext/wavpack/gstwavpackparse.c:

View file

@ -125,32 +125,46 @@ gst_rtpilbcpay_setcaps (GstBaseRTPPayload * basertppayload, GstCaps * caps)
structure = gst_caps_get_structure (caps, 0); structure = gst_caps_get_structure (caps, 0);
gst_structure_get_int (structure, "mode", &mode); gst_structure_get_int (structure, "mode", &mode);
if (mode != 20 && mode != 30) { if (mode != 20 && mode != 30)
return FALSE; goto wrong_mode;
}
payload_name = gst_structure_get_name (structure); payload_name = gst_structure_get_name (structure);
if (g_strcasecmp ("audio/x-iLBC", payload_name) == 0) { if (g_strcasecmp ("audio/x-iLBC", payload_name))
gst_basertppayload_set_options (basertppayload, "audio", TRUE, "iLBC", goto wrong_caps;
8000);
/* set options for this frame based audio codec */ gst_basertppayload_set_options (basertppayload, "audio", TRUE, "ILBC", 8000);
gst_base_rtp_audio_payload_set_frame_options (basertpaudiopayload, /* set options for this frame based audio codec */
mode, mode == 30 ? 50 : 38); gst_base_rtp_audio_payload_set_frame_options (basertpaudiopayload,
} else { mode, mode == 30 ? 50 : 38);
return FALSE;
}
ret = ret =
gst_basertppayload_set_outcaps (basertppayload, "mode", G_TYPE_INT, mode, gst_basertppayload_set_outcaps (basertppayload, "mode", G_TYPE_INT, mode,
NULL); NULL);
if (mode != rtpilbcpay->mode && rtpilbcpay->mode != -1) { if (mode != rtpilbcpay->mode && rtpilbcpay->mode != -1)
goto mode_changed;
rtpilbcpay->mode = mode;
return ret;
/* ERRORS */
wrong_mode:
{
GST_ERROR_OBJECT (rtpilbcpay, "mode must be 20 or 30, received %d", mode);
return FALSE;
}
wrong_caps:
{
GST_ERROR_OBJECT (rtpilbcpay, "expected audio/x-iLBC, received %s",
payload_name);
return FALSE;
}
mode_changed:
{
GST_ERROR_OBJECT (rtpilbcpay, "Mode has changed from %d to %d! " GST_ERROR_OBJECT (rtpilbcpay, "Mode has changed from %d to %d! "
"Mode cannot change while streaming", rtpilbcpay->mode, mode); "Mode cannot change while streaming", rtpilbcpay->mode, mode);
return FALSE; return FALSE;
} }
rtpilbcpay->mode = mode;
return ret;
} }
gboolean gboolean