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

Commit dd206093 authored by Eric Laurent's avatar Eric Laurent Committed by Android Git Automerger
Browse files

am 22a2d718: Merge "Audio policy manager changes for audio effects" into gingerbread

Merge commit '22a2d718' into gingerbread-plus-aosp

* commit '22a2d718':
  Audio policy manager changes for audio effects
parents ff45709f 22a2d718
Loading
Loading
Loading
Loading
+25 −2
Original line number Diff line number Diff line
@@ -168,6 +168,15 @@ public:
        TX_DISABLE    = 0
    };

    // special audio session values
    enum audio_sessions {
        SESSION_OUTPUT_STAGE = -1, // session for effects attached to a particular output stream
                                   // (value must be less than 0)
        SESSION_OUTPUT_MIX = 0,    // session for effects applied to output mix. These effects can
                                   // be moved by audio policy manager to another output stream
                                   // (value must be 0)
    };

    /* These are static methods to control the system-wide AudioFlinger
     * only privileged processes can have access to them
     */
@@ -353,8 +362,12 @@ public:
                                        uint32_t format = FORMAT_DEFAULT,
                                        uint32_t channels = CHANNEL_OUT_STEREO,
                                        output_flags flags = OUTPUT_FLAG_INDIRECT);
    static status_t startOutput(audio_io_handle_t output, AudioSystem::stream_type stream);
    static status_t stopOutput(audio_io_handle_t output, AudioSystem::stream_type stream);
    static status_t startOutput(audio_io_handle_t output,
                                AudioSystem::stream_type stream,
                                int session = 0);
    static status_t stopOutput(audio_io_handle_t output,
                               AudioSystem::stream_type stream,
                               int session = 0);
    static void releaseOutput(audio_io_handle_t output);
    static audio_io_handle_t getInput(int inputSource,
                                    uint32_t samplingRate = 0,
@@ -370,6 +383,16 @@ public:
    static status_t setStreamVolumeIndex(stream_type stream, int index);
    static status_t getStreamVolumeIndex(stream_type stream, int *index);

    static uint32_t getStrategyForStream(stream_type stream);

    static audio_io_handle_t getOutputForEffect(effect_descriptor_t *desc);
    static status_t registerEffect(effect_descriptor_t *desc,
                                    audio_io_handle_t output,
                                    uint32_t strategy,
                                    int session,
                                    int id);
    static status_t unregisterEffect(int id);

    static const sp<IAudioPolicyService>& get_audio_policy_service();

    // ----------------------------------------------------------------------------
+2 −0
Original line number Diff line number Diff line
@@ -161,6 +161,8 @@ public:
                                    status_t *status,
                                    int *id,
                                    int *enabled) = 0;

    virtual status_t moveEffects(int session, int srcOutput, int dstOutput) = 0;
};


+14 −2
Original line number Diff line number Diff line
@@ -53,8 +53,12 @@ public:
                                        uint32_t format = AudioSystem::FORMAT_DEFAULT,
                                        uint32_t channels = 0,
                                        AudioSystem::output_flags flags = AudioSystem::OUTPUT_FLAG_INDIRECT) = 0;
    virtual status_t startOutput(audio_io_handle_t output, AudioSystem::stream_type stream) = 0;
    virtual status_t stopOutput(audio_io_handle_t output, AudioSystem::stream_type stream) = 0;
    virtual status_t startOutput(audio_io_handle_t output,
                                 AudioSystem::stream_type stream,
                                 int session = 0) = 0;
    virtual status_t stopOutput(audio_io_handle_t output,
                                AudioSystem::stream_type stream,
                                int session = 0) = 0;
    virtual void releaseOutput(audio_io_handle_t output) = 0;
    virtual audio_io_handle_t getInput(int inputSource,
                                    uint32_t samplingRate = 0,
@@ -69,6 +73,14 @@ public:
                                      int indexMax) = 0;
    virtual status_t setStreamVolumeIndex(AudioSystem::stream_type stream, int index) = 0;
    virtual status_t getStreamVolumeIndex(AudioSystem::stream_type stream, int *index) = 0;
    virtual uint32_t getStrategyForStream(AudioSystem::stream_type stream) = 0;
    virtual audio_io_handle_t getOutputForEffect(effect_descriptor_t *desc) = 0;
    virtual status_t registerEffect(effect_descriptor_t *desc,
                                    audio_io_handle_t output,
                                    uint32_t strategy,
                                    int session,
                                    int id) = 0;
    virtual status_t unregisterEffect(int id) = 0;
};


+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ static list_elem_t *gCurLib; // current library in enumeration process
static list_elem_t *gCurEffect; // current effect in enumeration process
static uint32_t gCurEffectIdx;       // current effect index in enumeration process

static const char * const gEffectLibPath = "/system/lib/soundfx"; // path to built-in effect libraries
const char * const gEffectLibPath = "/system/lib/soundfx"; // path to built-in effect libraries
static int gInitDone; // true is global initialization has been preformed
static int gNextLibId; // used by loadLibrary() to allocate unique library handles
static int gCanQueryEffect; // indicates that call to EffectQueryEffect() is valid, i.e. that the list of effects
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@
#define LOG_TAG "Bundle"
#define ARRAY_SIZE(array) (sizeof array / sizeof array[0])
#define LVM_BUNDLE                // Include all the bundle code
#define LOG_NDEBUG 0
//#define LOG_NDEBUG 0

#include <cutils/log.h>
#include <assert.h>
Loading