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

Commit d054c324 authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Move control block mName to createTrack() output

This is part of a series of CLs to clean up the shared memory
control block, by removing any fields that don't have to be there.

Change-Id: I6e51003a1293b6800258c31b22cff2eba42162e7
parent 96f60d8f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -726,6 +726,7 @@ protected:
    sp<AudioTrackClientProxy>       mProxy;         // primary owner of the memory

    bool                    mInUnderrun;            // whether track is currently in underrun state
    String8                 mName;                  // server's name for this IAudioTrack

private:
    class DeathNotifier : public IBinder::DeathRecipient {
+4 −0
Original line number Diff line number Diff line
@@ -67,6 +67,10 @@ public:
                                audio_io_handle_t output,
                                pid_t tid,  // -1 means unused, otherwise must be valid non-0
                                int *sessionId,
                                // input: ignored
                                // output: server's description of IAudioTrack for display in logs.
                                // Don't attempt to parse, as the format could change.
                                String8& name,
                                status_t *status) = 0;

    virtual sp<IAudioRecord> openRecord(
+1 −3
Original line number Diff line number Diff line
@@ -122,11 +122,9 @@ private:
                // client write-only, server read-only
                uint16_t    mSendLevel;      // Fixed point U4.12 so 0x1000 means 1.0

                uint8_t     mPad2;           // unused
                uint16_t    mPad2;           // unused

public:
                // read-only for client, server writes once at initialization and is then read-only
                uint8_t     mName;           // normal tracks: track name, fast tracks: track index

    volatile    int32_t     mFlags;         // combinations of CBLK_*

+3 −2
Original line number Diff line number Diff line
@@ -953,6 +953,7 @@ status_t AudioTrack::createTrack_l(
                                                      output,
                                                      tid,
                                                      &mSessionId,
                                                      mName,
                                                      &status);

    if (track == 0) {
@@ -1183,8 +1184,8 @@ void AudioTrack::releaseBuffer(Buffer* audioBuffer)
    if (mState == STATE_ACTIVE) {
        audio_track_cblk_t* cblk = mCblk;
        if (android_atomic_and(~CBLK_DISABLED, &cblk->mFlags) & CBLK_DISABLED) {
            ALOGW("releaseBuffer() track %p name=%#x disabled due to previous underrun, restarting",
                    this, cblk->mName);
            ALOGW("releaseBuffer() track %p name=%s disabled due to previous underrun, restarting",
                    this, mName.string());
            // FIXME ignoring status
            mAudioTrack->start();
        }
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ namespace android {

audio_track_cblk_t::audio_track_cblk_t()
    : mServer(0), frameCount_(0), mFutex(0), mMinimum(0),
    mVolumeLR(0x10001000), mSampleRate(0), mSendLevel(0), mName(0), mFlags(0)
    mVolumeLR(0x10001000), mSampleRate(0), mSendLevel(0), mFlags(0)
{
    memset(&u, 0, sizeof(u));
}
Loading