summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Coucheron <arco68@gmail.com>2014-10-25 06:34:08 +0200
committerLorDClockaN <davor@losinj.com>2014-11-02 15:54:35 +0100
commit5d241e848c36e787cab757608ad919cea41e0e50 (patch)
tree490a8e7887e0d2851a705832db540934d50d1873
parente11eaf2c557d72caf3aeda888d3cacf6cae1dc56 (diff)
av: Various fixes and cleanupskitkat
Change-Id: I82225d8cd3e2b3015e6c0e1dd9ddc5ec8abab525
-rw-r--r--media/libmedia/AudioRecord.cpp6
-rw-r--r--media/libmedia/AudioTrack.cpp2
-rw-r--r--services/audioflinger/AudioFlinger.cpp4
-rw-r--r--services/audioflinger/AudioPolicyService.cpp3
-rw-r--r--services/audioflinger/Threads.cpp6
5 files changed, 15 insertions, 6 deletions
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp
index ee40689d2e..c1ec876412 100644
--- a/media/libmedia/AudioRecord.cpp
+++ b/media/libmedia/AudioRecord.cpp
@@ -203,17 +203,21 @@ status_t AudioRecord::set(
ALOGE("Invalid format %d", format);
return BAD_VALUE;
}
-#ifdef QCOM_HARDWARE
+#if defined(QCOM_HARDWARE) && !defined(QCOM_DIRECTTRACK)
if (format != AUDIO_FORMAT_PCM_16_BIT &&
!audio_is_compress_voip_format(format) &&
!audio_is_compress_capture_format(format)) {
#else
+#ifndef QCOM_DIRECTTRACK
// Temporary restriction: AudioFlinger currently supports 16-bit PCM only
if (format != AUDIO_FORMAT_PCM_16_BIT) {
#endif
+#endif
+#ifndef QCOM_DIRECTTRACK
ALOGE("Format %d is not supported", format);
return BAD_VALUE;
}
+#endif
mFormat = format;
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp
index c94f8724c2..8b97020eae 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -410,6 +410,7 @@ status_t AudioTrack::set(
}
#endif
+#ifndef QCOM_DIRECTTRACK
if (audio_is_linear_pcm(format)) {
mFrameSize = channelCount * audio_bytes_per_sample(format);
mFrameSizeAF = channelCount * sizeof(int16_t);
@@ -417,6 +418,7 @@ status_t AudioTrack::set(
mFrameSize = sizeof(uint8_t);
mFrameSizeAF = sizeof(uint8_t);
}
+#endif
audio_io_handle_t output = AudioSystem::getOutput(
streamType,
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 1e7a8818b7..b8d8aab33f 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -1590,11 +1590,11 @@ sp<IAudioRecord> AudioFlinger::openRecord(
goto Exit;
}
#else
-#if defined(QCOM_HARDWARE)
+#ifdef QCOM_HARDWARE
if (format != AUDIO_FORMAT_PCM_16_BIT &&
!audio_is_compress_voip_format(format) &&
!audio_is_compress_capture_format(format)) {
-#else
+#else
if (format != AUDIO_FORMAT_PCM_16_BIT) {
#endif
ALOGE("openRecord() invalid format %d", format);
diff --git a/services/audioflinger/AudioPolicyService.cpp b/services/audioflinger/AudioPolicyService.cpp
index 32efa0affc..a23d031284 100644
--- a/services/audioflinger/AudioPolicyService.cpp
+++ b/services/audioflinger/AudioPolicyService.cpp
@@ -540,8 +540,9 @@ bool AudioPolicyService::isStreamActiveRemotely(audio_stream_type_t stream, uint
}
Mutex::Autolock _l(mLock);
return mpAudioPolicy->is_stream_active_remotely(mpAudioPolicy, stream, inPastMs);
-#endif
+#else
return 0;
+#endif
}
bool AudioPolicyService::isSourceActive(audio_source_t source) const
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index c92eeb257c..f93bd1dada 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -3853,7 +3853,7 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::DirectOutputThread::prep
tracksToRemove->add(track);
// indicate to client process that the track was disabled because of underrun;
// it will then automatically call start() when data is available
-#if defined(QCOM_HARDWARE) && !defined(QCOM_DIRECTTRACK)
+#ifdef QCOM_HARDWARE
android_atomic_or(CBLK_DISABLED, &cblk->mFlags);
#endif
} else if (last) {
@@ -5680,17 +5680,19 @@ void AudioFlinger::RecordThread::readInputParameters()
mChannelMask = mInput->stream->common.get_channels(&mInput->stream->common);
mChannelCount = (uint16_t)getInputChannelCount(mChannelMask);
mFormat = mInput->stream->common.get_format(&mInput->stream->common);
-#ifdef QCOM_HARDWARE
+#if defined(QCOM_HARDWARE) && !defined(QCOM_DIRECTTRACK)
if (mFormat != AUDIO_FORMAT_PCM_16_BIT &&
!audio_is_compress_voip_format(mFormat) &&
!audio_is_compress_capture_format(mFormat)) {
ALOGE("HAL format %d not supported", mFormat);
}
#else
+#ifndef QCOM_DIRECTTRACK
if (mFormat != AUDIO_FORMAT_PCM_16_BIT) {
ALOGE("HAL format %d not supported; must be AUDIO_FORMAT_PCM_16_BIT", mFormat);
}
#endif
+#endif
mFrameSize = audio_stream_frame_size(&mInput->stream->common);
mBufferSize = mInput->stream->common.get_buffer_size(&mInput->stream->common);
mFrameCount = mBufferSize / mFrameSize;