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

Commit 755b0a61 authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Pull up mFlags and isFastTrack from Track to TrackBase

Change-Id: I6bd48292310be4e05758a11f617f50585904422d
parent 5b17c0b5
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -115,7 +115,6 @@ public:
    void invalidate();
    bool isInvalid() const { return mIsInvalid; }
    virtual bool isTimedTrack() const { return false; }
    bool isFastTrack() const { return (mFlags & IAudioFlinger::TRACK_FAST) != 0; }
    int fastIndex() const { return mFastIndex; }

protected:
@@ -142,8 +141,6 @@ protected:
                                    // audio HAL when this track will be fully rendered
                                    // zero means not monitoring
private:
    IAudioFlinger::track_flags_t mFlags;

    // The following fields are only for fast tracks, and should be in a subclass
    int                 mFastIndex; // index within FastMixerState::mFastTracks[];
                                    // either mFastIndex == -1 if not isFastTrack()
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ public:
                                size_t frameCount,
                                int sessionId,
                                int uid,
                                bool isFast);
                                IAudioFlinger::track_flags_t flags);
    virtual             ~RecordTrack();

    virtual status_t    start(AudioSystem::sync_event_t event, int triggerSession);
+1 −1
Original line number Diff line number Diff line
@@ -5154,7 +5154,7 @@ sp<AudioFlinger::RecordThread::RecordTrack> AudioFlinger::RecordThread::createRe

        track = new RecordTrack(this, client, sampleRate,
                      format, channelMask, frameCount, sessionId, uid,
                      (*flags & IAudioFlinger::TRACK_FAST) != 0);
                      *flags);

        lStatus = track->initCheck();
        if (lStatus != NO_ERROR) {
+3 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ public:
                                const sp<IMemory>& sharedBuffer,
                                int sessionId,
                                int uid,
                                IAudioFlinger::track_flags_t flags,
                                bool isOut,
                                bool useReadOnlyHeap = false);
    virtual             ~TrackBase();
@@ -63,6 +64,7 @@ public:
    virtual status_t    setSyncEvent(const sp<SyncEvent>& event);

            sp<IMemory> getBuffers() const { return mBufferMemory; }
            bool        isFastTrack() const { return (mFlags & IAudioFlinger::TRACK_FAST) != 0; }

protected:
                        TrackBase(const TrackBase&);
@@ -134,6 +136,7 @@ protected:
    const int           mSessionId;
    int                 mUid;
    Vector < sp<SyncEvent> >mSyncEvents;
    const IAudioFlinger::track_flags_t mFlags;
    const bool          mIsOut;
    ServerProxy*        mServerProxy;
    const int           mId;
+7 −5
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ AudioFlinger::ThreadBase::TrackBase::TrackBase(
            const sp<IMemory>& sharedBuffer,
            int sessionId,
            int clientUid,
            IAudioFlinger::track_flags_t flags,
            bool isOut,
            bool useReadOnlyHeap)
    :   RefBase(),
@@ -85,6 +86,7 @@ AudioFlinger::ThreadBase::TrackBase::TrackBase(
                mChannelCount * audio_bytes_per_sample(format) : sizeof(int8_t)),
        mFrameCount(frameCount),
        mSessionId(sessionId),
        mFlags(flags),
        mIsOut(isOut),
        mServerProxy(NULL),
        mId(android_atomic_inc(&nextTrackId)),
@@ -349,7 +351,7 @@ AudioFlinger::PlaybackThread::Track::Track(
            int uid,
            IAudioFlinger::track_flags_t flags)
    :   TrackBase(thread, client, sampleRate, format, channelMask, frameCount, sharedBuffer,
            sessionId, uid, true /*isOut*/),
            sessionId, uid, flags, true /*isOut*/),
    mFillingUpStatus(FS_INVALID),
    // mRetryCount initialized later when needed
    mSharedBuffer(sharedBuffer),
@@ -359,7 +361,6 @@ AudioFlinger::PlaybackThread::Track::Track(
    mAuxBuffer(NULL),
    mAuxEffectId(0), mHasVolumeController(false),
    mPresentationCompleteFrames(0),
    mFlags(flags),
    mFastIndex(-1),
    mCachedVolume(1.0),
    mIsInvalid(false),
@@ -1833,10 +1834,11 @@ AudioFlinger::RecordThread::RecordTrack::RecordTrack(
            size_t frameCount,
            int sessionId,
            int uid,
            bool isFast)
            IAudioFlinger::track_flags_t flags)
    :   TrackBase(thread, client, sampleRate, format,
                  channelMask, frameCount, 0 /*sharedBuffer*/, sessionId, uid, false /*isOut*/,
                  isFast /*useReadOnlyHeap*/),
                  channelMask, frameCount, 0 /*sharedBuffer*/, sessionId, uid,
                  flags, false /*isOut*/,
                  (flags & IAudioFlinger::TRACK_FAST) != 0 /*useReadOnlyHeap*/),
        mOverflow(false), mResampler(NULL), mRsmpOutBuffer(NULL), mRsmpOutFrameCount(0),
        // See real initialization of mRsmpInFront at RecordThread::start()
        mRsmpInUnrel(0), mRsmpInFront(0), mFramesToDrop(0), mResamplerBufferProvider(NULL)