diff options
| author | Eric Laurent <elaurent@google.com> | 2014-07-03 16:34:20 -0700 |
|---|---|---|
| committer | Eric Laurent <elaurent@google.com> | 2014-07-03 16:46:51 -0700 |
| commit | 77af430b4a03eff0be2ee46bfb994c80bed90c7a (patch) | |
| tree | babc783e5ce538b91dced71cdf275e35ef42a654 /audio | |
| parent | dc7d6ea315507886c9194811d537dc2418ad42bd (diff) | |
audio: deprecate audio_stream_frame_size()
Bug: 15000850.
Change-Id: I6eacaedc5e45457ba528c04c952ec352fa7b8c56
Diffstat (limited to 'audio')
| -rw-r--r-- | audio/audio_hw.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c index ffad231..8cea2ae 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -463,7 +463,7 @@ static ssize_t read_frames(struct stream_in *in, void *buffer, ssize_t frames) if (in->resampler != NULL) { in->resampler->resample_from_provider(in->resampler, (int16_t *)((char *)buffer + - frames_wr * audio_stream_frame_size(&in->stream.common)), + frames_wr * audio_stream_in_frame_size(&in->stream)), &frames_rd); } else { struct resampler_buffer buf = { @@ -473,9 +473,9 @@ static ssize_t read_frames(struct stream_in *in, void *buffer, ssize_t frames) get_next_buffer(&in->buf_provider, &buf); if (buf.raw != NULL) { memcpy((char *)buffer + - frames_wr * audio_stream_frame_size(&in->stream.common), + frames_wr * audio_stream_in_frame_size(&in->stream), buf.raw, - buf.frame_count * audio_stream_frame_size(&in->stream.common)); + buf.frame_count * audio_stream_in_frame_size(&in->stream)); frames_rd = buf.frame_count; } release_buffer(&in->buf_provider, &buf); @@ -505,7 +505,7 @@ static int out_set_sample_rate(struct audio_stream *stream, uint32_t rate) static size_t out_get_buffer_size(const struct audio_stream *stream) { return pcm_config_out.period_size * - audio_stream_frame_size((struct audio_stream *)stream); + audio_stream_out_frame_size((const struct audio_stream_out *)stream); } static uint32_t out_get_channels(const struct audio_stream *stream) @@ -614,7 +614,7 @@ static ssize_t out_write(struct audio_stream_out *stream, const void* buffer, int ret = 0; struct stream_out *out = (struct stream_out *)stream; struct audio_device *adev = out->dev; - size_t frame_size = audio_stream_frame_size(&out->stream.common); + size_t frame_size = audio_stream_out_frame_size(stream); int16_t *in_buffer = (int16_t *)buffer; size_t in_frames = bytes / frame_size; size_t out_frames; @@ -756,7 +756,7 @@ exit: pthread_mutex_unlock(&out->lock); if (ret != 0) { - usleep(bytes * 1000000 / audio_stream_frame_size(&stream->common) / + usleep(bytes * 1000000 / audio_stream_out_frame_size(&stream->common) / out_get_sample_rate(&stream->common)); } @@ -837,7 +837,7 @@ static size_t in_get_buffer_size(const struct audio_stream *stream) in->pcm_config->rate; size = ((size + 15) / 16) * 16; - return size * audio_stream_frame_size((struct audio_stream *)stream); + return size * audio_stream_in_frame_size(&in->stream); } static uint32_t in_get_channels(const struct audio_stream *stream) @@ -928,7 +928,7 @@ static ssize_t in_read(struct audio_stream_in *stream, void* buffer, int ret = 0; struct stream_in *in = (struct stream_in *)stream; struct audio_device *adev = in->dev; - size_t frames_rq = bytes / audio_stream_frame_size(&stream->common); + size_t frames_rq = bytes / audio_stream_in_frame_size(stream); /* * acquiring hw device mutex systematically is useful if a low @@ -981,7 +981,7 @@ static ssize_t in_read(struct audio_stream_in *stream, void* buffer, exit: if (ret < 0) - usleep(bytes * 1000000 / audio_stream_frame_size(&stream->common) / + usleep(bytes * 1000000 / audio_stream_in_frame_size(stream) / in_get_sample_rate(&stream->common)); pthread_mutex_unlock(&in->lock); |
