diff options
author | Olivier Crete <tester@tester.ca> | 2007-08-08 10:54:50 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2007-08-08 10:54:50 +0000 |
commit | cfc23b6130ff1ff4fba44750e9c03ac47099ff1f (patch) | |
tree | 053855874aa1fed5a2a1b50e373c9dcb1db27bce | |
parent | 04bae8775a73641649a81f37dac0189382c9673c (diff) |
gst/rtp/: Make mode property a string. Fixes #464475.
Original commit message from CVS:
Patch by: Olivier Crete <tester at tester dot ca>
* gst/rtp/gstrtpilbcdepay.c: (gst_rtp_ilbc_depay_setcaps):
* gst/rtp/gstrtpilbcpay.c: (gst_rtpilbcpay_setcaps):
Make mode property a string. Fixes #464475.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | gst/rtp/gstrtpilbcdepay.c | 15 | ||||
-rw-r--r-- | gst/rtp/gstrtpilbcpay.c | 12 |
3 files changed, 29 insertions, 6 deletions
@@ -1,3 +1,11 @@ +2007-08-08 Wim Taymans <wim.taymans@gmail.com> + + Patch by: Olivier Crete <tester at tester dot ca> + + * gst/rtp/gstrtpilbcdepay.c: (gst_rtp_ilbc_depay_setcaps): + * gst/rtp/gstrtpilbcpay.c: (gst_rtpilbcpay_setcaps): + Make mode property a string. Fixes #464475. + 2007-08-05 Stefan Kost <ensonic@users.sf.net> * ext/flac/gstflacenc.c: diff --git a/gst/rtp/gstrtpilbcdepay.c b/gst/rtp/gstrtpilbcdepay.c index 3ab1611d..a8290561 100644 --- a/gst/rtp/gstrtpilbcdepay.c +++ b/gst/rtp/gstrtpilbcdepay.c @@ -56,7 +56,8 @@ GST_STATIC_PAD_TEMPLATE ("sink", "media = (string) \"audio\", " "payload = (int) " GST_RTP_PAYLOAD_DYNAMIC_STRING ", " "clock-rate = (int) 8000, " - "encoding-name = (string) \"ILBC\", " "mode = (int) { 20, 30 }") + "encoding-name = (string) \"ILBC\", " + "mode = (string) { \"20\", \"30\" }") ); static GstStaticPadTemplate gst_rtp_ilbc_depay_src_template = @@ -149,14 +150,22 @@ gst_rtp_ilbc_depay_setcaps (GstBaseRTPDepayload * depayload, GstCaps * caps) GstRTPiLBCDepay *rtpilbcdepay = GST_RTP_ILBC_DEPAY (depayload); GstCaps *srccaps; GstStructure *structure; + const gchar *mode_str = NULL; gint mode; gboolean ret; structure = gst_caps_get_structure (caps, 0); - /* parse mode, if we can */ mode = rtpilbcdepay->mode; - gst_structure_get_int (structure, "mode", &mode); + + /* parse mode, if we can */ + mode_str = gst_structure_get_string (structure, "mode"); + if (mode_str) { + mode = strtol (mode_str, NULL, 10); + if (mode != 20 && mode != 30) + mode = rtpilbcdepay->mode; + } + rtpilbcdepay->mode = mode; srccaps = gst_caps_new_simple ("audio/x-iLBC", diff --git a/gst/rtp/gstrtpilbcpay.c b/gst/rtp/gstrtpilbcpay.c index 736e633d..708f5357 100644 --- a/gst/rtp/gstrtpilbcpay.c +++ b/gst/rtp/gstrtpilbcpay.c @@ -50,7 +50,8 @@ GST_STATIC_PAD_TEMPLATE ("src", "media = (string) \"audio\", " "payload = (int) " GST_RTP_PAYLOAD_DYNAMIC_STRING ", " "clock-rate = (int) 8000, " - "encoding-name = (string) \"ILBC\", " "mode = (int) {20, 30}") + "encoding-name = (string) \"ILBC\", " + "mode = (string) { \"20\", \"30\" }") ); static gboolean gst_rtpilbcpay_setcaps (GstBaseRTPPayload * payload, @@ -116,6 +117,7 @@ gst_rtpilbcpay_setcaps (GstBaseRTPPayload * basertppayload, GstCaps * caps) GstBaseRTPAudioPayload *basertpaudiopayload; gboolean ret; gint mode; + gchar *mode_str; GstStructure *structure; const char *payload_name; @@ -137,9 +139,13 @@ gst_rtpilbcpay_setcaps (GstBaseRTPPayload * basertppayload, GstCaps * caps) gst_base_rtp_audio_payload_set_frame_options (basertpaudiopayload, mode, mode == 30 ? 50 : 38); + + mode_str = g_strdup_printf ("%d", mode); ret = - gst_basertppayload_set_outcaps (basertppayload, "mode", G_TYPE_INT, mode, - NULL); + gst_basertppayload_set_outcaps (basertppayload, "mode", G_TYPE_STRING, + mode_str, NULL); + g_free (mode_str); + if (mode != rtpilbcpay->mode && rtpilbcpay->mode != -1) goto mode_changed; |