diff options
author | Eric Laurent <elaurent@google.com> | 2012-11-19 14:55:58 -0800 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2012-11-19 19:35:38 -0800 |
commit | 81784c37c61b09289654b979567a42bf73cd2b12 (patch) | |
tree | a0a3fa9225bea006c2e037a337b43bf4ba7c0743 /services/audioflinger/RecordTracks.h | |
parent | 4d9cef6c007afd195a8f36d35d46b359bf909331 (diff) | |
download | frameworks_av-81784c37c61b09289654b979567a42bf73cd2b12.zip frameworks_av-81784c37c61b09289654b979567a42bf73cd2b12.tar.gz frameworks_av-81784c37c61b09289654b979567a42bf73cd2b12.tar.bz2 |
AudioFlinger files reorganization
Audioflinger.cpp and Audioflinger.h files must be split to
improve readability and maintainability.
This CL splits the files as follows:
AudioFlinger.cpp split into:
- AudioFlinger.cpp: implementation of IAudioflinger interface and global methods
- AFThreads.cpp: implementation of ThreadBase, PlaybackThread, MixerThread,
DuplicatingThread, DirectOutputThread and RecordThread.
- AFTracks.cpp: implementation of TrackBase, Track, TimedTrack, OutputTrack,
RecordTrack, TrackHandle and RecordHandle.
- AFEffects.cpp: implementation of EffectModule, EffectChain and EffectHandle.
AudioFlinger.h is modified by inline inclusion of header files containing
the declaration of complex inner classes:
- AFThreads.h: ThreadBase, PlaybackThread, MixerThread, DuplicatingThread,
DirectOutputThread and RecordThread
- AFEffects.h: EffectModule, EffectChain and EffectHandle
AFThreads.h includes the follownig headers inline:
- AFTrackBase.h: TrackBase
- AFPlaybackTracks: Track, TimedTrack, OutputTrack
- AFRecordTracks: RecordTrack
Change-Id: I512ebc3a51813ab7a4afccc9a538b18125165c4c
Diffstat (limited to 'services/audioflinger/RecordTracks.h')
-rw-r--r-- | services/audioflinger/RecordTracks.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/services/audioflinger/RecordTracks.h b/services/audioflinger/RecordTracks.h new file mode 100644 index 0000000..fe681d7 --- /dev/null +++ b/services/audioflinger/RecordTracks.h @@ -0,0 +1,62 @@ +/* +** +** Copyright 2012, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +#ifndef INCLUDING_FROM_AUDIOFLINGER_H + #error This header file should only be included from AudioFlinger.h +#endif + +// record track +class RecordTrack : public TrackBase { +public: + RecordTrack(RecordThread *thread, + const sp<Client>& client, + uint32_t sampleRate, + audio_format_t format, + audio_channel_mask_t channelMask, + size_t frameCount, + int sessionId); + virtual ~RecordTrack(); + + virtual status_t start(AudioSystem::sync_event_t event, int triggerSession); + virtual void stop(); + + void destroy(); + + // clear the buffer overflow flag + void clearOverflow() { mOverflow = false; } + // set the buffer overflow flag and return previous value + bool setOverflow() { bool tmp = mOverflow; mOverflow = true; + return tmp; } + + static void appendDumpHeader(String8& result); + void dump(char* buffer, size_t size); + + virtual bool isOut() const; + +private: + friend class AudioFlinger; // for mState + + RecordTrack(const RecordTrack&); + RecordTrack& operator = (const RecordTrack&); + + // AudioBufferProvider interface + virtual status_t getNextBuffer(AudioBufferProvider::Buffer* buffer, + int64_t pts = kInvalidPTS); + // releaseBuffer() not overridden + + bool mOverflow; // overflow on most recent attempt to fill client buffer +}; |