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

Commit df0d3ab4 authored by Glenn Kasten's avatar Glenn Kasten Committed by Android (Google) Code Review
Browse files

Merge "Use AudioRecord::record_flags consistently"

parents c2a4a106 f60a5d71
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -203,7 +203,7 @@ android_media_AudioRecord_setup(JNIEnv *env, jobject thiz, jobject weak_this,
        format,        // word length, PCM
        channels,
        frameCount,
        0,             // flags
        (AudioRecord::record_flags) 0,  // flags
        recorderCallback,// callback_t
        lpCallbackData,// void* user
        0,             // notificationFrames,
+5 −3
Original line number Diff line number Diff line
@@ -143,6 +143,8 @@ public:
     * user                Context for use by the callback receiver.
     */

     // FIXME consider removing this alias and replacing it by audio_in_acoustics_t
     //       or removing the parameter entirely if it is unused
     enum record_flags {
         RECORD_AGC_ENABLE = AUDIO_IN_ACOUSTICS_AGC_ENABLE,
         RECORD_NS_ENABLE  = AUDIO_IN_ACOUSTICS_NS_ENABLE,
@@ -154,7 +156,7 @@ public:
                                    audio_format_t format = AUDIO_FORMAT_DEFAULT,
                                    uint32_t channelMask = AUDIO_CHANNEL_IN_MONO,
                                    int frameCount      = 0,
                                    uint32_t flags      = 0,
                                    record_flags flags  = (record_flags) 0,
                                    callback_t cbf = NULL,
                                    void* user = NULL,
                                    int notificationFrames = 0,
@@ -180,7 +182,7 @@ public:
                            audio_format_t format = AUDIO_FORMAT_DEFAULT,
                            uint32_t channelMask = AUDIO_CHANNEL_IN_MONO,
                            int frameCount      = 0,
                            uint32_t flags      = 0,
                            record_flags flags  = (record_flags) 0,
                            callback_t cbf = NULL,
                            void* user = NULL,
                            int notificationFrames = 0,
@@ -383,7 +385,7 @@ private:
    bool                    mMarkerReached;
    uint32_t                mNewPosition;
    uint32_t                mUpdatePeriod;
    uint32_t                mFlags;
    record_flags            mFlags;
    uint32_t                mChannelMask;
    audio_io_handle_t       mInput;
    int                     mSessionId;
+2 −2
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ AudioRecord::AudioRecord(
        audio_format_t format,
        uint32_t channelMask,
        int frameCount,
        uint32_t flags,
        record_flags flags,
        callback_t cbf,
        void* user,
        int notificationFrames,
@@ -124,7 +124,7 @@ status_t AudioRecord::set(
        audio_format_t format,
        uint32_t channelMask,
        int frameCount,
        uint32_t flags,
        record_flags flags,
        callback_t cbf,
        void* user,
        int notificationFrames,
+3 −2
Original line number Diff line number Diff line
@@ -56,9 +56,10 @@ AudioSource::AudioSource(

    ALOGV("sampleRate: %d, channels: %d", sampleRate, channels);
    CHECK(channels == 1 || channels == 2);
    uint32_t flags = AudioRecord::RECORD_AGC_ENABLE |
    AudioRecord::record_flags flags = (AudioRecord::record_flags)
                    (AudioRecord::RECORD_AGC_ENABLE |
                     AudioRecord::RECORD_NS_ENABLE  |
                     AudioRecord::RECORD_IIR_ENABLE;
                     AudioRecord::RECORD_IIR_ENABLE);
    mRecord = new AudioRecord(
                inputSource, sampleRate, AUDIO_FORMAT_PCM_16_BIT,
                channels > 1? AUDIO_CHANNEL_IN_STEREO: AUDIO_CHANNEL_IN_MONO,