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

Commit d5b54a81 authored by Steve Kondik's avatar Steve Kondik
Browse files

Revert "audio: Omit FM code when HAVE_FM_RADIO is not set"

This reverts commit c5358c4b.
parent 8198ab6c
Loading
Loading
Loading
Loading
+0 −28
Original line number Diff line number Diff line
@@ -45,9 +45,7 @@ public:
        ENFORCED_AUDIBLE = 7, // Sounds that cannot be muted by user and must be routed to speaker
        DTMF             = 8,
        TTS              = 9,
#ifdef HAVE_FM_RADIO
        FM              = 10,
#endif
        NUM_STREAM_TYPES
    };

@@ -224,9 +222,7 @@ public:
        size_t* buffSize);

    static status_t setVoiceVolume(float volume);
#ifdef HAVE_FM_RADIO
    static status_t setFmVolume(float volume);
#endif

    // return the number of audio frames written by AudioFlinger to audio HAL and
    // audio dsp to DAC since the output on which the specificed stream is playing
@@ -257,22 +253,12 @@ public:
        DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES = 0x100,
        DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER = 0x200,
        DEVICE_OUT_AUX_DIGITAL = 0x400,
#ifdef HAVE_FM_RADIO
        DEVICE_OUT_FM = 0x800,
#endif
        DEVICE_OUT_DEFAULT = 0x8000,
#ifdef HAVE_FM_RADIO
        DEVICE_OUT_ALL = (DEVICE_OUT_EARPIECE | DEVICE_OUT_SPEAKER | DEVICE_OUT_WIRED_HEADSET |
                DEVICE_OUT_WIRED_HEADPHONE | DEVICE_OUT_FM | DEVICE_OUT_BLUETOOTH_SCO | DEVICE_OUT_BLUETOOTH_SCO_HEADSET |
                DEVICE_OUT_BLUETOOTH_SCO_CARKIT | DEVICE_OUT_BLUETOOTH_A2DP | DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES |
                DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER | DEVICE_OUT_AUX_DIGITAL | DEVICE_OUT_DEFAULT),
#endif
#ifndef HAVE_FM_RADIO
        DEVICE_OUT_ALL = (DEVICE_OUT_EARPIECE | DEVICE_OUT_SPEAKER | DEVICE_OUT_WIRED_HEADSET |
                DEVICE_OUT_WIRED_HEADPHONE | DEVICE_OUT_BLUETOOTH_SCO | DEVICE_OUT_BLUETOOTH_SCO_HEADSET |
                DEVICE_OUT_BLUETOOTH_SCO_CARKIT | DEVICE_OUT_BLUETOOTH_A2DP | DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES |
                DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER | DEVICE_OUT_AUX_DIGITAL | DEVICE_OUT_DEFAULT),
#endif
        DEVICE_OUT_ALL_A2DP = (DEVICE_OUT_BLUETOOTH_A2DP | DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES |
                DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER),

@@ -285,23 +271,13 @@ public:
        DEVICE_IN_AUX_DIGITAL = 0x200000,
        DEVICE_IN_VOICE_CALL = 0x400000,
        DEVICE_IN_BACK_MIC = 0x800000,
#ifdef HAVE_FM_RADIO
        DEVICE_IN_FM_RX = 0x1000000,
        DEVICE_IN_FM_RX_A2DP = 0x2000000,
#endif
        DEVICE_IN_DEFAULT = 0x80000000,

#ifdef HAVE_FM_RADIO
        DEVICE_IN_ALL = (DEVICE_IN_COMMUNICATION | DEVICE_IN_AMBIENT | DEVICE_IN_BUILTIN_MIC |
                DEVICE_IN_BLUETOOTH_SCO_HEADSET | DEVICE_IN_WIRED_HEADSET | DEVICE_IN_AUX_DIGITAL |
                DEVICE_IN_VOICE_CALL | DEVICE_IN_BACK_MIC | DEVICE_IN_FM_RX | DEVICE_IN_FM_RX_A2DP | DEVICE_IN_DEFAULT)
#endif
#ifndef HAVE_FM_RADIO
        DEVICE_IN_ALL = (DEVICE_IN_COMMUNICATION | DEVICE_IN_AMBIENT | DEVICE_IN_BUILTIN_MIC |
                DEVICE_IN_BLUETOOTH_SCO_HEADSET | DEVICE_IN_WIRED_HEADSET | DEVICE_IN_AUX_DIGITAL |
                DEVICE_IN_VOICE_CALL | DEVICE_IN_BACK_MIC | DEVICE_IN_DEFAULT)
#endif

    };

    // device connection states used for setDeviceConnectionState()
@@ -405,9 +381,7 @@ public:
    static bool isOutputDevice(audio_devices device);
    static bool isInputDevice(audio_devices device);
    static bool isA2dpDevice(audio_devices device);
#ifdef HAVE_FM_RADIO
    static bool isFmDevice(audio_devices device);
#endif
    static bool isBluetoothScoDevice(audio_devices device);
    static bool isLowVisibility(stream_type stream);
    static bool isOutputChannel(uint32_t channel);
@@ -486,10 +460,8 @@ public:
    static const char *keyFormat;
    static const char *keyChannels;
    static const char *keyFrameCount;
#ifdef HAVE_FM_RADIO
    static const char *keyFmOn;
    static const char *keyFmOff;
#endif

    String8 toString();

+1 −2
Original line number Diff line number Diff line
@@ -134,9 +134,8 @@ public:
    virtual status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, int output) = 0;

    virtual unsigned int  getInputFramesLost(int ioHandle) = 0;
#ifdef HAVE_FM_RADIO
 
    virtual status_t setFmVolume(float volume) = 0;
#endif
};


+1 −5
Original line number Diff line number Diff line
@@ -44,14 +44,10 @@ enum audio_source {
    AUDIO_SOURCE_VOICE_CALL = 4,
    AUDIO_SOURCE_CAMCORDER = 5,
    AUDIO_SOURCE_VOICE_RECOGNITION = 6,
#ifndef HAVE_FM_RADIO
    AUDIO_SOURCE_MAX = AUDIO_SOURCE_VOICE_RECOGNITION,
#endif
#ifdef HAVE_FM_RADIO
    AUDIO_SOURCE_FM_RX = 7,
    AUDIO_SOURCE_FM_RX_A2DP = 8,
    AUDIO_SOURCE_MAX = AUDIO_SOURCE_FM_RX_A2DP,
#endif

    AUDIO_SOURCE_LIST_END  // must be last - used to validate audio source type
};

+0 −2
Original line number Diff line number Diff line
@@ -205,12 +205,10 @@ status_t A2dpAudioInterface::setVoiceVolume(float v)
    return mHardwareInterface->setVoiceVolume(v);
}

#ifdef HAVE_FM_RADIO
status_t A2dpAudioInterface::setFmVolume(float v)
{
    return mHardwareInterface->setFmVolume(v);
}
#endif

status_t A2dpAudioInterface::setMasterVolume(float v)
{
+1 −3
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ public:
    virtual status_t    initCheck();

    virtual status_t    setVoiceVolume(float volume);
    virtual status_t    setFmVolume(float volume);
    virtual status_t    setMasterVolume(float volume);

    virtual status_t    setMode(int mode);
@@ -67,9 +68,6 @@ public:
                                status_t *status,
                                AudioSystem::audio_in_acoustics acoustics);
    virtual    void        closeInputStream(AudioStreamIn* in);
#ifdef HAVE_FM_RADIO
    virtual status_t    setFmVolume(float volume);
#endif
//    static AudioHardwareInterface* createA2dpInterface();

protected:
Loading