After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 431282 - broken RTP depayloaders
broken RTP depayloaders
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal major
: 0.10.6
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-04-19 09:08 UTC by Laurent Glayal
Modified: 2007-04-25 10:43 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Laurent Glayal 2007-04-19 09:08:16 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
Comment 1 Laurent Glayal 2007-04-19 14:00:32 UTC
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.
Comment 2 Laurent Glayal 2007-04-20 07:06:21 UTC
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 ?
Comment 3 Laurent Glayal 2007-04-20 08:15:48 UTC
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.
Comment 4 Laurent Glayal 2007-04-23 07:58:49 UTC
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.
Comment 5 Wim Taymans 2007-04-25 09:47:54 UTC
        * 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.
Comment 6 Laurent Glayal 2007-04-25 10:43:33 UTC
Works fine.
Thank you,

Regards.