frameworks/av: Add ifdefs for QCOM_HARDWARE features
Change-Id: Iebe0da91f0b761bba8eb8c0e181c47bbd0d0703d
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h
index f74825c..3ef68fb 100644
--- a/include/media/AudioTrack.h
+++ b/include/media/AudioTrack.h
@@ -24,8 +24,10 @@
#include <media/AudioTimestamp.h>
#include <media/IAudioTrack.h>
#include <utils/threads.h>
+#ifdef QCOM_HARDWARE
#include <media/IDirectTrack.h>
#include <media/IDirectTrackClient.h>
+#endif
namespace android {
// ----------------------------------------------------------------------------
@@ -36,8 +38,12 @@
// ----------------------------------------------------------------------------
+#ifdef QCOM_HARDWARE
class AudioTrack : public BnDirectTrackClient,
virtual public RefBase
+#else
+class AudioTrack : public RefBase
+#endif
{
public:
enum channel_index {
@@ -70,7 +76,9 @@
EVENT_NEW_TIMESTAMP = 8, // Delivered periodically and when there's a significant change
// in the mapping from frame position to presentation time.
// See AudioTimestamp for the information included with event.
+#ifdef QCOM_HARDWARE
EVENT_HW_FAIL = 9, // ADSP failure.
+#endif
};
/* Client should declare Buffer on the stack and pass address to obtainBuffer()
@@ -265,7 +273,11 @@
* This includes the latency due to AudioTrack buffer size, AudioMixer (if any)
* and audio hardware driver.
*/
+#ifdef QCOM_HARDWARE
uint32_t latency() const;
+#else
+ uint32_t latency() const { return mLatency; }
+#endif
/* getters, see constructors and set() */
@@ -584,8 +596,10 @@
* Returns NO_ERROR if timestamp is valid.
*/
virtual status_t getTimestamp(AudioTimestamp& timestamp);
+#ifdef QCOM_HARDWARE
virtual void notify(int msg);
virtual status_t getTimeStamp(uint64_t *tstamp);
+#endif
protected:
/* copying audio tracks is not allowed */
@@ -656,7 +670,9 @@
bool isOffloaded() const
{ return (mFlags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) != 0; }
+#ifdef QCOM_HARDWARE
sp<IDirectTrack> mDirectTrack;
+#endif
// Next 3 fields may be changed if IAudioTrack is re-created, but always != 0
sp<IAudioTrack> mAudioTrack;
sp<IMemory> mCblkMemory;
@@ -724,13 +740,18 @@
uint32_t mUpdatePeriod; // in frames, zero means no EVENT_NEW_POS
audio_output_flags_t mFlags;
+#ifdef QCOM_HARDWARE
sp<IAudioFlinger> mAudioFlinger;
audio_io_handle_t mAudioDirectOutput;
+#endif
int mSessionId;
int mAuxEffectId;
mutable Mutex mLock;
+
+#ifdef QCOM_HARDWARE
void* mObserver;
+#endif
bool mIsTimed;
int mPreviousPriority; // before start()
SchedPolicy mPreviousSchedulingGroup;