mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
rtpdtmfdepay: Use 1.0-style caps negotiation and audio/x-raw
This commit is contained in:
parent
0380de3f95
commit
0363c1cebf
1 changed files with 11 additions and 7 deletions
|
@ -308,19 +308,23 @@ gst_rtp_dtmf_depay_get_property (GObject * object, guint prop_id,
|
||||||
gboolean
|
gboolean
|
||||||
gst_rtp_dtmf_depay_setcaps (GstRTPBaseDepayload * filter, GstCaps * caps)
|
gst_rtp_dtmf_depay_setcaps (GstRTPBaseDepayload * filter, GstCaps * caps)
|
||||||
{
|
{
|
||||||
GstCaps *srccaps;
|
GstCaps *filtercaps, *srccaps;
|
||||||
GstStructure *structure = gst_caps_get_structure (caps, 0);
|
GstStructure *structure = gst_caps_get_structure (caps, 0);
|
||||||
gint clock_rate = 8000; /* default */
|
gint clock_rate = 8000; /* default */
|
||||||
|
|
||||||
gst_structure_get_int (structure, "clock-rate", &clock_rate);
|
gst_structure_get_int (structure, "clock-rate", &clock_rate);
|
||||||
filter->clock_rate = clock_rate;
|
filter->clock_rate = clock_rate;
|
||||||
|
|
||||||
srccaps = gst_caps_new_simple ("audio/x-raw-int",
|
filtercaps =
|
||||||
"width", G_TYPE_INT, 16,
|
gst_pad_get_pad_template_caps (GST_RTP_BASE_DEPAYLOAD_SRCPAD (filter));
|
||||||
"depth", G_TYPE_INT, 16,
|
|
||||||
"endianness", G_TYPE_INT, G_BYTE_ORDER,
|
filtercaps = gst_caps_make_writable (filtercaps);
|
||||||
"signed", G_TYPE_BOOLEAN, TRUE,
|
gst_caps_set_simple (filtercaps, "rate", G_TYPE_INT, clock_rate, NULL);
|
||||||
"channels", G_TYPE_INT, 1, "rate", G_TYPE_INT, clock_rate, NULL);
|
|
||||||
|
srccaps = gst_pad_peer_query_caps (GST_RTP_BASE_DEPAYLOAD_SRCPAD (filter),
|
||||||
|
filtercaps);
|
||||||
|
gst_caps_unref (filtercaps);
|
||||||
|
|
||||||
gst_pad_set_caps (GST_RTP_BASE_DEPAYLOAD_SRCPAD (filter), srccaps);
|
gst_pad_set_caps (GST_RTP_BASE_DEPAYLOAD_SRCPAD (filter), srccaps);
|
||||||
gst_caps_unref (srccaps);
|
gst_caps_unref (srccaps);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue