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

Commit 20f18efb authored by Glenn Kasten's avatar Glenn Kasten Committed by android-build-merger
Browse files

Merge "Use audio_session_t consistently" into nyc-dev

am: 9a57e34f

* commit '9a57e34f':
  Use audio_session_t consistently
parents f91072ab 9a57e34f
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -139,7 +139,7 @@ public:
     *               of descriptors to return.
     *               *count is limited to kMaxPreProcessing on return.
     */
    static status_t queryDefaultPreProcessing(int audioSession,
    static status_t queryDefaultPreProcessing(audio_session_t audioSession,
                                              effect_descriptor_t *descriptors,
                                              uint32_t *count);

@@ -237,7 +237,7 @@ public:
                  int32_t priority = 0,
                  effect_callback_t cbf = NULL,
                  void* user = NULL,
                  int sessionId = AUDIO_SESSION_OUTPUT_MIX,
                  audio_session_t sessionId = AUDIO_SESSION_OUTPUT_MIX,
                  audio_io_handle_t io = AUDIO_IO_HANDLE_NONE
                  );

@@ -250,7 +250,7 @@ public:
                    int32_t priority = 0,
                    effect_callback_t cbf = NULL,
                    void* user = NULL,
                    int sessionId = AUDIO_SESSION_OUTPUT_MIX,
                    audio_session_t sessionId = AUDIO_SESSION_OUTPUT_MIX,
                    audio_io_handle_t io = AUDIO_IO_HANDLE_NONE
                    );

@@ -272,7 +272,7 @@ public:
                            int32_t priority = 0,
                            effect_callback_t cbf = NULL,
                            void* user = NULL,
                            int sessionId = AUDIO_SESSION_OUTPUT_MIX,
                            audio_session_t sessionId = AUDIO_SESSION_OUTPUT_MIX,
                            audio_io_handle_t io = AUDIO_IO_HANDLE_NONE
                            );

@@ -405,7 +405,7 @@ public:

protected:
     bool                    mEnabled;           // enable state
     int32_t                 mSessionId;         // audio session ID
     audio_session_t         mSessionId;         // audio session ID
     int32_t                 mPriority;          // priority for effect control
     status_t                mStatus;            // effect status
     effect_callback_t       mCbf;               // callback function for status, control and
+5 −5
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ public:
                                    callback_t cbf = NULL,
                                    void* user = NULL,
                                    uint32_t notificationFrames = 0,
                                    int sessionId = AUDIO_SESSION_ALLOCATE,
                                    audio_session_t sessionId = AUDIO_SESSION_ALLOCATE,
                                    transfer_type transferType = TRANSFER_DEFAULT,
                                    audio_input_flags_t flags = AUDIO_INPUT_FLAG_NONE,
                                    int uid = -1,
@@ -215,7 +215,7 @@ public:
                            void* user = NULL,
                            uint32_t notificationFrames = 0,
                            bool threadCanCallJava = false,
                            int sessionId = AUDIO_SESSION_ALLOCATE,
                            audio_session_t sessionId = AUDIO_SESSION_ALLOCATE,
                            transfer_type transferType = TRANSFER_DEFAULT,
                            audio_input_flags_t flags = AUDIO_INPUT_FLAG_NONE,
                            int uid = -1,
