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

Commit 7a2146d5 authored by The Android Open Source Project's avatar The Android Open Source Project
Browse files

auto import from //branches/cupcake/...@131421

parent 5e07b577
Loading
Loading
Loading
Loading
+31 −8
Original line number Diff line number Diff line
@@ -29,8 +29,27 @@ class AudioSystem
{
public:

    enum stream_type {
        DEFAULT         =-1,
        VOICE_CALL      = 0,
        SYSTEM          = 1,
        RING            = 2,
        MUSIC           = 3,
        ALARM           = 4,
        NOTIFICATION    = 5,
        BLUETOOTH_SCO   = 6,
        NUM_STREAM_TYPES
    };

    enum audio_output_type {
        AUDIO_OUTPUT_DEFAULT      =-1,
        AUDIO_OUTPUT_HARDWARE     = 0,
        AUDIO_OUTPUT_A2DP         = 1,
        NUM_AUDIO_OUTPUT_TYPES
    };

    enum audio_format {
        DEFAULT = 0,
        FORMAT_DEFAULT = 0,
        PCM_16_BIT,
        PCM_8_BIT,
        INVALID_FORMAT
@@ -96,9 +115,11 @@ public:
    static float linearToLog(int volume);
    static int logToLinear(float volume);

    static status_t getOutputSamplingRate(int* samplingRate);
    static status_t getOutputFrameCount(int* frameCount);
    static status_t getOutputLatency(uint32_t* latency);
    static status_t getOutputSamplingRate(int* samplingRate, int stream = DEFAULT);
    static status_t getOutputFrameCount(int* frameCount, int stream = DEFAULT);
    static status_t getOutputLatency(uint32_t* latency, int stream = DEFAULT);

    static bool routedToA2dpOutput(int streamType);
    
    static status_t getInputBufferSize(uint32_t sampleRate, int format, int channelCount, 
        size_t* buffSize);
@@ -117,9 +138,10 @@ private:
        virtual void binderDied(const wp<IBinder>& who);
        
        // IAudioFlingerClient
        virtual void audioOutputChanged(uint32_t frameCount, uint32_t samplingRate, uint32_t latency);
        virtual void a2dpEnabledChanged(bool enabled);
        
    };
    static int getOutput(int streamType);

    static sp<AudioFlingerClient> gAudioFlingerClient;

@@ -128,9 +150,10 @@ private:
    static Mutex gLock;
    static sp<IAudioFlinger> gAudioFlinger;
    static audio_error_callback gAudioErrorCallback;
    static int gOutSamplingRate;
    static int gOutFrameCount;
    static uint32_t gOutLatency;
    static int gOutSamplingRate[NUM_AUDIO_OUTPUT_TYPES];
    static int gOutFrameCount[NUM_AUDIO_OUTPUT_TYPES];
    static uint32_t gOutLatency[NUM_AUDIO_OUTPUT_TYPES];
    static bool gA2dpEnabled;
    
    static size_t gInBuffSize;
    // previous parameters for recording buffer size queries
+1 −14
Original line number Diff line number Diff line
@@ -42,19 +42,6 @@ class audio_track_cblk_t;
class AudioTrack
{
public:

    enum stream_type {
        DEFAULT         =-1,
        VOICE_CALL      = 0,
        SYSTEM          = 1,
        RING            = 2,
        MUSIC           = 3,
        ALARM           = 4,
        NOTIFICATION    = 5,
        BLUETOOTH_SCO   = 6,
        NUM_STREAM_TYPES
    };

    enum channel_index {
        MONO   = 0,
        LEFT   = 0,
@@ -128,7 +115,7 @@ public:
     * Parameters:
     *
     * streamType:         Select the type of audio stream this track is attached to
     *                     (e.g. AudioTrack::MUSIC).
     *                     (e.g. AudioSystem::MUSIC).
     * sampleRate:         Track sampling rate in Hz.
     * format:             PCM sample format (e.g AudioSystem::PCM_16_BIT for signed
     *                     16 bits per sample).
+8 −5
Original line number Diff line number Diff line
@@ -65,11 +65,11 @@ public:
    /* query the audio hardware state. This state never changes,
     * and therefore can be cached.
     */
    virtual     uint32_t    sampleRate() const = 0;
    virtual     int         channelCount() const = 0;
    virtual     int         format() const = 0;
    virtual     size_t      frameCount() const = 0;
    virtual     uint32_t    latency() const = 0;
    virtual     uint32_t    sampleRate(int output) const = 0;
    virtual     int         channelCount(int output) const = 0;
    virtual     int         format(int output) const = 0;
    virtual     size_t      frameCount(int output) const = 0;
    virtual     uint32_t    latency(int output) const = 0;

    /* set/get the audio hardware state. This will probably be used by
     * the preference panel, mostly.
@@ -117,6 +117,9 @@ public:
    
    // force AudioFlinger thread out of standby
    virtual     void        wakeUp() = 0;

    // is A2DP output enabled
    virtual     bool        isA2dpEnabled() const = 0;
};


+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ public:
    DECLARE_META_INTERFACE(AudioFlingerClient);

    // Notifies a change of audio output from/to hardware to/from A2DP.
    virtual void audioOutputChanged(uint32_t frameCount, uint32_t samplingRate, uint32_t latency) = 0;
    virtual void a2dpEnabledChanged(bool enabled) = 0;

};

+1 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ public:
    virtual	status_t		setVideoEncoder(int ve) = 0;
    virtual	status_t		setAudioEncoder(int ae) = 0;
    virtual	status_t		setOutputFile(const char* path) = 0;
    virtual	status_t		setOutputFile(int fd, int64_t offset, int64_t length) = 0;
    virtual	status_t		setVideoSize(int width, int height) = 0;
    virtual	status_t		setVideoFrameRate(int frames_per_second) = 0;
    virtual	status_t		prepare() = 0;
Loading