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/PatchPanel.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/PatchPanel.h')
-rw-r--r-- | services/audioflinger/PatchPanel.h | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/services/audioflinger/PatchPanel.h b/services/audioflinger/PatchPanel.h index 7f78621..e31179c 100644 --- a/services/audioflinger/PatchPanel.h +++ b/services/audioflinger/PatchPanel.h @@ -21,6 +21,9 @@ class PatchPanel : public RefBase { public: + + class Patch; + PatchPanel(const sp<AudioFlinger>& audioFlinger); virtual ~PatchPanel(); @@ -45,16 +48,31 @@ public: /* Set audio port configuration */ status_t setAudioPortConfig(const struct audio_port_config *config); + status_t createPatchConnections(Patch *patch, + const struct audio_patch *audioPatch); + void clearPatchConnections(Patch *patch); + class Patch { public: Patch(const struct audio_patch *patch) : - mAudioPatch(*patch), mHandle(0), mHalHandle(0) {} + mAudioPatch(*patch), mHandle(AUDIO_PATCH_HANDLE_NONE), + mHalHandle(AUDIO_PATCH_HANDLE_NONE), mRecordPatchHandle(AUDIO_PATCH_HANDLE_NONE), + mPlaybackPatchHandle(AUDIO_PATCH_HANDLE_NONE) {} + ~Patch() {} + + struct audio_patch mAudioPatch; + audio_patch_handle_t mHandle; + audio_patch_handle_t mHalHandle; + sp<PlaybackThread> mPlaybackThread; + sp<PlaybackThread::PatchTrack> mPatchTrack; + sp<RecordThread> mRecordThread; + sp<RecordThread::PatchRecord> mPatchRecord; + audio_patch_handle_t mRecordPatchHandle; + audio_patch_handle_t mPlaybackPatchHandle; - struct audio_patch mAudioPatch; - audio_patch_handle_t mHandle; - audio_patch_handle_t mHalHandle; }; + private: - const wp<AudioFlinger> mAudioFlinger; - SortedVector <Patch *> mPatches; + const wp<AudioFlinger> mAudioFlinger; + SortedVector <Patch *> mPatches; }; |