summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioHwDevice.cpp
diff options
context:
space:
mode:
authorPhil Burk <philburk@google.com>2015-04-06 16:22:23 -0700
committerPhil Burk <philburk@google.com>2015-04-09 16:18:34 -0700
commit23d8997f58bb9c59fa3a1b9a6b2edbf1b2b0f4c6 (patch)
treeeed231c9bd5dc2523b7a0cf7c8b142810079dabc /services/audioflinger/AudioHwDevice.cpp
parent31ffe45a22b72ee5d25bb4932d0525e90dbc19fe (diff)
downloadframeworks_av-23d8997f58bb9c59fa3a1b9a6b2edbf1b2b0f4c6.zip
frameworks_av-23d8997f58bb9c59fa3a1b9a6b2edbf1b2b0f4c6.tar.gz
frameworks_av-23d8997f58bb9c59fa3a1b9a6b2edbf1b2b0f4c6.tar.bz2
AudioFlinger: more DTS passthrough support
Pass format for AC3 or DTS to SPDIF encoder. Bug: 18292317 Change-Id: I6d80eb548cb431bac3390ebb3235146171344291 Signed-off-by: Phil Burk <philburk@google.com>
Diffstat (limited to 'services/audioflinger/AudioHwDevice.cpp')
-rw-r--r--services/audioflinger/AudioHwDevice.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/services/audioflinger/AudioHwDevice.cpp b/services/audioflinger/AudioHwDevice.cpp
index 09d86ea..3191598 100644
--- a/services/audioflinger/AudioHwDevice.cpp
+++ b/services/audioflinger/AudioHwDevice.cpp
@@ -44,7 +44,7 @@ status_t AudioHwDevice::openOutputStream(
AudioStreamOut *outputStream = new AudioStreamOut(this, flags);
// Try to open the HAL first using the current format.
- ALOGV("AudioHwDevice::openOutputStream(), try "
+ ALOGV("openOutputStream(), try "
" sampleRate %d, Format %#x, "
"channelMask %#x",
config->sample_rate,
@@ -59,7 +59,7 @@ status_t AudioHwDevice::openOutputStream(
// FIXME Look at any modification to the config.
// The HAL might modify the config to suggest a wrapped format.
// Log this so we can see what the HALs are doing.
- ALOGI("AudioHwDevice::openOutputStream(), HAL returned"
+ ALOGI("openOutputStream(), HAL returned"
" sampleRate %d, Format %#x, "
"channelMask %#x, status %d",
config->sample_rate,
@@ -72,16 +72,19 @@ status_t AudioHwDevice::openOutputStream(
&& ((flags & AUDIO_OUTPUT_FLAG_DIRECT) != 0)
&& ((flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) == 0);
- // FIXME - Add isEncodingSupported() query to SPDIF wrapper then
- // call it from here.
if (wrapperNeeded) {
- outputStream = new SpdifStreamOut(this, flags);
- status = outputStream->open(handle, devices, &originalConfig, address);
- if (status != NO_ERROR) {
- ALOGE("ERROR - AudioHwDevice::openOutputStream(), SPDIF open returned %d",
- status);
- delete outputStream;
- outputStream = NULL;
+ if (SPDIFEncoder::isFormatSupported(originalConfig.format)) {
+ outputStream = new SpdifStreamOut(this, flags, originalConfig.format);
+ status = outputStream->open(handle, devices, &originalConfig, address);
+ if (status != NO_ERROR) {
+ ALOGE("ERROR - openOutputStream(), SPDIF open returned %d",
+ status);
+ delete outputStream;
+ outputStream = NULL;
+ }
+ } else {
+ ALOGE("ERROR - openOutputStream(), SPDIFEncoder does not support format 0x%08x",
+ originalConfig.format);
}
}
}