From dd13e85ca127f793e45f5616bffecb8643cd6f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= Date: Mon, 7 Jun 2010 11:15:26 -0400 Subject: [PATCH] dtmfdetect: Only works with rate=8000, fix in caps --- gst/dtmf/gstdtmfdetect.c | 8 ++------ gst/dtmf/gstdtmfdetect.h | 2 -- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/gst/dtmf/gstdtmfdetect.c b/gst/dtmf/gstdtmfdetect.c index cca196dad1..6fa17b5e49 100644 --- a/gst/dtmf/gstdtmfdetect.c +++ b/gst/dtmf/gstdtmfdetect.c @@ -74,7 +74,7 @@ static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", "width = (int) 16, " "depth = (int) 16, " "endianness = (int) " G_STRINGIFY (G_BYTE_ORDER) ", " - "signed = (bool) true, rate = (int) [1, MAX], channels = (int) 1")); + "signed = (bool) true, rate = (int) 8000, channels = (int) 1")); static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, @@ -83,7 +83,7 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src", "width = (int) 16, " "depth = (int) 16, " "endianness = (int) " G_STRINGIFY (G_BYTE_ORDER) ", " - "signed = (bool) true, rate = (int) [1, MAX], channels = (int) 1")); + "signed = (bool) true, rate = (int) 8000, channels = (int) 1")); /* signals and args */ enum @@ -155,10 +155,6 @@ gst_dtmf_detect_set_caps (GstBaseTransform * trans, GstCaps * incaps, GstCaps * outcaps) { GstDtmfDetect *self = GST_DTMF_DETECT (trans); - GstStructure *s = gst_caps_get_structure (incaps, 0); - - if (!gst_structure_get_int (s, "rate", &self->rate)) - return FALSE; zap_dtmf_detect_init (&self->dtmf_state); diff --git a/gst/dtmf/gstdtmfdetect.h b/gst/dtmf/gstdtmfdetect.h index b3bfab94ae..01a090792c 100644 --- a/gst/dtmf/gstdtmfdetect.h +++ b/gst/dtmf/gstdtmfdetect.h @@ -54,8 +54,6 @@ struct _GstDtmfDetect { GstBaseTransform parent; - gint rate; - dtmf_detect_state_t dtmf_state; };