Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 36355ee6 authored by Steve Kondik's avatar Steve Kondik
Browse files

av: Additional ifdefs for QCOM DirectTrack

 * Tunnel and LPA mode on legacy QC devices requires the DirectTrack
   code path, which going forward has been deprecated.
 * In order to properly support QC features on 8974, this needs broken
   out in order to not cause problems on new devices.
 * With this patch, QCOM_HARDWARE will enable features common to all
   QC platforms (including legacy), and legacy support will
   automatically be enabled based on the use of driver variant and
   value of BOARD_USES_LEGACY_ALSA_AUDIO.

Change-Id: I1da503309963734fd6603472fb87dd9c95c7b7b5
parent 6844ed4e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -210,7 +210,7 @@ public:
            audio_format_t format() const   { return mFormat; }
            uint32_t    channelCount() const    { return mChannelCount; }
            size_t      frameCount() const  { return mFrameCount; }
#ifdef QCOM_HARDWARE
#ifdef QCOM_DIRECTTRACK
            size_t      frameSize() const;
            audio_source_t inputSource() const;
#else
+1 −1
Original line number Diff line number Diff line
@@ -149,7 +149,7 @@ public:
        INPUT_CLOSED,
        INPUT_CONFIG_CHANGED,
        STREAM_CONFIG_CHANGED,
#ifdef QCOM_HARDWARE
#ifdef QCOM_DIRECTTRACK
        EFFECT_CONFIG_CHANGED,
#endif
        NUM_CONFIG_EVENTS
+8 −8
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@
#include <media/AudioTimestamp.h>
#include <media/IAudioTrack.h>
#include <utils/threads.h>
#ifdef QCOM_HARDWARE
#ifdef QCOM_DIRECTTRACK
#include <media/IDirectTrack.h>
#include <media/IDirectTrackClient.h>
#endif
@@ -38,7 +38,7 @@ class StaticAudioTrackClientProxy;

// ----------------------------------------------------------------------------

#ifdef QCOM_HARDWARE
#ifdef QCOM_DIRECTTRACK
class AudioTrack : public BnDirectTrackClient,
                   virtual public RefBase
#else
@@ -76,7 +76,7 @@ public:
        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
#ifdef QCOM_DIRECTTRACK
        EVENT_HW_FAIL = 9,          // ADSP failure.
#endif
    };
@@ -276,7 +276,7 @@ public:
     * This includes the latency due to AudioTrack buffer size, AudioMixer (if any)
     * and audio hardware driver.
     */
#ifdef QCOM_HARDWARE
#ifdef QCOM_DIRECTTRACK
            uint32_t    latency() const;
#else
            uint32_t    latency() const     { return mLatency; }
@@ -599,7 +599,7 @@ public:
     * Returns NO_ERROR if timestamp is valid.
     */
      virtual status_t    getTimestamp(AudioTimestamp& timestamp);
#ifdef QCOM_HARDWARE
#ifdef QCOM_DIRECTTRACK
      virtual void notify(int msg);
      virtual status_t    getTimeStamp(uint64_t *tstamp);
#endif
@@ -673,7 +673,7 @@ protected:
            bool     isOffloaded() const
                { return (mFlags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) != 0; }

#ifdef QCOM_HARDWARE
#ifdef QCOM_DIRECTTRACK
    sp<IDirectTrack>        mDirectTrack;
#endif
    // Next 3 fields may be changed if IAudioTrack is re-created, but always != 0
@@ -743,7 +743,7 @@ protected:
    uint32_t                mUpdatePeriod;          // in frames, zero means no EVENT_NEW_POS

    audio_output_flags_t    mFlags;
#ifdef QCOM_HARDWARE
#ifdef QCOM_DIRECTTRACK
    sp<IAudioFlinger>       mAudioFlinger;
    audio_io_handle_t       mAudioDirectOutput;
#endif
@@ -752,7 +752,7 @@ protected:

    mutable Mutex           mLock;

#ifdef QCOM_HARDWARE
#ifdef QCOM_DIRECTTRACK
    void*                   mObserver;
#endif
    bool                    mIsTimed;
+3 −3
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@
#include <utils/RefBase.h>
#include <utils/Errors.h>
#include <binder/IInterface.h>
#ifdef QCOM_HARDWARE
#ifdef QCOM_DIRECTTRACK
#include <media/IDirectTrack.h>
#include <media/IDirectTrackClient.h>
#endif
@@ -56,7 +56,7 @@ public:
        TRACK_TIMED   = 1,  // client requests a TimedAudioTrack
        TRACK_FAST    = 2,  // client requests a fast AudioTrack or AudioRecord
        TRACK_OFFLOAD = 4,  // client requests offload to hw codec
#ifdef QCOM_HARDWARE
#ifdef QCOM_DIRECTTRACK
        TRACK_VOICE_COMMUNICATION = 8, //client uses voice communication
#endif
    };
@@ -86,7 +86,7 @@ public:
                                int clientUid,
                                status_t *status) = 0;

#ifdef QCOM_HARDWARE
#ifdef QCOM_DIRECTTRACK
    /* create a direct audio track and registers it with AudioFlinger.
     * return null if the track cannot be created.
     */
+3 −3
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ public:
                                    // back (after stop is called)
            CB_EVENT_TEAR_DOWN,      // The AudioTrack was invalidated due to use case change:
                                    // Need to re-evaluate offloading options
#ifdef QCOM_HARDWARE
#ifdef QCOM_DIRECTTRACK
            CB_EVENT_UNDERRUN,
            CB_EVENT_HW_FAIL
#endif
@@ -102,7 +102,7 @@ public:
        virtual ssize_t     channelCount() const = 0;
        virtual ssize_t     frameSize() const = 0;
        virtual uint32_t    latency() const = 0;
#ifdef QCOM_HARDWARE
#ifdef QCOM_DIRECTTRACK
        virtual audio_stream_type_t    streamType() const {return AUDIO_STREAM_DEFAULT;}
#endif
        virtual float       msecsPerFrame() const = 0;
@@ -134,7 +134,7 @@ public:
        virtual status_t    setParameters(const String8& keyValuePairs) { return NO_ERROR; };
        virtual String8     getParameters(const String8& keys) { return String8::empty(); };

#ifdef QCOM_HARDWARE
#ifdef QCOM_DIRECTTRACK
        virtual ssize_t     sampleRate() const {return 0;};
        virtual status_t    getTimeStamp(uint64_t *tstamp) {return 0;};
#endif
Loading