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

Commit d8d9a11d authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11772614 from 1bf5520d to 24Q3-release

Change-Id: Ic3860e42dfec3196cbe23acb77fdc4f39cf4cd59
parents 7ee7abbd 1bf5520d
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -323,7 +323,6 @@ static void usage() {
    printf("      -C{channels}      number of input channels\n");
    printf("      -D{deviceId}      input device ID\n");
    printf("      -F{0,1,2}         input format, 1=I16, 2=FLOAT\n");
    printf("      -g{gain}          recirculating loopback gain\n");
    printf("      -h{hangMillis}    occasionally hang in the callback\n");
    printf("      -P{inPerf}        set input AAUDIO_PERFORMANCE_MODE*\n");
    printf("          n for _NONE\n");
@@ -436,7 +435,6 @@ int main(int argc, const char **argv)
    int                   written                    = 0;

    int                   testMode                   = TEST_LATENCY;
    double                gain                       = 1.0;
    int                   hangTimeMillis             = 0;
    std::string           report;

@@ -468,9 +466,6 @@ int main(int argc, const char **argv)
                    case 'F':
                        requestedInputFormat = atoi(&arg[2]);
                        break;
                    case 'g':
                        gain = atof(&arg[2]);
                        break;
                    case 'h':
                        // Was there a number after the "-h"?
                        if (arg[2]) {
+4 −1
Original line number Diff line number Diff line
@@ -7145,11 +7145,14 @@ void DirectOutputThread::flushHw_l()
{
    PlaybackThread::flushHw_l();
    mOutput->flush();
    mHwPaused = false;
    mFlushPending = false;
    mTimestampVerifier.discontinuity(discontinuityForStandbyOrFlush());
    mTimestamp.clear();
    mMonotonicFrameCounter.onFlush();
    // We do not reset mHwPaused which is hidden from the Track client.
    // Note: the client track in Tracks.cpp and AudioTrack.cpp
    // has a FLUSHED state but the DirectOutputThread does not;
    // those tracks will continue to show isStopped().
}

int64_t DirectOutputThread::computeWaitTimeNs_l() const {
+20 −12
Original line number Diff line number Diff line
@@ -3706,19 +3706,18 @@ bool Camera3Device::RequestThread::threadLoop() {
        cleanUpFailedRequests(/*sendRequestError*/ true);
        // Check if any stream is abandoned.
        checkAndStopRepeatingRequest();
        // Inform waitUntilRequestProcessed thread of a failed request ID
        wakeupLatestRequest(/*failedRequestId*/true, latestRequestId);
        return true;
    } else if (res != OK) {
        cleanUpFailedRequests(/*sendRequestError*/ false);
        // Inform waitUntilRequestProcessed thread of a failed request ID
        wakeupLatestRequest(/*failedRequestId*/true, latestRequestId);
        return false;
    }

    // Inform waitUntilRequestProcessed thread of a new request ID
    {
        Mutex::Autolock al(mLatestRequestMutex);

        mLatestRequestId = latestRequestId;
        mLatestRequestSignal.signal();
    }
    wakeupLatestRequest(/*failedRequestId*/false, latestRequestId);

    // Submit a batch of requests to HAL.
    // Use flush lock only when submitting multilple requests in a batch.
@@ -4473,12 +4472,7 @@ void Camera3Device::RequestThread::cleanUpFailedRequests(bool sendRequestError)
                        hardware::camera2::ICameraDeviceCallbacks::ERROR_CAMERA_REQUEST,
                        captureRequest->mResultExtras);
            }
            {
                Mutex::Autolock al(mLatestRequestMutex);

                mLatestFailedRequestId = captureRequest->mResultExtras.requestId;
                mLatestRequestSignal.signal();
            }
            wakeupLatestRequest(/*failedRequestId*/true, captureRequest->mResultExtras.requestId);
        }

        // Remove yet-to-be submitted inflight request from inflightMap
@@ -5140,6 +5134,20 @@ status_t Camera3Device::RequestThread::setHalInterface(
    return OK;
}

void  Camera3Device::RequestThread::wakeupLatestRequest(
        bool latestRequestFailed,
        int32_t latestRequestId) {
    Mutex::Autolock al(mLatestRequestMutex);

    if (latestRequestFailed) {
        mLatestFailedRequestId = latestRequestId;
    } else {
        mLatestRequestId = latestRequestId;
    }
    mLatestRequestSignal.signal();
}


/**
 * PreparerThread inner class methods
 */
+5 −0
Original line number Diff line number Diff line
@@ -1038,6 +1038,11 @@ class Camera3Device :
            const sp<CaptureRequest> &request,
            const CameraMetadata& injectedSessionParams);

        /**
         * signal mLatestRequestmutex
         **/
        void wakeupLatestRequest(bool latestRequestFailed, int32_t latestRequestId);

      protected:

        virtual bool threadLoop();