GNOME Bugzilla – Bug 431282
broken RTP depayloaders
Last modified: 2007-04-25 10:43:33 UTC
Hi, a few weeks ago the following cmdline worked fine :: GST_DEBUG=2 gst-launch audiotestsrc ! "audio/x-raw-int, rate=8000, clock-rate=8000" ! identity sync=true ! alawenc ! rtppcmapay min-ptime=20000000 max-ptime=40000000 ! rtppcmadepay ! filesink location=/tmp/toto.raw 0:00:00.113147000 18998 0x804e0b0 WARN GST_PLUGIN_LOADING gstplugin.c:414:gst_plugin_load_file: module_open failed: /usr/audio/dev/User/lglayal/GStreamer/Revision_Avril2007/Binaires//lib/gstreamer-0.10/libgstmsgsm.so: undefined symbol: gst_msgsmenc_get_type Setting pipeline to PAUSED ... Pipeline is PREROLLING ... 0:00:00.249304000 18997 0x80d05c8 WARN basertpdepayload gstbasertpdepayload.c:224:gst_base_rtp_depayload_chain:<rtppcmadepay0> error: no clock rate was specified, likely incomplete input caps 0:00:00.249634000 18997 0x80d05c8 WARN basertpdepayload gstbasertpdepayload.c:224:gst_base_rtp_depayload_chain:<rtppcmadepay0> error: no clock rate was specified, likely incomplete input caps ERROR: from element /pipeline0/rtppcmadepay0: The stream is in the wrong format. Additional debug info: gstbasertpdepayload.c(224): gst_base_rtp_depayload_chain (): /pipeline0/rtppcmadepay0: no clock rate was specified, likely incomplete input caps ERROR: pipeline doesn't want to preroll. Setting pipeline to NULL ... 0:00:00.249920000 18997 0x80d05c8 WARN basertpdepayload gstbasertpdepayload.c:224:gst_base_rtp_depayload_chain:<rtppcmadepay0> error: no clock rate was specified, likely incomplete input caps 0:00:00.250174000 18997 0x80d05c8 WARN basesrc gstbasesrc.c:1775:gst_base_src_loop:<audiotestsrc0> error: Internal data flow error. 0:00:00.250315000 18997 0x80d05c8 WARN basesrc gstbasesrc.c:1775:gst_base_src_loop:<audiotestsrc0> error: streaming task paused, reason not-negotiated (-4) FREEING pipeline ... error seems to take source in a missing clock_rate. Shouldn't each depayloader call gst_basertppayload_set_options(payload, media, type, encname, CLOCKRATE); Regards
Adding "depayload->clock_rate = 8000;" to the rtppcmadepay.c, solve the problem, now the cmd line works fine. But i don't think it's the right way to solve the problem. static gboolean gst_rtp_pcma_depay_setcaps (GstBaseRTPDepayload * depayload, GstCaps * caps) { GstCaps *srccaps; gboolean ret; srccaps = gst_caps_new_simple ("audio/x-alaw", "channels", G_TYPE_INT, 1, "rate", G_TYPE_INT, 8000, NULL); depayload->clock_rate = 8000; ret = gst_pad_set_caps (GST_BASE_RTP_DEPAYLOAD_SRCPAD (depayload), srccaps); gst_caps_unref (srccaps); return ret; } Regards.
I modified rtppcmadepay to add basic trace :: static void gst_rtp_pcma_depay_init (GstRtpPcmaDepay * rtppcmadepay, GstRtpPcmaDepayClass * klass) { GstBaseRTPDepayload *depayload; depayload = GST_BASE_RTP_DEPAYLOAD (rtppcmadepay); depayload->clock_rate = 8000; gst_pad_use_fixed_caps (GST_BASE_RTP_DEPAYLOAD_SRCPAD (depayload)); printf("----------------INIT CALLED %p %d ----------\n", depayload,depayload->clock_rate); } static gboolean gst_rtp_pcma_depay_setcaps (GstBaseRTPDepayload * depayload, GstCaps * caps) { GstCaps *srccaps; gboolean ret; printf("----------------DEPAY CAPS SRC CALLED %p %d----------\n", depayload, depayload->clock_rate); srccaps = gst_caps_new_simple ("audio/x-alaw", "channels", G_TYPE_INT, 1, "rate", G_TYPE_INT, 8000, NULL); ret = gst_pad_set_caps (GST_BASE_RTP_DEPAYLOAD_SRCPAD (depayload), srccaps); gst_caps_unref (srccaps); return ret; } And here is the result ----------------INIT CALLED 0x814b000 8000 ---------- ----------------DEPAY CAPS SRC CALLED 0x814b000 0---------- Any idea ?
clock_rate seems to be overwritten during state transition GST_STATE_CHANGE_READY_TO_PAUSED inside GstStateChangeReturn gst_base_rtp_depayload_change_state (GstElement * element, GstStateChange transition), discarding previous clock_rate set inside void gst_rtp_pcma_depay_init (GstRtpPcmaDepay * rtppcmadepay, GstRtpPcmaDepayClass * klass); Regards.
Hi, removing the line 'filter->clock_rate = 0;' in the following function seems to solve the problem. static GstStateChangeReturn gst_base_rtp_depayload_change_state (GstElement * element, GstStateChange transition) { GstBaseRTPDepayload *filter; GstStateChangeReturn ret; filter = GST_BASE_RTP_DEPAYLOAD (element); /* we disallow changing the state from the thread */ if (g_thread_self () == filter->thread) goto wrong_thread; switch (transition) { case GST_STATE_CHANGE_NULL_TO_READY: if (!gst_base_rtp_depayload_start_thread (filter)) goto start_failed; break; case GST_STATE_CHANGE_READY_TO_PAUSED: GST_DEBUG_OBJECT (filter, "Removed clock_rate overwritting"); /* clock_rate needs to be overwritten by child */ /* filter->clock_rate = 0; */ filter->priv->clock_base = -1; filter->need_newsegment = TRUE; break; case GST_STATE_CHANGE_PAUSED_TO_PLAYING: break; default: break; } ... Regards.
* gst/rtp/gstrtpL16depay.c: (gst_rtp_L16_depay_set_property): * gst/rtp/gstrtpamrdepay.c: (gst_rtp_amr_depay_init), (gst_rtp_amr_depay_setcaps), (gst_rtp_amr_depay_process): * gst/rtp/gstrtpgsmdepay.c: (gst_rtp_gsm_depay_init), (gst_rtp_gsm_depay_setcaps): * gst/rtp/gstrtph263pdepay.c: (gst_rtp_h263p_depay_setcaps): * gst/rtp/gstrtph264depay.c: (gst_rtp_h264_depay_setcaps): * gst/rtp/gstrtpilbcdepay.c: (gst_rtp_ilbc_depay_class_init), (gst_rtp_ilbc_depay_init), (gst_rtp_ilbc_depay_setcaps), (gst_rtp_ilbc_depay_process), (gst_ilbc_depay_set_property), (gst_ilbc_depay_get_property): * gst/rtp/gstrtpmp2tdepay.c: (gst_rtp_mp2t_depay_setcaps): * gst/rtp/gstrtpmp4adepay.c: * gst/rtp/gstrtppcmadepay.c: (gst_rtp_pcma_depay_init), (gst_rtp_pcma_depay_setcaps): * gst/rtp/gstrtppcmudepay.c: (gst_rtp_pcmu_depay_init), (gst_rtp_pcmu_depay_setcaps): Make sure we configure the clock_rate in the baseclass in the setcaps function. Fixes #431282.
Works fine. Thank you, Regards.