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

Commit b7f24b10 authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

AudioSystem: remove unused stream type

The audio stream type is not used in the getSampleRate() and
 getFrameCount() methods.

Change-Id: I3d065ae272bd039204cd323cdab9b60460034f2d
parent 1a93f0cb
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -104,12 +104,10 @@ public:
    static status_t getOutputLatency(uint32_t* latency,
            audio_stream_type_t stream);
    static status_t getSamplingRate(audio_io_handle_t output,
                                          audio_stream_type_t streamType,
                                          uint32_t* samplingRate);
    // returns the number of frames per audio HAL write buffer. Corresponds to
    // audio_stream->get_buffer_size()/audio_stream_frame_size()
    static status_t getFrameCount(audio_io_handle_t output,
                                  audio_stream_type_t stream,
                                  size_t* frameCount);
    // returns the audio output stream latency in ms. Corresponds to
    // audio_stream_out->get_latency()
+6 −12
Original line number Diff line number Diff line
@@ -242,11 +242,10 @@ status_t AudioSystem::getOutputSamplingRate(uint32_t* samplingRate, audio_stream
        return PERMISSION_DENIED;
    }

    return getSamplingRate(output, streamType, samplingRate);
    return getSamplingRate(output, samplingRate);
}

status_t AudioSystem::getSamplingRate(audio_io_handle_t output,
                                      audio_stream_type_t streamType,
                                      uint32_t* samplingRate)
{
    OutputDescriptor *outputDesc;
@@ -265,13 +264,11 @@ status_t AudioSystem::getSamplingRate(audio_io_handle_t output,
        gLock.unlock();
    }
    if (*samplingRate == 0) {
        ALOGE("AudioSystem::getSamplingRate failed for output %d stream type %d",
                output, streamType);
        ALOGE("AudioSystem::getSamplingRate failed for output %d", output);
        return BAD_VALUE;
    }

    ALOGV("getSamplingRate() streamType %d, output %d, sampling rate %u", streamType, output,
            *samplingRate);
    ALOGV("getSamplingRate() output %d, sampling rate %u", output, *samplingRate);

    return NO_ERROR;
}
@@ -289,11 +286,10 @@ status_t AudioSystem::getOutputFrameCount(size_t* frameCount, audio_stream_type_
        return PERMISSION_DENIED;
    }

    return getFrameCount(output, streamType, frameCount);
    return getFrameCount(output, frameCount);
}

status_t AudioSystem::getFrameCount(audio_io_handle_t output,
                                    audio_stream_type_t streamType,
                                    size_t* frameCount)
{
    OutputDescriptor *outputDesc;
@@ -310,13 +306,11 @@ status_t AudioSystem::getFrameCount(audio_io_handle_t output,
        gLock.unlock();
    }
    if (*frameCount == 0) {
        ALOGE("AudioSystem::getFrameCount failed for output %d stream type %d",
                output, streamType);
        ALOGE("AudioSystem::getFrameCount failed for output %d", output);
        return BAD_VALUE;
    }

    ALOGV("getFrameCount() streamType %d, output %d, frameCount %d", streamType, output,
            *frameCount);
    ALOGV("getFrameCount() output %d, frameCount %d", output, *frameCount);

    return NO_ERROR;
}
+5 −5
Original line number Diff line number Diff line
@@ -647,7 +647,7 @@ uint32_t AudioTrack::getSampleRate() const
    if (isOffloaded_l()) {
        if (mOutput != AUDIO_IO_HANDLE_NONE) {
            uint32_t sampleRate = 0;
            status_t status = AudioSystem::getSamplingRate(mOutput, mStreamType, &sampleRate);
            status_t status = AudioSystem::getSamplingRate(mOutput, &sampleRate);
            if (status == NO_ERROR) {
                mSampleRate = sampleRate;
            }
@@ -887,16 +887,16 @@ status_t AudioTrack::createTrack_l(size_t epoch)
    }

    size_t afFrameCount;
    status = AudioSystem::getFrameCount(output, mStreamType, &afFrameCount);
    status = AudioSystem::getFrameCount(output, &afFrameCount);
    if (status != NO_ERROR) {
        ALOGE("getFrameCount(output=%d, streamType=%d) status %d", output, mStreamType, status);
        ALOGE("getFrameCount(output=%d) status %d", output, status);
        goto release;
    }

    uint32_t afSampleRate;
    status = AudioSystem::getSamplingRate(output, mStreamType, &afSampleRate);
    status = AudioSystem::getSamplingRate(output, &afSampleRate);
    if (status != NO_ERROR) {
        ALOGE("getSamplingRate(output=%d, streamType=%d) status %d", output, mStreamType, status);
        ALOGE("getSamplingRate(output=%d) status %d", output, status);
        goto release;
    }