diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2007-04-25 09:47:48 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2007-04-25 09:47:48 +0000 |
commit | 24c5812d65e45f630edd172ce493ab9fac6df887 (patch) | |
tree | e6e532be7522238565734287de46f875c0a0ac78 /gst/rtp/gstrtppcmudepay.c | |
parent | 1beeda3ff2859372cecbea4542a4da8dc05960d6 (diff) |
gst/rtp/: Make sure we configure the clock_rate in the baseclass in the setcaps function. Fixes #431282.
Original commit message from CVS:
* 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.
Diffstat (limited to 'gst/rtp/gstrtppcmudepay.c')
-rw-r--r-- | gst/rtp/gstrtppcmudepay.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gst/rtp/gstrtppcmudepay.c b/gst/rtp/gstrtppcmudepay.c index aca02b84..4d467a10 100644 --- a/gst/rtp/gstrtppcmudepay.c +++ b/gst/rtp/gstrtppcmudepay.c @@ -112,7 +112,6 @@ gst_rtp_pcmu_depay_init (GstRtpPcmuDepay * rtppcmudepay, depayload = GST_BASE_RTP_DEPAYLOAD (rtppcmudepay); - depayload->clock_rate = 8000; gst_pad_use_fixed_caps (GST_BASE_RTP_DEPAYLOAD_SRCPAD (depayload)); } @@ -120,11 +119,17 @@ static gboolean gst_rtp_pcmu_depay_setcaps (GstBaseRTPDepayload * depayload, GstCaps * caps) { GstCaps *srccaps; + GstStructure *structure; gboolean ret; + gint clock_rate = 8000; /* default */ - srccaps = gst_caps_new_simple ("audio/x-mulaw", - "channels", G_TYPE_INT, 1, "rate", G_TYPE_INT, 8000, NULL); + structure = gst_caps_get_structure (caps, 0); + + gst_structure_get_int (structure, "clock-rate", &clock_rate); + depayload->clock_rate = clock_rate; + srccaps = gst_caps_new_simple ("audio/x-mulaw", + "channels", G_TYPE_INT, 1, "rate", G_TYPE_INT, clock_rate, NULL); ret = gst_pad_set_caps (GST_BASE_RTP_DEPAYLOAD_SRCPAD (depayload), srccaps); gst_caps_unref (srccaps); |