• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/libaudio


Commit MetaInfo

Revision96fdbee5d7753ced4fde9ba3a1915977ef2ea9c4 (tree)
Time2016-07-27 01:56:44
AuthorChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

audio_hw: deprecate audio_stream_frame_size()

Change Summary

Incremental Difference

--- a/audio_hw.c
+++ b/audio_hw.c
@@ -497,7 +497,7 @@ static ssize_t read_frames(struct stream_in *in, void *buffer, ssize_t frames)
497497 if (in->resampler != NULL) {
498498 in->resampler->resample_from_provider(in->resampler,
499499 (int16_t *)((char *)buffer +
500- frames_wr * audio_stream_frame_size(&in->stream.common)),
500+ frames_wr * audio_stream_in_frame_size(&in->stream)),
501501 &frames_rd);
502502 } else {
503503 struct resampler_buffer buf = {
@@ -507,9 +507,9 @@ static ssize_t read_frames(struct stream_in *in, void *buffer, ssize_t frames)
507507 get_next_buffer(&in->buf_provider, &buf);
508508 if (buf.raw != NULL) {
509509 memcpy((char *)buffer +
510- frames_wr * audio_stream_frame_size(&in->stream.common),
510+ frames_wr * audio_stream_in_frame_size(&in->stream),
511511 buf.raw,
512- buf.frame_count * audio_stream_frame_size(&in->stream.common));
512+ buf.frame_count * audio_stream_in_frame_size(&in->stream));
513513 frames_rd = buf.frame_count;
514514 }
515515 release_buffer(&in->buf_provider, &buf);
@@ -539,7 +539,7 @@ static int out_set_sample_rate(struct audio_stream *stream, uint32_t rate)
539539 static size_t out_get_buffer_size(const struct audio_stream *stream)
540540 {
541541 return pcm_config_out.period_size *
542- audio_stream_frame_size((struct audio_stream *)stream);
542+ audio_stream_out_frame_size((struct audio_stream_out *)stream);
543543 }
544544
545545 static uint32_t out_get_channels(const struct audio_stream *stream)
@@ -648,7 +648,7 @@ static ssize_t out_write(struct audio_stream_out *stream, const void* buffer,
648648 int ret = 0;
649649 struct stream_out *out = (struct stream_out *)stream;
650650 struct audio_device *adev = out->dev;
651- size_t frame_size = audio_stream_frame_size(&out->stream.common);
651+ size_t frame_size = audio_stream_out_frame_size(stream);
652652 int16_t *in_buffer = (int16_t *)buffer;
653653 size_t in_frames = bytes / frame_size;
654654 size_t out_frames;
@@ -791,7 +791,7 @@ exit:
791791
792792 if (ret != 0) {
793793 ALOGW("out_write error: %d, sleeping...", ret);
794- usleep(bytes * 1000000 / audio_stream_frame_size(&stream->common) /
794+ usleep(bytes * 1000000 / audio_stream_out_frame_size(stream) /
795795 out_get_sample_rate(&stream->common));
796796 }
797797
@@ -847,7 +847,7 @@ static size_t in_get_buffer_size(const struct audio_stream *stream)
847847 in->pcm_config->rate;
848848 size = ((size + 15) / 16) * 16;
849849
850- return size * audio_stream_frame_size((struct audio_stream *)stream);
850+ return size * audio_stream_in_frame_size(&in->stream);
851851 }
852852
853853 static uint32_t in_get_channels(const struct audio_stream *stream)
@@ -938,7 +938,7 @@ static ssize_t in_read(struct audio_stream_in *stream, void* buffer,
938938 int ret = 0;
939939 struct stream_in *in = (struct stream_in *)stream;
940940 struct audio_device *adev = in->dev;
941- size_t frames_rq = bytes / audio_stream_frame_size(&stream->common);
941+ size_t frames_rq = bytes / audio_stream_in_frame_size(stream);
942942
943943 /*
944944 * acquiring hw device mutex systematically is useful if a low
@@ -991,7 +991,7 @@ static ssize_t in_read(struct audio_stream_in *stream, void* buffer,
991991
992992 exit:
993993 if (ret < 0)
994- usleep(bytes * 1000000 / audio_stream_frame_size(&stream->common) /
994+ usleep(bytes * 1000000 / audio_stream_in_frame_size(stream) /
995995 in_get_sample_rate(&stream->common));
996996
997997 pthread_mutex_unlock(&in->lock);