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

Commit 7df8c0b7 authored by Glenn Kasten's avatar Glenn Kasten
Browse files

IAudioFlinger::openRecord now suggests notificationFrames

Change-Id: I08885cc381d03c522a23289e74f0e1ed46563863
parent 7c6f8785
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@ public:
                                track_flags_t *flags,
                                pid_t tid,  // -1 means unused, otherwise must be valid non-0
                                int *sessionId,
                                size_t *notificationFrames,
                                sp<IMemory>& cblk,
                                sp<IMemory>& buffers,   // return value 0 means it follows cblk
                                status_t *status) = 0;
+5 −0
Original line number Diff line number Diff line
@@ -495,6 +495,10 @@ status_t AudioRecord::openRecord_l(size_t epoch)
    size_t temp = frameCount;   // temp may be replaced by a revised value of frameCount,
                                // but we will still need the original value also
    int originalSessionId = mSessionId;

    // The notification frame count is the period between callbacks, as suggested by the server.
    size_t notificationFrames;

    sp<IMemory> iMem;           // for cblk
    sp<IMemory> bufferMem;
    sp<IAudioRecord> record = audioFlinger->openRecord(input,
@@ -504,6 +508,7 @@ status_t AudioRecord::openRecord_l(size_t epoch)
                                                       &trackFlags,
                                                       tid,
                                                       &mSessionId,
                                                       &notificationFrames,
                                                       iMem,
                                                       bufferMem,
                                                       &status);
+8 −0
Original line number Diff line number Diff line
@@ -175,6 +175,7 @@ public:
                                track_flags_t *flags,
                                pid_t tid,
                                int *sessionId,
                                size_t *notificationFrames,
                                sp<IMemory>& cblk,
                                sp<IMemory>& buffers,
                                status_t *status)
@@ -214,6 +215,10 @@ public:
            if (sessionId != NULL) {
                *sessionId = lSessionId;
            }
            size_t lNotificationFrames = (size_t) reply.readInt64();
            if (notificationFrames != NULL) {
                *notificationFrames = lNotificationFrames;
            }
            lStatus = reply.readInt32();
            record = interface_cast<IAudioRecord>(reply.readStrongBinder());
            cblk = interface_cast<IMemory>(reply.readStrongBinder());
@@ -959,16 +964,19 @@ status_t BnAudioFlinger::onTransact(
            track_flags_t flags = (track_flags_t) data.readInt32();
            pid_t tid = (pid_t) data.readInt32();
            int sessionId = data.readInt32();
            size_t notificationFrames = 0;
            sp<IMemory> cblk;
            sp<IMemory> buffers;
            status_t status;
            sp<IAudioRecord> record = openRecord(input,
                    sampleRate, format, channelMask, &frameCount, &flags, tid, &sessionId,
                    &notificationFrames,
                    cblk, buffers, &status);
            LOG_ALWAYS_FATAL_IF((record != 0) != (status == NO_ERROR));
            reply->writeInt64(frameCount);
            reply->writeInt32(flags);
            reply->writeInt32(sessionId);
            reply->writeInt64(notificationFrames);
            reply->writeInt32(status);
            reply->writeStrongBinder(record->asBinder());
            reply->writeStrongBinder(cblk->asBinder());
+2 −1
Original line number Diff line number Diff line
@@ -1344,6 +1344,7 @@ sp<IAudioRecord> AudioFlinger::openRecord(
        IAudioFlinger::track_flags_t *flags,
        pid_t tid,
        int *sessionId,
        size_t *notificationFrames,
        sp<IMemory>& cblk,
        sp<IMemory>& buffers,
        status_t *status)
@@ -1418,7 +1419,7 @@ sp<IAudioRecord> AudioFlinger::openRecord(

        // TODO: the uid should be passed in as a parameter to openRecord
        recordTrack = thread->createRecordTrack_l(client, sampleRate, format, channelMask,
                                                  frameCount, lSessionId,
                                                  frameCount, lSessionId, notificationFrames,
                                                  IPCThreadState::self()->getCallingUid(),
                                                  flags, tid, &lStatus);
        LOG_ALWAYS_FATAL_IF((lStatus == NO_ERROR) && (recordTrack == 0));
+1 −0
Original line number Diff line number Diff line
@@ -120,6 +120,7 @@ public:
                                IAudioFlinger::track_flags_t *flags,
                                pid_t tid,
                                int *sessionId,
                                size_t *notificationFrames,
                                sp<IMemory>& cblk,
                                sp<IMemory>& buffers,
                                status_t *status /*non-NULL*/);
Loading