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

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

Snap for 10500749 from d42a8ea9 to udc-qpr1-release

Change-Id: I37a6d859a6ad1b79890ec29e5f1d29048692d32c
parents dff56af0 d42a8ea9
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -6060,7 +6060,9 @@ status_t MediaCodec::onReleaseOutputBuffer(const sp<AMessage> &msg) {
            // presentation timestamp is used instead, which almost certainly occurs in the past,
            // since it's almost always a zero-based offset from the start of the stream. In these
            // scenarios, we expect the frame to be rendered with no delay.
            int64_t delayUs = noRenderTime ? 0 : renderTimeNs / 1000 - ALooper::GetNowUs();
            int64_t nowUs = ALooper::GetNowUs();
            int64_t renderTimeUs = renderTimeNs / 1000;
            int64_t delayUs = renderTimeUs < nowUs ? 0 : renderTimeUs - nowUs;
            delayUs += 100 * 1000; /* 100ms in microseconds */
            status_t err =
                    mMsgPollForRenderedBuffers->postUnique(/* token= */ mMsgPollForRenderedBuffers,
+4 −4
Original line number Diff line number Diff line
@@ -486,7 +486,7 @@ status_t Camera3OutputStream::returnBufferCheckedLocked(
            bufferDeferred = true;
        } else {
            nsecs_t presentTime = mSyncToDisplay ?
                    syncTimestampToDisplayLocked(captureTime, releaseFence->dup()) : captureTime;
                    syncTimestampToDisplayLocked(captureTime, releaseFence) : captureTime;

            setTransform(transform, true/*mayChangeMirror*/);
            res = native_window_set_buffers_timestamp(mConsumer.get(), presentTime);
@@ -1410,7 +1410,7 @@ void Camera3OutputStream::returnPrefetchedBuffersLocked() {
    }
}

nsecs_t Camera3OutputStream::syncTimestampToDisplayLocked(nsecs_t t, int releaseFence) {
nsecs_t Camera3OutputStream::syncTimestampToDisplayLocked(nsecs_t t, sp<Fence> releaseFence) {
    nsecs_t currentTime = systemTime();
    if (!mFixedFps) {
        mLastCaptureTime = t;
@@ -1458,8 +1458,8 @@ nsecs_t Camera3OutputStream::syncTimestampToDisplayLocked(nsecs_t t, int release
                mRefVsyncData = vsyncEventData;
                mReferenceCaptureTime = t;
                mReferenceArrivalTime = currentTime;
                if (releaseFence != -1) {
                    mReferenceFrameFence = new Fence(releaseFence);
                if (releaseFence->isValid()) {
                    mReferenceFrameFence = new Fence(releaseFence->dup());
                } else {
                    mFenceSignalOffset = 0;
                }
+1 −1
Original line number Diff line number Diff line
@@ -446,7 +446,7 @@ class Camera3OutputStream :
    static constexpr nsecs_t kTimelineThresholdNs = 1000000LL; // 1 millisecond
    static constexpr float kMaxIntervalRatioDeviation = 0.05f;
    static constexpr int kMaxTimelines = 2;
    nsecs_t syncTimestampToDisplayLocked(nsecs_t t, int releaseFence);
    nsecs_t syncTimestampToDisplayLocked(nsecs_t t, sp<Fence> releaseFence);

    // In case of fence being used
    sp<Fence> mReferenceFrameFence;