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

Commit 548efc94 authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Rename RecordThread::mInputBytes to the more generic mBufferSize

This prepares for using it in PlaybackThreads later

Change-Id: Id90a92aa6372e4b69914b0008cef07296ca5d6a3
parent 9b58f63e
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -4161,7 +4161,7 @@ AudioFlinger::RecordThread::RecordThread(const sp<AudioFlinger>& audioFlinger,
                                         ) :
    ThreadBase(audioFlinger, id, outDevice, inDevice, RECORD),
    mInput(input), mResampler(NULL), mRsmpOutBuffer(NULL), mRsmpInBuffer(NULL),
    // mRsmpInIndex and mInputBytes set by readInputParameters()
    // mRsmpInIndex and mBufferSize set by readInputParameters()
    mReqChannelCount(popcount(channelMask)),
    mReqSampleRate(sampleRate)
    // mBytesRead is only meaningful while active, and so is cleared in start()
@@ -4314,7 +4314,7 @@ bool AudioFlinger::RecordThread::threadLoop()
                                mRsmpInIndex = 0;
                            }
                            mBytesRead = mInput->stream->read(mInput->stream, readInto,
                                    mInputBytes);
                                    mBufferSize);
                            if (mBytesRead <= 0) {
                                if ((mBytesRead < 0) && (mActiveTrack->mState == TrackBase::ACTIVE))
                                {
@@ -4669,7 +4669,7 @@ void AudioFlinger::RecordThread::dumpInternals(int fd, const Vector<String16>& a
    if (mActiveTrack != 0) {
        snprintf(buffer, SIZE, "In index: %d\n", mRsmpInIndex);
        result.append(buffer);
        snprintf(buffer, SIZE, "In size: %d\n", mInputBytes);
        snprintf(buffer, SIZE, "Buffer size: %u bytes\n", mBufferSize);
        result.append(buffer);
        snprintf(buffer, SIZE, "Resampling: %d\n", (mResampler != NULL));
        result.append(buffer);
@@ -4722,7 +4722,7 @@ status_t AudioFlinger::RecordThread::getNextBuffer(AudioBufferProvider::Buffer*
    int channelCount;

    if (framesReady == 0) {
        mBytesRead = mInput->stream->read(mInput->stream, mRsmpInBuffer, mInputBytes);
        mBytesRead = mInput->stream->read(mInput->stream, mRsmpInBuffer, mBufferSize);
        if (mBytesRead <= 0) {
            if ((mBytesRead < 0) && (mActiveTrack->mState == TrackBase::ACTIVE)) {
                ALOGE("RecordThread::getNextBuffer() Error reading audio input");
@@ -4918,8 +4918,8 @@ void AudioFlinger::RecordThread::readInputParameters()
    mChannelCount = popcount(mChannelMask);
    mFormat = mInput->stream->common.get_format(&mInput->stream->common);
    mFrameSize = audio_stream_frame_size(&mInput->stream->common);
    mInputBytes = mInput->stream->common.get_buffer_size(&mInput->stream->common);
    mFrameCount = mInputBytes / mFrameSize;
    mBufferSize = mInput->stream->common.get_buffer_size(&mInput->stream->common);
    mFrameCount = mBufferSize / mFrameSize;
    mRsmpInBuffer = new int16_t[mFrameCount * mChannelCount];

    if (mSampleRate != mReqSampleRate && mChannelCount <= FCC_2 && mReqChannelCount <= FCC_2)
+1 −1
Original line number Diff line number Diff line
@@ -901,7 +901,7 @@ private:
            int32_t                             *mRsmpOutBuffer;
            int16_t                             *mRsmpInBuffer;
            size_t                              mRsmpInIndex;
            size_t                              mInputBytes;
            size_t                              mBufferSize;    // stream buffer size for read()
            const uint32_t                      mReqChannelCount;
            const uint32_t                      mReqSampleRate;
            ssize_t                             mBytesRead;