aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZiyan <jaraidaniel@gmail.com>2015-08-22 12:34:15 +0200
committerAndreas Blaesius <skate4life@gmx.de>2015-08-29 01:54:24 -0700
commitb58e3bdb1f9581163745d25ba74e4df3cd25e71e (patch)
tree62e9043b9f0fc4b4be6da61ece9646cb05a5561a
parentbc343b41338403794b0fff784ec29f3bed1c9c6e (diff)
downloaddevice_samsung_espressowifi-b58e3bdb1f9581163745d25ba74e4df3cd25e71e.zip
device_samsung_espressowifi-b58e3bdb1f9581163745d25ba74e4df3cd25e71e.tar.gz
device_samsung_espressowifi-b58e3bdb1f9581163745d25ba74e4df3cd25e71e.tar.bz2
espress-common: audio: deprecate audio_stream_frame_size()
Change-Id: I4f8a62803cca98c96ecac7698cc4e876db7bd596
-rw-r--r--audio/audio_hw.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index 240e2f6..c80da45 100644
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -791,7 +791,7 @@ static int start_output_stream_low_latency(struct espresso_stream_out *out)
if (success) {
out->buffer_frames = pcm_config_tones.period_size * 2;
if (out->buffer == NULL)
- out->buffer = malloc(out->buffer_frames * audio_stream_frame_size(&out->stream.common));
+ out->buffer = malloc(out->buffer_frames * audio_stream_out_frame_size(&out->stream));
if (adev->echo_reference != NULL)
out->echo_reference = adev->echo_reference;
@@ -991,7 +991,7 @@ static size_t out_get_buffer_size_low_latency(const struct audio_stream *stream)
from pcm_config_tones.rate. */
size_t size = (SHORT_PERIOD_SIZE * DEFAULT_OUT_SAMPLING_RATE) / pcm_config_tones.rate;
size = ((size + 15) / 16) * 16;
- return size * audio_stream_frame_size((struct audio_stream *)stream);
+ return size * audio_stream_out_frame_size((const struct audio_stream_out *)stream);
}
static size_t out_get_buffer_size_deep_buffer(const struct audio_stream *stream)
@@ -1005,7 +1005,7 @@ static size_t out_get_buffer_size_deep_buffer(const struct audio_stream *stream)
size_t size = (DEEP_BUFFER_SHORT_PERIOD_SIZE * DEFAULT_OUT_SAMPLING_RATE) /
pcm_config_mm.rate;
size = ((size + 15) / 16) * 16;
- return size * audio_stream_frame_size((struct audio_stream *)stream);
+ return size * audio_stream_out_frame_size((const struct audio_stream_out *)stream);
}
static audio_channel_mask_t out_get_channels(const struct audio_stream *stream)
@@ -1229,7 +1229,7 @@ static ssize_t out_write_low_latency(struct audio_stream_out *stream, const void
int ret;
struct espresso_stream_out *out = (struct espresso_stream_out *)stream;
struct espresso_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);
size_t in_frames = bytes / frame_size;
size_t out_frames = in_frames;
bool force_input_standby = false;
@@ -1297,7 +1297,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) /
out_get_sample_rate(&stream->common));
}
@@ -1321,7 +1321,7 @@ static ssize_t out_write_deep_buffer(struct audio_stream_out *stream, const void
int ret;
struct espresso_stream_out *out = (struct espresso_stream_out *)stream;
struct espresso_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);
size_t in_frames = bytes / frame_size;
size_t out_frames;
bool use_long_periods;
@@ -1400,7 +1400,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) /
out_get_sample_rate(&stream->common));
}
@@ -2012,7 +2012,7 @@ static ssize_t in_read(struct audio_stream_in *stream, void* buffer,
int ret = 0;
struct espresso_stream_in *in = (struct espresso_stream_in *)stream;
struct espresso_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 priority thread is waiting
* on the input stream mutex - e.g. executing select_mode() while holding the hw device
@@ -2045,7 +2045,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);