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

Commit eeca3267 authored by Glenn Kasten's avatar Glenn Kasten
Browse files

IAudioFlinger::openRecord track_flags_t flags is in/out

This will allow AudioFlinger to tell client it is denying a request.

Change-Id: Iff2be3ad6636371bbda9c9899a283c94620c1f06
parent 27f7b2a8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ public:
                                audio_format_t format,
                                audio_channel_mask_t channelMask,
                                size_t frameCount,
                                track_flags_t flags,
                                track_flags_t *flags,
                                pid_t tid,  // -1 means unused, otherwise must be valid non-0
                                int *sessionId,
                                status_t *status) = 0;
+2 −1
Original line number Diff line number Diff line
@@ -451,12 +451,13 @@ status_t AudioRecord::openRecord_l(
    pid_t tid = -1;
    // FIXME see similar logic at AudioTrack for tid

    IAudioFlinger::track_flags_t trackFlags = IAudioFlinger::TRACK_DEFAULT;
    int originalSessionId = mSessionId;
    sp<IAudioRecord> record = audioFlinger->openRecord(input,
                                                       sampleRate, format,
                                                       mChannelMask,
                                                       frameCount,
                                                       IAudioFlinger::TRACK_DEFAULT,
                                                       &trackFlags,
                                                       tid,
                                                       &mSessionId,
                                                       &status);
+9 −3
Original line number Diff line number Diff line
@@ -144,7 +144,7 @@ public:
                                audio_format_t format,
                                audio_channel_mask_t channelMask,
                                size_t frameCount,
                                track_flags_t flags,
                                track_flags_t *flags,
                                pid_t tid,
                                int *sessionId,
                                status_t *status)
@@ -157,7 +157,8 @@ public:
        data.writeInt32(format);
        data.writeInt32(channelMask);
        data.writeInt32(frameCount);
        data.writeInt32(flags);
        track_flags_t lFlags = flags != NULL ? *flags : (track_flags_t) TRACK_DEFAULT;
        data.writeInt32(lFlags);
        data.writeInt32((int32_t) tid);
        int lSessionId = 0;
        if (sessionId != NULL) {
@@ -168,6 +169,10 @@ public:
        if (lStatus != NO_ERROR) {
            ALOGE("openRecord error: %s", strerror(-lStatus));
        } else {
            lFlags = reply.readInt32();
            if (flags != NULL) {
                *flags = lFlags;
            }
            lSessionId = reply.readInt32();
            if (sessionId != NULL) {
                *sessionId = lSessionId;
@@ -761,7 +766,8 @@ status_t BnAudioFlinger::onTransact(
            int sessionId = data.readInt32();
            status_t status;
            sp<IAudioRecord> record = openRecord(input,
                    sampleRate, format, channelMask, frameCount, flags, tid, &sessionId, &status);
                    sampleRate, format, channelMask, frameCount, &flags, tid, &sessionId, &status);
            reply->writeInt32(flags);
            reply->writeInt32(sessionId);
            reply->writeInt32(status);
            reply->writeStrongBinder(record->asBinder());
+2 −2
Original line number Diff line number Diff line
@@ -1212,7 +1212,7 @@ sp<IAudioRecord> AudioFlinger::openRecord(
        audio_format_t format,
        audio_channel_mask_t channelMask,
        size_t frameCount,
        IAudioFlinger::track_flags_t flags,
        IAudioFlinger::track_flags_t *flags,
        pid_t tid,
        int *sessionId,
        status_t *status)
@@ -1261,7 +1261,7 @@ sp<IAudioRecord> AudioFlinger::openRecord(
        // create new record track.
        // The record track uses one track in mHardwareMixerThread by convention.
        recordTrack = thread->createRecordTrack_l(client, sampleRate, format, channelMask,
                                                  frameCount, lSessionId, flags, tid, &lStatus);
                                                  frameCount, lSessionId, *flags, tid, &lStatus);
    }
    if (lStatus != NO_ERROR) {
        // remove local strong reference to Client before deleting the RecordTrack so that the
+1 −1
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ public:
                                audio_format_t format,
                                audio_channel_mask_t channelMask,
                                size_t frameCount,
                                IAudioFlinger::track_flags_t flags,
                                IAudioFlinger::track_flags_t *flags,
                                pid_t tid,
                                int *sessionId,
                                status_t *status);