diff options
author | Eric Laurent <elaurent@google.com> | 2014-06-20 18:31:16 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2014-07-24 02:56:47 +0000 |
commit | 83b8808faad1e91690c64d7007348be8d9ebde73 (patch) | |
tree | b541b1172f804e04bd19b29f7878a1becf6205d7 /services/audioflinger/Threads.h | |
parent | c15c265676da2226a18a5373812608b19d4719d7 (diff) | |
download | frameworks_av-83b8808faad1e91690c64d7007348be8d9ebde73.zip frameworks_av-83b8808faad1e91690c64d7007348be8d9ebde73.tar.gz frameworks_av-83b8808faad1e91690c64d7007348be8d9ebde73.tar.bz2 |
audio flinger: add patch connection between hw modules
Add support for audio device connections between different audio
hw modules.
The patch is performed by creating a bridge between the playback
thread connected to the sink device and the record thread connected
to the source device using a pair of specialized PlaybackTrack and
RecordTrack.
- Added PatchTrack and PatchRecord classes.
- Added TrackBase type to indicate more clearly the track behavior.
- A TrackBase can allocate the buffer or reuse an existing one.
- Factored some code in openOutput() and openInput() for internal use
by PatchPanel.
Bug: 14815883.
Change-Id: Ib9515fcda864610458a4bc81fa8f59096ff4d7db
Diffstat (limited to 'services/audioflinger/Threads.h')
-rw-r--r-- | services/audioflinger/Threads.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/services/audioflinger/Threads.h b/services/audioflinger/Threads.h index 3b7257b..648502b 100644 --- a/services/audioflinger/Threads.h +++ b/services/audioflinger/Threads.h @@ -235,6 +235,7 @@ public: uint32_t sampleRate() const { return mSampleRate; } audio_channel_mask_t channelMask() const { return mChannelMask; } audio_format_t format() const { return mHALFormat; } + uint32_t channelCount() const { return mChannelCount; } // Called by AudioFlinger::frameCount(audio_io_handle_t output) and effects, // and returns the [normal mix] buffer's frame count. virtual size_t frameCount() const = 0; @@ -264,6 +265,7 @@ public: virtual status_t createAudioPatch_l(const struct audio_patch *patch, audio_patch_handle_t *handle) = 0; virtual status_t releaseAudioPatch_l(const audio_patch_handle_t handle) = 0; + virtual void getAudioPortConfig(struct audio_port_config *config) = 0; // see note at declaration of mStandby, mOutDevice and mInDevice @@ -589,7 +591,12 @@ public: // Return's the HAL's frame count i.e. fast mixer buffer size. size_t frameCountHAL() const { return mFrameCount; } - status_t getTimestamp_l(AudioTimestamp& timestamp); + status_t getTimestamp_l(AudioTimestamp& timestamp); + + void addPatchTrack(const sp<PatchTrack>& track); + void deletePatchTrack(const sp<PatchTrack>& track); + + virtual void getAudioPortConfig(struct audio_port_config *config); protected: // updated by readOutputParameters_l() @@ -876,6 +883,7 @@ public: ALOG_ASSERT(fastIndex < FastMixerState::kMaxFastTracks); return mFastMixerDumpState.mTracks[fastIndex].mUnderruns; } + }; class DirectOutputThread : public PlaybackThread { @@ -1103,6 +1111,10 @@ public: virtual status_t createAudioPatch_l(const struct audio_patch *patch, audio_patch_handle_t *handle); virtual status_t releaseAudioPatch_l(const audio_patch_handle_t handle); + + void addPatchRecord(const sp<PatchRecord>& record); + void deletePatchRecord(const sp<PatchRecord>& record); + void readInputParameters_l(); virtual uint32_t getInputFramesLost(); @@ -1122,6 +1134,7 @@ public: virtual size_t frameCount() const { return mFrameCount; } bool hasFastCapture() const { return mFastCapture != 0; } + virtual void getAudioPortConfig(struct audio_port_config *config); private: // Enter standby if not already in standby, and set mStandby flag |