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

Commit 142f519a authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Use symbol AUDIO_IO_HANDLE_NONE from <system/audio.h>

Change-Id: Id6b1aa17558eb73e17f22b8eab6cd02e00a96dff
parent ecdca392
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -231,7 +231,7 @@ public:
                  effect_callback_t cbf = NULL,
                  void* user = NULL,
                  int sessionId = AUDIO_SESSION_OUTPUT_MIX,
                  audio_io_handle_t io = 0
                  audio_io_handle_t io = AUDIO_IO_HANDLE_NONE
                  );

    /* Constructor.
@@ -243,7 +243,7 @@ public:
                    effect_callback_t cbf = NULL,
                    void* user = NULL,
                    int sessionId = AUDIO_SESSION_OUTPUT_MIX,
                    audio_io_handle_t io = 0
                    audio_io_handle_t io = AUDIO_IO_HANDLE_NONE
                    );

    /* Terminates the AudioEffect and unregisters it from AudioFlinger.
@@ -265,7 +265,7 @@ public:
                            effect_callback_t cbf = NULL,
                            void* user = NULL,
                            int sessionId = AUDIO_SESSION_OUTPUT_MIX,
                            audio_io_handle_t io = 0
                            audio_io_handle_t io = AUDIO_IO_HANDLE_NONE
                            );

    /* Result of constructing the AudioEffect. This must be checked
+2 −1
Original line number Diff line number Diff line
@@ -450,7 +450,8 @@ public:
     *  none.
     *
     * Returned value:
     *  handle on audio hardware output
     *  handle on audio hardware output, or AUDIO_IO_HANDLE_NONE if the
     *  track needed to be re-created but that failed
     */
            audio_io_handle_t    getOutput() const;

+1 −1
Original line number Diff line number Diff line
@@ -471,7 +471,7 @@ status_t AudioRecord::openRecord_l(size_t epoch)

    audio_io_handle_t input = AudioSystem::getInput(mInputSource, mSampleRate, mFormat,
            mChannelMask, mSessionId);
    if (input == 0) {
    if (input == AUDIO_IO_HANDLE_NONE) {
        ALOGE("Could not get audio input for record source %d, sample rate %u, format %#x, "
              "channel mask %#x, session %d",
              mInputSource, mSampleRate, mFormat, mChannelMask, mSessionId);
+7 −7
Original line number Diff line number Diff line
@@ -196,12 +196,12 @@ String8 AudioSystem::getParameters(audio_io_handle_t ioHandle, const String8& ke

status_t AudioSystem::setParameters(const String8& keyValuePairs)
{
    return setParameters((audio_io_handle_t) 0, keyValuePairs);
    return setParameters(AUDIO_IO_HANDLE_NONE, keyValuePairs);
}

String8 AudioSystem::getParameters(const String8& keys)
{
    return getParameters((audio_io_handle_t) 0, keys);
    return getParameters(AUDIO_IO_HANDLE_NONE, keys);
}

// convert volume steps to natural log scale
@@ -284,7 +284,7 @@ status_t AudioSystem::getOutputFrameCount(size_t* frameCount, audio_stream_type_
    }

    output = getOutput(streamType);
    if (output == 0) {
    if (output == AUDIO_IO_HANDLE_NONE) {
        return PERMISSION_DENIED;
    }

@@ -329,7 +329,7 @@ status_t AudioSystem::getOutputLatency(uint32_t* latency, audio_stream_type_t st
    }

    output = getOutput(streamType);
    if (output == 0) {
    if (output == AUDIO_IO_HANDLE_NONE) {
        return PERMISSION_DENIED;
    }

@@ -413,7 +413,7 @@ uint32_t AudioSystem::getInputFramesLost(audio_io_handle_t ioHandle)
    const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger();
    uint32_t result = 0;
    if (af == 0) return result;
    if (ioHandle == 0) return result;
    if (ioHandle == AUDIO_IO_HANDLE_NONE) return result;

    result = af->getInputFramesLost(ioHandle);
    return result;
@@ -464,7 +464,7 @@ void AudioSystem::AudioFlingerClient::ioConfigChanged(int event, audio_io_handle
    const OutputDescriptor *desc;
    audio_stream_type_t stream;

    if (ioHandle == 0) return;
    if (ioHandle == AUDIO_IO_HANDLE_NONE) return;

    Mutex::Autolock _l(AudioSystem::gLock);

@@ -738,7 +738,7 @@ audio_io_handle_t AudioSystem::getOutputForEffect(const effect_descriptor_t *des
{
    const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service();
    // FIXME change return type to status_t, and return PERMISSION_DENIED here
    if (aps == 0) return 0;
    if (aps == 0) return AUDIO_IO_HANDLE_NONE;
    return aps->getOutputForEffect(desc);
}

+5 −5
Original line number Diff line number Diff line
@@ -546,7 +546,7 @@ void AudioTrack::pause()
    mAudioTrack->pause();

    if (isOffloaded_l()) {
        if (mOutput != 0) {
        if (mOutput != AUDIO_IO_HANDLE_NONE) {
            uint32_t halFrames;
            // OffloadThread sends HAL pause in its threadLoop.. time saved
            // here can be slightly off
@@ -633,7 +633,7 @@ uint32_t AudioTrack::getSampleRate() const
    // query the HAL and update if needed.
// FIXME use Proxy return channel to update the rate from server and avoid polling here
    if (isOffloaded_l()) {
        if (mOutput != 0) {
        if (mOutput != AUDIO_IO_HANDLE_NONE) {
            uint32_t sampleRate = 0;
            status_t status = AudioSystem::getSamplingRate(mOutput, mStreamType, &sampleRate);
            if (status == NO_ERROR) {
@@ -779,7 +779,7 @@ status_t AudioTrack::getPosition(uint32_t *position) const
            return NO_ERROR;
        }

        if (mOutput != 0) {
        if (mOutput != AUDIO_IO_HANDLE_NONE) {
            uint32_t halFrames;
            AudioSystem::getRenderPosition(mOutput, &halFrames, &dspFrames);
        }
@@ -855,7 +855,7 @@ status_t AudioTrack::createTrack_l(size_t epoch)

    audio_io_handle_t output = AudioSystem::getOutput(mStreamType, mSampleRate, mFormat,
            mChannelMask, mFlags, mOffloadInfo);
    if (output == 0) {
    if (output == AUDIO_IO_HANDLE_NONE) {
        ALOGE("Could not get audio output for stream type %d, sample rate %u, format %#x, "
              "channel mask %#x, flags %#x",
              mStreamType, mSampleRate, mFormat, mChannelMask, mFlags);
@@ -1798,7 +1798,7 @@ status_t AudioTrack::getTimestamp(AudioTimestamp& timestamp)
String8 AudioTrack::getParameters(const String8& keys)
{
    audio_io_handle_t output = getOutput();
    if (output != 0) {
    if (output != AUDIO_IO_HANDLE_NONE) {
        return AudioSystem::getParameters(output, keys);
    } else {
        return String8::empty();
Loading