diff options
author | David Schleef <ds@schleef.org> | 2010-12-30 18:20:47 -0800 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2010-12-30 18:39:21 -0800 |
commit | 57095d302d0daaf344aa6da261f638746cf62c1f (patch) | |
tree | 3c0a37bd1e82784c644f34afb9c144fe9a626876 | |
parent | 5fed7a264c4c796c8e8e7ecc4e2ae893ecae111d (diff) |
dtmf: build fixes for MSVC
Use gint16 and G_PI.
-rw-r--r-- | gst/dtmf/gstdtmfdetect.c | 2 | ||||
-rw-r--r-- | gst/dtmf/tone_detect.c | 12 | ||||
-rw-r--r-- | gst/dtmf/tone_detect.h | 6 |
3 files changed, 11 insertions, 9 deletions
diff --git a/gst/dtmf/gstdtmfdetect.c b/gst/dtmf/gstdtmfdetect.c index 6fa17b5e4..0bb924264 100644 --- a/gst/dtmf/gstdtmfdetect.c +++ b/gst/dtmf/gstdtmfdetect.c @@ -177,3 +177,3 @@ gst_dtmf_detect_transform_ip (GstBaseTransform * trans, GstBuffer * buf) - zap_dtmf_detect (&self->dtmf_state, (int16_t *) GST_BUFFER_DATA (buf), + zap_dtmf_detect (&self->dtmf_state, (gint16 *) GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf) / 2, FALSE); diff --git a/gst/dtmf/tone_detect.c b/gst/dtmf/tone_detect.c index d8f1df16e..8c1b5ad95 100644 --- a/gst/dtmf/tone_detect.c +++ b/gst/dtmf/tone_detect.c @@ -201,12 +201,12 @@ zap_dtmf_detect_init (dtmf_detect_state_t * s) for (i = 0; i < 4; i++) { - theta = 2.0 * M_PI * (dtmf_row[i] / SAMPLE_RATE); + theta = 2.0 * G_PI * (dtmf_row[i] / SAMPLE_RATE); dtmf_detect_row[i].fac = 2.0 * cos (theta); - theta = 2.0 * M_PI * (dtmf_col[i] / SAMPLE_RATE); + theta = 2.0 * G_PI * (dtmf_col[i] / SAMPLE_RATE); dtmf_detect_col[i].fac = 2.0 * cos (theta); - theta = 2.0 * M_PI * (dtmf_row[i] * 2.0 / SAMPLE_RATE); + theta = 2.0 * G_PI * (dtmf_row[i] * 2.0 / SAMPLE_RATE); dtmf_detect_row_2nd[i].fac = 2.0 * cos (theta); - theta = 2.0 * M_PI * (dtmf_col[i] * 2.0 / SAMPLE_RATE); + theta = 2.0 * G_PI * (dtmf_col[i] * 2.0 / SAMPLE_RATE); dtmf_detect_col_2nd[i].fac = 2.0 * cos (theta); @@ -222,3 +222,3 @@ zap_dtmf_detect_init (dtmf_detect_state_t * s) /* Same for the fax dector */ - theta = 2.0 * M_PI * (fax_freq / SAMPLE_RATE); + theta = 2.0 * G_PI * (fax_freq / SAMPLE_RATE); fax_detect.fac = 2.0 * cos (theta); @@ -227,3 +227,3 @@ zap_dtmf_detect_init (dtmf_detect_state_t * s) /* Same for the fax dector 2nd harmonic */ - theta = 2.0 * M_PI * (fax_freq * 2.0 / SAMPLE_RATE); + theta = 2.0 * G_PI * (fax_freq * 2.0 / SAMPLE_RATE); fax_detect_2nd.fac = 2.0 * cos (theta); diff --git a/gst/dtmf/tone_detect.h b/gst/dtmf/tone_detect.h index 909c5ef60..ce6dddd2c 100644 --- a/gst/dtmf/tone_detect.h +++ b/gst/dtmf/tone_detect.h @@ -37,2 +37,4 @@ +#include <glib.h> + typedef struct @@ -77,3 +79,3 @@ typedef struct void zap_goertzel_update(goertzel_state_t *s, - int16_t x[], + gint16 x[], int samples); @@ -83,3 +85,3 @@ void zap_dtmf_detect_init (dtmf_detect_state_t *s); int zap_dtmf_detect (dtmf_detect_state_t *s, - int16_t amp[], + gint16 amp[], int samples, |