diff options
author | Glenn Kasten <gkasten@google.com> | 2012-09-25 17:26:25 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-09-25 17:26:25 -0700 |
commit | a4b3b7df111099ae6ce4996c6ff8ea586614e0b4 (patch) | |
tree | ae5d43d38087958ffaaf4ff5b93b5e471bb609a7 /services/audioflinger | |
parent | 2ee6b28f0efb533e372b68aa3a224da336648902 (diff) | |
parent | 512ba3150d45803ebadbefe45977a5eeed323540 (diff) | |
download | frameworks_av-a4b3b7df111099ae6ce4996c6ff8ea586614e0b4.zip frameworks_av-a4b3b7df111099ae6ce4996c6ff8ea586614e0b4.tar.gz frameworks_av-a4b3b7df111099ae6ce4996c6ff8ea586614e0b4.tar.bz2 |
am 512ba315: am cc0f1cfb: Implement android.media.AudioManager.getProperty()
* commit '512ba3150d45803ebadbefe45977a5eeed323540':
Implement android.media.AudioManager.getProperty()
Diffstat (limited to 'services/audioflinger')
-rw-r--r-- | services/audioflinger/AudioFlinger.cpp | 18 | ||||
-rw-r--r-- | services/audioflinger/AudioFlinger.h | 7 |
2 files changed, 24 insertions, 1 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp index dd491f5..599a9e2 100644 --- a/services/audioflinger/AudioFlinger.cpp +++ b/services/audioflinger/AudioFlinger.cpp @@ -6903,6 +6903,24 @@ audio_module_handle_t AudioFlinger::loadHwModule_l(const char *name) } +// ---------------------------------------------------------------------------- + +int32_t AudioFlinger::getPrimaryOutputSamplingRate() +{ + Mutex::Autolock _l(mLock); + PlaybackThread *thread = primaryPlaybackThread_l(); + return thread != NULL ? thread->sampleRate() : 0; +} + +int32_t AudioFlinger::getPrimaryOutputFrameCount() +{ + Mutex::Autolock _l(mLock); + PlaybackThread *thread = primaryPlaybackThread_l(); + return thread != NULL ? thread->frameCountHAL() : 0; +} + +// ---------------------------------------------------------------------------- + audio_io_handle_t AudioFlinger::openOutput(audio_module_handle_t module, audio_devices_t *pDevices, uint32_t *pSamplingRate, diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h index 8a020fa..45cee0b 100644 --- a/services/audioflinger/AudioFlinger.h +++ b/services/audioflinger/AudioFlinger.h @@ -207,6 +207,9 @@ public: virtual audio_module_handle_t loadHwModule(const char *name); + virtual int32_t getPrimaryOutputSamplingRate(); + virtual int32_t getPrimaryOutputFrameCount(); + virtual status_t onTransact( uint32_t code, const Parcel& data, @@ -555,8 +558,10 @@ private: audio_channel_mask_t channelMask() const { return mChannelMask; } audio_format_t format() const { return mFormat; } // Called by AudioFlinger::frameCount(audio_io_handle_t output) and effects, - // and returns the normal mix buffer's frame count. No API for HAL frame count. + // and returns the normal mix buffer's frame count. size_t frameCount() const { return mNormalFrameCount; } + // Return's the HAL's frame count i.e. fast mixer buffer size. + size_t frameCountHAL() const { return mFrameCount; } // Should be "virtual status_t requestExitAndWait()" and override same // method in Thread, but Thread::requestExitAndWait() is not yet virtual. |