Code drop from //branches/cupcake/...@124589
diff --git a/libs/audioflinger/AudioDumpInterface.h b/libs/audioflinger/AudioDumpInterface.h
index 732b97d..a65e56a 100644
--- a/libs/audioflinger/AudioDumpInterface.h
+++ b/libs/audioflinger/AudioDumpInterface.h
@@ -2,16 +2,16 @@
**
** Copyright 2008, 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
+** 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
+** 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
+** 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.
*/
@@ -21,33 +21,35 @@
#include <stdint.h>
#include <sys/types.h>
-#include <hardware/AudioHardwareInterface.h>
+#include <hardware/AudioHardwareBase.h>
namespace android {
-#define FLINGER_DUMP_NAME "/tmp/FlingerOut.pcm" // name of file used for dump
+#define FLINGER_DUMP_NAME "/data/FlingerOut.pcm" // name of file used for dump
class AudioStreamOutDump : public AudioStreamOut {
public:
AudioStreamOutDump( AudioStreamOut* FinalStream);
+ ~AudioStreamOutDump();
virtual ssize_t write(const void* buffer, size_t bytes);
-
+
virtual uint32_t sampleRate() const { return mFinalStream->sampleRate(); }
virtual size_t bufferSize() const { return mFinalStream->bufferSize(); }
virtual int channelCount() const { return mFinalStream->channelCount(); }
virtual int format() const { return mFinalStream->format(); }
+ virtual uint32_t latency() const { return mFinalStream->latency(); }
virtual status_t setVolume(float volume)
{ return mFinalStream->setVolume(volume); }
virtual status_t dump(int fd, const Vector<String16>& args) { return mFinalStream->dump(fd, args); }
void Close(void);
private:
- AudioStreamOut *mFinalStream;
- FILE *mOutFile; // output file
+ AudioStreamOut *mFinalStream;
+ FILE *mOutFile; // output file
};
-class AudioDumpInterface : public AudioHardwareInterface
+class AudioDumpInterface : public AudioHardwareBase
{
public:
@@ -56,10 +58,10 @@
virtual AudioStreamOut* openOutputStream(
int format=0,
int channelCount=0,
- uint32_t sampleRate=0);
+ uint32_t sampleRate=0,
+ status_t *status=0);
+ virtual ~AudioDumpInterface();
- virtual ~AudioDumpInterface()
- {delete mFinalInterface;}
virtual status_t initCheck()
{return mFinalInterface->initCheck();}
virtual status_t setVoiceVolume(float volume)
@@ -67,13 +69,6 @@
virtual status_t setMasterVolume(float volume)
{return mFinalInterface->setMasterVolume(volume);}
- virtual status_t setRouting(int mode, uint32_t routes)
- {return mFinalInterface->setRouting(mode, routes);}
- virtual status_t getRouting(int mode, uint32_t* routes)
- {return mFinalInterface->getRouting(mode, routes);}
- virtual status_t getMode(int* mode)
- {return mFinalInterface->getMode(mode);}
-
// mic mute
virtual status_t setMicMute(bool state)
{return mFinalInterface->setMicMute(state);}
@@ -83,17 +78,17 @@
virtual status_t setParameter(const char* key, const char* value)
{return mFinalInterface->setParameter(key, value);}
- virtual AudioStreamIn* openInputStream( int format, int channelCount, uint32_t sampleRate)
- {return mFinalInterface->openInputStream( format, channelCount, sampleRate);}
+ virtual AudioStreamIn* openInputStream( int format, int channelCount, uint32_t sampleRate, status_t *status)
+ {return mFinalInterface->openInputStream( format, channelCount, sampleRate, status);}
virtual status_t dump(int fd, const Vector<String16>& args) { return mFinalInterface->dumpState(fd, args); }
protected:
- virtual status_t doRouting() {return 0;}
-
+ virtual status_t doRouting() {return mFinalInterface->setRouting(mMode, mRoutes[mMode]);}
+
AudioHardwareInterface *mFinalInterface;
AudioStreamOutDump *mStreamOut;
-
+
};
}; // namespace android