summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/RecordTracks.h
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2014-06-20 18:31:16 -0700
committerEric Laurent <elaurent@google.com>2014-07-24 02:56:47 +0000
commit83b8808faad1e91690c64d7007348be8d9ebde73 (patch)
treeb541b1172f804e04bd19b29f7878a1becf6205d7 /services/audioflinger/RecordTracks.h
parentc15c265676da2226a18a5373812608b19d4719d7 (diff)
downloadframeworks_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/RecordTracks.h')
-rw-r--r--services/audioflinger/RecordTracks.h35
1 files changed, 34 insertions, 1 deletions
diff --git a/services/audioflinger/RecordTracks.h b/services/audioflinger/RecordTracks.h
index fe15571..204a9d6 100644
--- a/services/audioflinger/RecordTracks.h
+++ b/services/audioflinger/RecordTracks.h
@@ -28,9 +28,11 @@ public:
audio_format_t format,
audio_channel_mask_t channelMask,
size_t frameCount,
+ void *buffer,
int sessionId,
int uid,
- IAudioFlinger::track_flags_t flags);
+ IAudioFlinger::track_flags_t flags,
+ track_type type);
virtual ~RecordTrack();
virtual status_t start(AudioSystem::sync_event_t event, int triggerSession);
@@ -93,3 +95,34 @@ private:
// used by resampler to find source frames
ResamplerBufferProvider *mResamplerBufferProvider;
};
+
+// playback track, used by PatchPanel
+class PatchRecord : virtual public RecordTrack, public PatchProxyBufferProvider {
+public:
+
+ PatchRecord(RecordThread *recordThread,
+ uint32_t sampleRate,
+ audio_channel_mask_t channelMask,
+ audio_format_t format,
+ size_t frameCount,
+ void *buffer,
+ IAudioFlinger::track_flags_t flags);
+ virtual ~PatchRecord();
+
+ // AudioBufferProvider interface
+ virtual status_t getNextBuffer(AudioBufferProvider::Buffer* buffer,
+ int64_t pts);
+ virtual void releaseBuffer(AudioBufferProvider::Buffer* buffer);
+
+ // PatchProxyBufferProvider interface
+ virtual status_t obtainBuffer(Proxy::Buffer *buffer,
+ const struct timespec *timeOut = NULL);
+ virtual void releaseBuffer(Proxy::Buffer *buffer);
+
+ void setPeerProxy(PatchProxyBufferProvider *proxy) { mPeerProxy = proxy; }
+
+private:
+ sp<ClientProxy> mProxy;
+ PatchProxyBufferProvider* mPeerProxy;
+ struct timespec mPeerTimeout;
+}; // end of PatchRecord