blob: 6c0d1d38486c9ec9b01b4b70b02837e9bc0be73f [file] [log] [blame]
/*
**
** 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);
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
};