diff --git a/gst/dtmf/gstdtmfdetect.c b/gst/dtmf/gstdtmfdetect.c index 5bc98af17a..0370285349 100644 --- a/gst/dtmf/gstdtmfdetect.c +++ b/gst/dtmf/gstdtmfdetect.c @@ -161,17 +161,16 @@ gst_dtmf_detect_transform_ip (GstBaseTransform * trans, GstBuffer * buf) gint dtmf_count; gchar dtmfbuf[MAX_DTMF_DIGITS] = ""; gint i; - gpointer data; - gsize size; + GstMapInfo map; if (GST_BUFFER_IS_DISCONT (buf)) zap_dtmf_detect_init (&self->dtmf_state); if (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_GAP)) return GST_FLOW_OK; - data = gst_buffer_map (buf, &size, NULL, GST_MAP_READ); + gst_buffer_map (buf, &map, GST_MAP_READ); - zap_dtmf_detect (&self->dtmf_state, (gint16 *) data, size / 2, FALSE); + zap_dtmf_detect (&self->dtmf_state, (gint16 *) map.data, map.size / 2, FALSE); dtmf_count = zap_dtmf_get (&self->dtmf_state, dtmfbuf, MAX_DTMF_DIGITS); @@ -180,7 +179,7 @@ gst_dtmf_detect_transform_ip (GstBaseTransform * trans, GstBuffer * buf) else GST_LOG_OBJECT (self, "Got no DTMF events"); - gst_buffer_unmap (buf, data, size); + gst_buffer_unmap (buf, &map); for (i = 0; i < dtmf_count; i++) { GstMessage *dtmf_message = NULL; diff --git a/gst/dtmf/gstdtmfsrc.c b/gst/dtmf/gstdtmfsrc.c index 80583fbc8f..d59fa1c9b8 100644 --- a/gst/dtmf/gstdtmfsrc.c +++ b/gst/dtmf/gstdtmfsrc.c @@ -541,6 +541,7 @@ gst_dtmf_src_generate_tone (GstDTMFSrcEvent * event, DTMF_KEY key, float duration, gint sample_rate) { GstBuffer *buffer; + GstMapInfo map; gint16 *p; gint tone_size; double i = 0; @@ -552,7 +553,8 @@ gst_dtmf_src_generate_tone (GstDTMFSrcEvent * event, DTMF_KEY key, buffer = gst_buffer_new_allocate (NULL, tone_size, 1); - p = (gint16 *) gst_buffer_map (buffer, NULL, NULL, GST_MAP_READWRITE); + gst_buffer_map (buffer, &map, GST_MAP_READWRITE); + p = (gint16 *) map.data; volume_factor = pow (10, (-event->volume) / 20); @@ -581,7 +583,7 @@ gst_dtmf_src_generate_tone (GstDTMFSrcEvent * event, DTMF_KEY key, (event->sample)++; } - gst_buffer_unmap (buffer, p, tone_size); + gst_buffer_unmap (buffer, &map); return buffer; } diff --git a/gst/dtmf/gstrtpdtmfdepay.c b/gst/dtmf/gstrtpdtmfdepay.c index 9d470f5f9d..01a1698f20 100644 --- a/gst/dtmf/gstrtpdtmfdepay.c +++ b/gst/dtmf/gstrtpdtmfdepay.c @@ -333,6 +333,7 @@ gst_dtmf_src_generate_tone (GstRtpDTMFDepay * rtpdtmfdepay, GstRTPDTMFPayload payload) { GstBuffer *buf; + GstMapInfo map; gint16 *p; gint tone_size; double i = 0; @@ -351,7 +352,8 @@ gst_dtmf_src_generate_tone (GstRtpDTMFDepay * rtpdtmfdepay, GST_BUFFER_DURATION (buf) = payload.duration * GST_SECOND / clock_rate; volume = payload.volume; - p = (gint16 *) gst_buffer_map (buf, NULL, NULL, GST_MAP_WRITE); + gst_buffer_map (buf, &map, GST_MAP_WRITE); + p = (gint16 *) map.data; volume_factor = pow (10, (-volume) / 20); @@ -382,7 +384,7 @@ gst_dtmf_src_generate_tone (GstRtpDTMFDepay * rtpdtmfdepay, (rtpdtmfdepay->sample)++; } - gst_buffer_unmap (buf, p, tone_size); + gst_buffer_unmap (buf, &map); return buf; }