diff options
author | Kalyani polepeddy <kpolep@codeaurora.org> | 2012-12-29 17:48:55 +0530 |
---|---|---|
committer | Arne Coucheron <arco68@gmail.com> | 2013-01-21 21:28:24 +0100 |
commit | 391bf29ad1177d973cb6a9daea13677373204176 (patch) | |
tree | 1da6f0281ac8a70edb66236b6d2b1c539fb45209 /services | |
parent | 8001424a87f9b7e2dd2482b9ff257b9bff3a4d8b (diff) | |
download | frameworks_av-391bf29ad1177d973cb6a9daea13677373204176.zip frameworks_av-391bf29ad1177d973cb6a9daea13677373204176.tar.gz frameworks_av-391bf29ad1177d973cb6a9daea13677373204176.tar.bz2 |
frameworks/av : Playing AAC and MP3 clips using LPA.
-AAC and MP3 clips are not playing.
-AAC and MP3 are not using LPA path.
-Enable LPA decoder path and implement LPAPlayer class.
Change-Id: I76438319fc72c4898fad5910f8de874f89287687
Diffstat (limited to 'services')
-rw-r--r-- | services/audioflinger/AudioFlinger.cpp | 38 | ||||
-rw-r--r-- | services/audioflinger/AudioFlinger.h | 1 |
2 files changed, 38 insertions, 1 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp index bf94efe..724b1e3 100644 --- a/services/audioflinger/AudioFlinger.cpp +++ b/services/audioflinger/AudioFlinger.cpp @@ -255,6 +255,9 @@ AudioFlinger::AudioFlinger() void AudioFlinger::onFirstRef() { int rc = 0; +#ifdef QCOM_HARDWARE + mA2DPHandle = -1; +#endif Mutex::Autolock _l(mLock); @@ -866,6 +869,9 @@ status_t AudioFlinger::setMasterVolume(float value) return PERMISSION_DENIED; } +#ifdef QCOM_HARDWARE + mA2DPHandle = -1; +#endif Mutex::Autolock _l(mLock); mMasterVolume = value; @@ -1351,7 +1357,7 @@ void AudioFlinger::registerClient(const sp<IAudioFlingerClient>& client) sp<NotificationClient> notificationClient = new NotificationClient(this, client, binder); - ALOGV("registerClient() client %p, binder %d", notificationClient.get(), binder.get); + ALOGV("registerClient() client %p, binder %d", notificationClient.get(), binder.get()); mNotificationClients.add(binder, notificationClient); @@ -1368,6 +1374,13 @@ void AudioFlinger::registerClient(const sp<IAudioFlingerClient>& client) mRecordThreads.valueAt(i)->sendIoConfigEvent(AudioSystem::INPUT_OPENED); } } +#ifdef QCOM_HARDWARE + // Send the notification to the client only once. + if (mA2DPHandle != -1) { + ALOGV("A2DP active. Notifying the registered client"); + client->ioConfigChanged(AudioSystem::A2DP_OUTPUT_STATE, mA2DPHandle, &mA2DPHandle); + } +#endif } #ifdef QCOM_HARDWARE @@ -7675,6 +7688,15 @@ audio_io_handle_t AudioFlinger::openOutput(audio_module_handle_t module, #endif mPlaybackThreads.add(id, thread); +#ifdef QCOM_HARDWARE + // if the device is a A2DP, then this is an A2DP Output + if ( true == audio_is_a2dp_device((audio_devices_t) *pDevices) ) + { + mA2DPHandle = id; + ALOGV("A2DP device activated. The handle is set to %d", mA2DPHandle); + } +#endif + if (pSamplingRate != NULL) *pSamplingRate = config.sample_rate; if (pFormat != NULL) *pFormat = config.format; if (pChannelMask != NULL) *pChannelMask = config.channel_mask; @@ -7775,6 +7797,14 @@ status_t AudioFlinger::closeOutput_nonvirtual(audio_io_handle_t output) } audioConfigChanged_l(AudioSystem::OUTPUT_CLOSED, output, NULL); mPlaybackThreads.removeItem(output); +#ifdef QCOM_HARDWARE + if (mA2DPHandle == output) + { + mA2DPHandle = -1; + ALOGV("A2DP OutputClosed Notifying Client"); + audioConfigChanged_l(AudioSystem::A2DP_OUTPUT_STATE, mA2DPHandle, &mA2DPHandle); + } +#endif } thread->exit(); // The thread entity (active unit of execution) is no longer running here, @@ -7960,6 +7990,12 @@ status_t AudioFlinger::setStreamOutput(audio_stream_type_t stream, audio_io_hand PlaybackThread *thread = mPlaybackThreads.valueAt(i).get(); thread->invalidateTracks(stream); } +#ifdef QCOM_HARDWARE + if ( mA2DPHandle == output ) { + ALOGV("A2DP Activated and hence notifying the client"); + audioConfigChanged_l(AudioSystem::A2DP_OUTPUT_STATE, mA2DPHandle, &output); + } +#endif return NO_ERROR; } diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h index d2daae7..dcdc55c 100644 --- a/services/audioflinger/AudioFlinger.h +++ b/services/audioflinger/AudioFlinger.h @@ -2234,6 +2234,7 @@ mutable Mutex mLock; // mutex for process, commands and handl bool mBtNrecIsOff; #ifdef QCOM_HARDWARE DefaultKeyedVector<audio_io_handle_t, AudioSessionDescriptor *> mDirectAudioTracks; + int mA2DPHandle; // Handle to notify A2DP connection status #endif // protected by mLock #ifdef QCOM_HARDWARE |