summaryrefslogtreecommitdiffstats
path: root/gst/dtmf
diff options
context:
space:
mode:
authorOlivier Crete <olivier.crete@collabora.co.uk>2008-06-13 23:30:06 +0000
committerEdward Hervey <bilboed@bilboed.com>2009-02-21 17:48:05 +0100
commitdd8d949bd9547d3f14f67729a857a894e14c0a55 (patch)
tree0345bbf2879a85af551f5ba345e06a13606ca535 /gst/dtmf
parentbcba873b2926572200a3f99124191b59745ff5f5 (diff)
downloadgst-plugins-bad-dd8d949bd9547d3f14f67729a857a894e14c0a55.tar.gz
gst-plugins-bad-dd8d949bd9547d3f14f67729a857a894e14c0a55.tar.bz2
gst-plugins-bad-dd8d949bd9547d3f14f67729a857a894e14c0a55.zip
[MOVED FROM GST-P-FARSIGHT] Take the clock-rate from the caps in rtpdtmfsrc
20080613233006-3e2dc-a7d4e918643f4f8c1bb2cc2678558c654025920e.gz
Diffstat (limited to 'gst/dtmf')
-rw-r--r--gst/dtmf/gstrtpdtmfsrc.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/gst/dtmf/gstrtpdtmfsrc.c b/gst/dtmf/gstrtpdtmfsrc.c
index 76c2b0e7..58dceb46 100644
--- a/gst/dtmf/gstrtpdtmfsrc.c
+++ b/gst/dtmf/gstrtpdtmfsrc.c
@@ -195,7 +195,7 @@ GST_STATIC_PAD_TEMPLATE ("src",
"clock-rate = (int) [ 0, MAX ], "
"ssrc = (int) [ 0, MAX ], "
"encoding-name = (string) \"TELEPHONE-EVENT\"")
- /* "events = (string) \"1-16\" */
+ /* "events = (string) \"0-15\" */
);
@@ -856,7 +856,6 @@ gst_rtp_dtmf_src_negotiate (GstBaseSrc * basesrc)
/* fill in the defaults, there properties cannot be negotiated. */
srccaps = gst_caps_new_simple ("application/x-rtp",
"media", G_TYPE_STRING, "audio",
- "clock-rate", G_TYPE_INT, dtmfsrc->clock_rate,
"encoding-name", G_TYPE_STRING, "TELEPHONE-EVENT", NULL);
/* the peer caps can override some of the defaults */
@@ -867,6 +866,7 @@ gst_rtp_dtmf_src_negotiate (GstBaseSrc * basesrc)
"payload", G_TYPE_INT, dtmfsrc->pt,
"ssrc", G_TYPE_UINT, dtmfsrc->current_ssrc,
"clock-base", G_TYPE_UINT, dtmfsrc->ts_base,
+ "clock-rate", G_TYPE_INT, dtmfsrc->clock_rate,
"seqnum-base", G_TYPE_UINT, dtmfsrc->seqnum_base, NULL);
GST_DEBUG_OBJECT (dtmfsrc, "no peer caps: %" GST_PTR_FORMAT, srccaps);
@@ -875,6 +875,7 @@ gst_rtp_dtmf_src_negotiate (GstBaseSrc * basesrc)
GstStructure *s;
const GValue *value;
gint pt;
+ gint clock_rate;
/* peer provides caps we can use to fixate, intersect. This always returns a
* writable caps. */
@@ -919,6 +920,19 @@ gst_rtp_dtmf_src_negotiate (GstBaseSrc * basesrc)
}
}
+ if (gst_structure_get_int (s, "clock-rate", &clock_rate))
+ {
+ dtmfsrc->clock_rate = clock_rate;
+ GST_LOG_OBJECT (dtmfsrc, "using clock-rate from caps %d",
+ dtmfsrc->clock_rate);
+ } else {
+ GST_LOG_OBJECT (dtmfsrc, "using existing clock-rate %d",
+ dtmfsrc->clock_rate);
+ }
+ gst_structure_set (s, "clock-rate", G_TYPE_INT, dtmfsrc->clock_rate,
+ NULL);
+
+
if (gst_structure_has_field_typed (s, "ssrc", G_TYPE_UINT)) {
value = gst_structure_get_value (s, "ssrc");
dtmfsrc->current_ssrc = g_value_get_uint (value);