@@ -249,7 +249,7 @@ public:
     * the specified event occurs on the specified trigger session.
     */
            status_t    start(AudioSystem::sync_event_t event = AudioSystem::SYNC_EVENT_NONE,
                              int triggerSession = 0);
                              audio_session_t triggerSession = AUDIO_SESSION_NONE);

    /* Stop a track.  The callback will cease being called.  Note that obtainBuffer() still
     * works and will drain buffers until the pool is exhausted, and then will return WOULD_BLOCK.
@@ -352,7 +352,7 @@ public:
     *
     * No lock needed because session ID doesn't change after first set().
     */
            int    getSessionId() const { return mSessionId; }
            audio_session_t getSessionId() const { return mSessionId; }

    /* Public API for TRANSFER_OBTAIN mode.
     * Obtains a buffer of up to "audioBuffer->frameCount" full frames.
@@ -603,7 +603,7 @@ private:
                                                    // held to read or write those bits reliably.
    audio_input_flags_t     mOrigFlags;             // as specified in constructor or set(), const

    int                     mSessionId;
    audio_session_t         mSessionId;
    transfer_type           mTransfer;

    // Next 5 fields may be changed if IAudioRecord is re-created, but always != 0
+4 −4
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ namespace android {

typedef void (*audio_error_callback)(status_t err);
typedef void (*dynamic_policy_callback)(int event, String8 regId, int val);
typedef void (*record_config_callback)(int event, int session, int source,
typedef void (*record_config_callback)(int event, audio_session_t session, int source,
                const audio_config_base_t *clientConfig, const audio_config_base_t *deviceConfig,
                audio_patch_handle_t patchHandle);

@@ -155,8 +155,8 @@ public:
    //       or an unspecified existing unique ID.
    static audio_unique_id_t newAudioUniqueId(audio_unique_id_use_t use);

    static void acquireAudioSessionId(int audioSession, pid_t pid);
    static void releaseAudioSessionId(int audioSession, pid_t pid);
    static void acquireAudioSessionId(audio_session_t audioSession, pid_t pid);
    static void releaseAudioSessionId(audio_session_t audioSession, pid_t pid);

    // Get the HW synchronization source used for an audio session.
    // Return a valid source or AUDIO_HW_SYNC_INVALID if an error occurs
@@ -260,7 +260,7 @@ public:
    static status_t registerEffect(const effect_descriptor_t *desc,
                                    audio_io_handle_t io,
                                    uint32_t strategy,
                                    int session,
                                    audio_session_t session,
                                    int id);
    static status_t unregisterEffect(int id);
    static status_t setEffectEnabled(int id, bool enabled);
+5 −5
Original line number Diff line number Diff line
@@ -213,7 +213,7 @@ public:
                                    callback_t cbf       = NULL,
                                    void* user           = NULL,
                                    uint32_t notificationFrames = 0,
                                    int sessionId        = AUDIO_SESSION_ALLOCATE,
                                    audio_session_t sessionId  = AUDIO_SESSION_ALLOCATE,
                                    transfer_type transferType = TRANSFER_DEFAULT,
                                    const audio_offload_info_t *offloadInfo = NULL,
                                    int uid = -1,
@@ -242,7 +242,7 @@ public:
                                    callback_t cbf      = NULL,
                                    void* user          = NULL,
                                    uint32_t notificationFrames = 0,
                                    int sessionId       = AUDIO_SESSION_ALLOCATE,
                                    audio_session_t sessionId   = AUDIO_SESSION_ALLOCATE,
                                    transfer_type transferType = TRANSFER_DEFAULT,
                                    const audio_offload_info_t *offloadInfo = NULL,
                                    int uid = -1,
@@ -287,7 +287,7 @@ public:
                            uint32_t notificationFrames = 0,
                            const sp<IMemory>& sharedBuffer = 0,
                            bool threadCanCallJava = false,
                            int sessionId       = AUDIO_SESSION_ALLOCATE,
                            audio_session_t sessionId  = AUDIO_SESSION_ALLOCATE,
                            transfer_type transferType = TRANSFER_DEFAULT,
                            const audio_offload_info_t *offloadInfo = NULL,
                            int uid = -1,
@@ -583,7 +583,7 @@ public:
     * Returned value:
     *  AudioTrack session ID.
     */
            int    getSessionId() const { return mSessionId; }
            audio_session_t getSessionId() const { return mSessionId; }

    /* Attach track auxiliary output to specified effect. Use effectId = 0
     * to detach track from effect.
@@ -959,7 +959,7 @@ protected:

    bool                    mDoNotReconnect;

    int                     mSessionId;
    audio_session_t         mSessionId;
    int                     mAuxEffectId;

    mutable Mutex           mLock;
+6 −6
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ public:
                                // However on failure, the client is responsible for release.
                                audio_io_handle_t output,
                                pid_t tid,  // -1 means unused, otherwise must be valid non-0
                                int *sessionId,
                                audio_session_t *sessionId,
                                int clientUid,
                                status_t *status) = 0;

@@ -91,7 +91,7 @@ public:
                                track_flags_t *flags,
                                pid_t tid,  // -1 means unused, otherwise must be valid non-0
                                int clientUid,
                                int *sessionId,
                                audio_session_t *sessionId,
                                size_t *notificationFrames,
                                sp<IMemory>& cblk,
                                sp<IMemory>& buffers,   // return value 0 means it follows cblk
@@ -184,8 +184,8 @@ public:

    virtual audio_unique_id_t newAudioUniqueId(audio_unique_id_use_t use) = 0;

    virtual void acquireAudioSessionId(int audioSession, pid_t pid) = 0;
    virtual void releaseAudioSessionId(int audioSession, pid_t pid) = 0;
    virtual void acquireAudioSessionId(audio_session_t audioSession, pid_t pid) = 0;
    virtual void releaseAudioSessionId(audio_session_t audioSession, pid_t pid) = 0;

    virtual status_t queryNumberEffects(uint32_t *numEffects) const = 0;

@@ -200,13 +200,13 @@ public:
                                    int32_t priority,
                                    // AudioFlinger doesn't take over handle reference from client
                                    audio_io_handle_t output,
                                    int sessionId,
                                    audio_session_t sessionId,
                                    const String16& callingPackage,
                                    status_t *status,
                                    int *id,
                                    int *enabled) = 0;

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

    virtual audio_module_handle_t loadHwModule(const char *name) = 0;
Loading