aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_usbradio.c
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-26 19:05:51 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-26 19:05:51 +0000
commit9ab76f9f85405e6abdede9eafed223f575c5dde5 (patch)
tree6370de713f623ccbd19a04fe52ccc8d1aad77288 /channels/chan_usbradio.c
parent084c43e96a25c22be12e9bac112163279a6b3c3c (diff)
Large cleanup of DSP code
Per comments from dimas: 1. The code now generates DTMF_BEGIN frames in addition to DTMF_END ones. 2. "quelching" rewritten - now each detector (MF/DTMF/generic tone) may mark fragment of a frame for suppression (squelching, muting) with a call to mute_fragment. Actual muting happens only once at the very end of ast_dsp_process where all marked fragments are zeroed. This way every detector sees original data in the frame without any piece of a frame being zeroed by a detector which was run before. 3. DTMF detector tries to "mute" one block before and one block after the block where actual tone was detected. Muting of previois block is something new for this patch. Obviously this operation is not always possible - if current frame does not contain data for previous block - it is too late. But at least we make our best. Muting of next block was already done by the old code but it only affects part of the next block which is in the frame being processed. New code keeps this information in state structures so it will mute proper number of samples in the next frame(s) too. 4. Removed ast_dsp_digitdetect and ast_dsp_getdigits APIs because these are not used. 5. DSP API extended a bit - ast_dsp_was_muted() function added which returns true if DSP code was muting any fragment in the last frame. chan_zap uses this function to decide it needs to turn on confmute on the channel. This is to replace AST_FRAME_DTMF 'm'/'u' (mute/unmute) functionality. (closes issue #11968) Reported by: dimas Patches: v2-11968-dsp.patch uploaded by dimas (license 88) v4-11968-zap.patch uploaded by dimas (license 88) Tested by: dimas, qwell git-svn-id: http://svn.digium.com/svn/asterisk/trunk@111022 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_usbradio.c')
-rw-r--r--channels/chan_usbradio.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/channels/chan_usbradio.c b/channels/chan_usbradio.c
index 11c06e957..84a2ce2bb 100644
--- a/channels/chan_usbradio.c
+++ b/channels/chan_usbradio.c
@@ -1210,8 +1210,6 @@ static struct ast_frame *usbradio_read(struct ast_channel *c)
if (o->dsp) {
f1 = ast_dsp_process(c, o->dsp, f);
if ((f1->frametype == AST_FRAME_DTMF_END) || (f1->frametype == AST_FRAME_DTMF_BEGIN)) {
- if ((f1->subclass == 'm') || (f1->subclass == 'u'))
- f1->frametype = AST_FRAME_DTMF_BEGIN;
if (f1->frametype == AST_FRAME_DTMF_END)
ast_log(LOG_NOTICE,"Got DTMF char %c\n",f1->subclass);
return f1;