summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2014-03-07 15:32:44 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-03-07 15:32:45 +0000
commite1b004e153a8a99c1b59e86bd3b9c1ae1dd48c39 (patch)
tree9f58fa278cb4df0c4e106f04a5efda6e1f8685be /media
parent24fa6a567d02e0901b4bce4d934ccab4f70e41a0 (diff)
parent43d9b8706b3916ee0f1d745a2832f792c3406ca8 (diff)
downloadframeworks_av-e1b004e153a8a99c1b59e86bd3b9c1ae1dd48c39.zip
frameworks_av-e1b004e153a8a99c1b59e86bd3b9c1ae1dd48c39.tar.gz
frameworks_av-e1b004e153a8a99c1b59e86bd3b9c1ae1dd48c39.tar.bz2
Merge "Remove restriction for HAL streams of AUDIO_FORMAT_PCM_16_BIT"
Diffstat (limited to 'media')
-rw-r--r--media/libnbaio/AudioStreamInSource.cpp12
-rw-r--r--media/libnbaio/AudioStreamOutSink.cpp12
2 files changed, 10 insertions, 14 deletions
diff --git a/media/libnbaio/AudioStreamInSource.cpp b/media/libnbaio/AudioStreamInSource.cpp
index efbc1a7..cee90dd 100644
--- a/media/libnbaio/AudioStreamInSource.cpp
+++ b/media/libnbaio/AudioStreamInSource.cpp
@@ -43,13 +43,11 @@ ssize_t AudioStreamInSource::negotiate(const NBAIO_Format offers[], size_t numOf
if (!Format_isValid(mFormat)) {
mStreamBufferSizeBytes = mStream->common.get_buffer_size(&mStream->common);
audio_format_t streamFormat = mStream->common.get_format(&mStream->common);
- if (streamFormat == AUDIO_FORMAT_PCM_16_BIT) {
- uint32_t sampleRate = mStream->common.get_sample_rate(&mStream->common);
- audio_channel_mask_t channelMask =
- (audio_channel_mask_t) mStream->common.get_channels(&mStream->common);
- mFormat = Format_from_SR_C(sampleRate, popcount(channelMask));
- mFrameSize = Format_frameSize(mFormat);
- }
+ uint32_t sampleRate = mStream->common.get_sample_rate(&mStream->common);
+ audio_channel_mask_t channelMask =
+ (audio_channel_mask_t) mStream->common.get_channels(&mStream->common);
+ mFormat = Format_from_SR_C(sampleRate, popcount(channelMask));
+ mFrameSize = Format_frameSize(mFormat);
}
return NBAIO_Source::negotiate(offers, numOffers, counterOffers, numCounterOffers);
}
diff --git a/media/libnbaio/AudioStreamOutSink.cpp b/media/libnbaio/AudioStreamOutSink.cpp
index f7f764e..bff06f3 100644
--- a/media/libnbaio/AudioStreamOutSink.cpp
+++ b/media/libnbaio/AudioStreamOutSink.cpp
@@ -40,13 +40,11 @@ ssize_t AudioStreamOutSink::negotiate(const NBAIO_Format offers[], size_t numOff
if (!Format_isValid(mFormat)) {
mStreamBufferSizeBytes = mStream->common.get_buffer_size(&mStream->common);
audio_format_t streamFormat = mStream->common.get_format(&mStream->common);
- if (streamFormat == AUDIO_FORMAT_PCM_16_BIT) {
- uint32_t sampleRate = mStream->common.get_sample_rate(&mStream->common);
- audio_channel_mask_t channelMask =
- (audio_channel_mask_t) mStream->common.get_channels(&mStream->common);
- mFormat = Format_from_SR_C(sampleRate, popcount(channelMask));
- mFrameSize = Format_frameSize(mFormat);
- }
+ uint32_t sampleRate = mStream->common.get_sample_rate(&mStream->common);
+ audio_channel_mask_t channelMask =
+ (audio_channel_mask_t) mStream->common.get_channels(&mStream->common);
+ mFormat = Format_from_SR_C(sampleRate, popcount(channelMask));
+ mFrameSize = Format_frameSize(mFormat);
}
return NBAIO_Sink::negotiate(offers, numOffers, counterOffers, numCounterOffers);
}