summaryrefslogtreecommitdiffstats
path: root/hal
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2014-07-03 16:41:51 -0700
committerEric Laurent <elaurent@google.com>2014-07-03 16:41:51 -0700
commitfdf296a35ba3deb8490522c834037e5e977b05cf (patch)
treedfff74b149e4056e45f9f0b7cb3af2a3c1dea938 /hal
parent0de8d1f80ff3cf452e9eb867f780b22bf8c54115 (diff)
downloadandroid_hardware_qcom_audio-fdf296a35ba3deb8490522c834037e5e977b05cf.tar.gz
android_hardware_qcom_audio-fdf296a35ba3deb8490522c834037e5e977b05cf.tar.bz2
android_hardware_qcom_audio-fdf296a35ba3deb8490522c834037e5e977b05cf.zip
audio: deprecate audio_stream_frame_size()
Bug: 15000850. Change-Id: I1bbe614c241befa24513a2b583594680e32fd954
Diffstat (limited to 'hal')
-rw-r--r--hal/audio_hw.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 46af57ff..c6de061e 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -1074,7 +1074,8 @@ static size_t out_get_buffer_size(const struct audio_stream *stream)
return out->compr_config.fragment_size;
}
- return out->config.period_size * audio_stream_frame_size(stream);
+ return out->config.period_size *
+ audio_stream_out_frame_size((const struct audio_stream_out *)stream);
}
static uint32_t out_get_channels(const struct audio_stream *stream)
@@ -1401,7 +1402,7 @@ exit:
if (out->pcm)
ALOGE("%s: error %d - %s", __func__, ret, pcm_get_error(out->pcm));
out_standby(&out->stream.common);
- usleep(bytes * 1000000 / audio_stream_frame_size(&out->stream.common) /
+ usleep(bytes * 1000000 / audio_stream_out_frame_size(stream) /
out_get_sample_rate(&out->stream.common));
}
return bytes;
@@ -1581,7 +1582,8 @@ static size_t in_get_buffer_size(const struct audio_stream *stream)
{
struct stream_in *in = (struct stream_in *)stream;
- return in->config.period_size * audio_stream_frame_size(stream);
+ return in->config.period_size *
+ audio_stream_in_frame_size((const struct audio_stream_in *)stream);
}
static uint32_t in_get_channels(const struct audio_stream *stream)
@@ -1719,7 +1721,7 @@ exit:
if (ret != 0) {
in_standby(&in->stream.common);
ALOGV("%s: read failed - sleeping for buffer duration", __func__);
- usleep(bytes * 1000000 / audio_stream_frame_size(&in->stream.common) /
+ usleep(bytes * 1000000 / audio_stream_in_frame_size(stream) /
in_get_sample_rate(&in->stream.common));
}
return bytes;
@@ -2217,7 +2219,7 @@ static int adev_open_input_stream(struct audio_hw_device *dev,
in->config.channels = channel_count;
in->config.rate = config->sample_rate;
- frame_size = audio_stream_frame_size((struct audio_stream *)in);
+ frame_size = audio_stream_in_frame_size(&in->stream);
buffer_size = get_input_buffer_size(config->sample_rate,
config->format,
channel_count);