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

Commit 587f8425 authored by Glenn Kasten's avatar Glenn Kasten Committed by Android (Google) Code Review
Browse files

Merge "Use sp<AudioTrack> instead of raw AudioTrack *"

parents b756239a 2799d743
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -191,7 +191,9 @@ public:
    /* Terminates the AudioTrack and unregisters it from AudioFlinger.
     * Also destroys all resources associated with the AudioTrack.
     */
                        ~AudioTrack();
protected:
                        virtual ~AudioTrack();
public:

    /* Initialize an uninitialized AudioTrack.
     * Returned status (from utils/Errors.h) can be:
+1 −1
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ private:
    EAS_DATA_HANDLE     mEasData;
    EAS_FILE_LOCATOR    mEasJetFileLoc;
    EAS_PCM*            mAudioBuffer;// EAS renders the MIDI data into this buffer,
    AudioTrack*         mAudioTrack; // and we play it in this audio track
    sp<AudioTrack>      mAudioTrack; // and we play it in this audio track
    int                 mTrackBufferSize;
    S_JET_STATUS        mJetStatus;
    S_JET_STATUS        mPreviousJetStatus;
+2 −2
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ protected:
class SoundChannel : public SoundEvent {
public:
    enum state { IDLE, RESUMING, STOPPING, PAUSED, PLAYING };
    SoundChannel() : mAudioTrack(NULL), mState(IDLE), mNumChannels(1),
    SoundChannel() : mState(IDLE), mNumChannels(1),
            mPos(0), mToggle(0), mAutoPaused(false) {}
    ~SoundChannel();
    void init(SoundPool* soundPool);
@@ -148,7 +148,7 @@ private:
    bool doStop_l();

    SoundPool*          mSoundPool;
    AudioTrack*         mAudioTrack;
    sp<AudioTrack>      mAudioTrack;
    SoundEvent          mNextEvent;
    Mutex               mLock;
    int                 mState;
+2 −2
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ public:
    bool isInited() { return (mState == TONE_IDLE)?false:true;}

    // returns the audio session this ToneGenerator belongs to or 0 if an error occured.
    int getSessionId() { return (mpAudioTrack == NULL) ? 0 : mpAudioTrack->getSessionId(); }
    int getSessionId() { return (mpAudioTrack == 0) ? 0 : mpAudioTrack->getSessionId(); }

private:

@@ -264,7 +264,7 @@ private:
    unsigned short mLoopCounter; // Current tone loopback count

    uint32_t mSamplingRate;  // AudioFlinger Sampling rate
    AudioTrack *mpAudioTrack;  // Pointer to audio track used for playback
    sp<AudioTrack> mpAudioTrack;  // Pointer to audio track used for playback
    Mutex mLock;  // Mutex to control concurent access to ToneGenerator object from audio callback and application API
    Mutex mCbkCondLock; // Mutex associated to mWaitCbkCond
    Condition mWaitCbkCond; // condition enabling interface to wait for audio callback completion after a change is requested
+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ public:
private:
    friend class VideoEditorAudioPlayer;
    sp<MediaSource> mSource;
    AudioTrack *mAudioTrack;
    sp<AudioTrack> mAudioTrack;

    MediaBuffer *mInputBuffer;

Loading