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

Commit c2bbf6ec authored by Shubhi Saxena's avatar Shubhi Saxena Committed by Gerrit Code Review
Browse files

Merge "Revert "Codec2Client: use IProducerListener for Codec2 hidl1.2"" into main

parents 57a9016a c7c9a060
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2372,7 +2372,7 @@ void Codec2Client::Component::stopUsingOutputSurface(

void Codec2Client::Component::onBufferReleasedFromOutputSurface(
        uint32_t generation) {
    mOutputBufferQueue->onBufferReleased(generation);
    (void) generation;
}

c2_status_t Codec2Client::Component::connectToInputSurface(
+0 −4
Original line number Diff line number Diff line
@@ -65,10 +65,6 @@ struct OutputBufferQueue {
            const BnGraphicBufferProducer::QueueBufferInput& input,
            BnGraphicBufferProducer::QueueBufferOutput* output);

    // Nofify a buffer is released from the output surface. If HAL ver is 1.2
    // update the number of dequeueable/allocatable buffers.
    void onBufferReleased(uint32_t generation);

    // Retrieve frame event history from the output surface.
    void pollForRenderedFrames(FrameEventHistoryDelta* delta);

+6 −31
Original line number Diff line number Diff line
@@ -441,12 +441,10 @@ status_t OutputBufferQueue::outputBuffer(
            status = outputIgbp->queueBuffer(static_cast<int>(bqSlot),
                                         input, output);
            if (status == OK) {
                if (output->bufferReplaced) {
                syncVar->lock();
                syncVar->notifyQueuedLocked();
                syncVar->unlock();
            }
            }
        } else {
            status = outputIgbp->queueBuffer(static_cast<int>(bqSlot),
                                         input, output);
@@ -498,12 +496,10 @@ status_t OutputBufferQueue::outputBuffer(
        status = outputIgbp->queueBuffer(static_cast<int>(bqSlot),
                                                  input, output);
        if (status == OK) {
            if (output->bufferReplaced) {
            syncVar->lock();
            syncVar->notifyQueuedLocked();
            syncVar->unlock();
        }
        }
    } else {
        status = outputIgbp->queueBuffer(static_cast<int>(bqSlot),
                                                  input, output);
@@ -518,27 +514,6 @@ status_t OutputBufferQueue::outputBuffer(
    return OK;
}

void OutputBufferQueue::onBufferReleased(uint32_t generation) {
    std::shared_ptr<C2SurfaceSyncMemory> syncMem;
    mMutex.lock();
    if (mStopped) {
        return;
    }
    sp<IGraphicBufferProducer> outputIgbp = mIgbp;
    uint32_t outputGeneration = mGeneration;
    syncMem = mSyncMem;
    mMutex.unlock();

    if (outputIgbp && generation == outputGeneration) {
        auto syncVar = syncMem ? syncMem->mem() : nullptr;
        if (syncVar) {
            syncVar->lock();
            syncVar->notifyQueuedLocked();
            syncVar->unlock();
        }
    }
}

void OutputBufferQueue::pollForRenderedFrames(FrameEventHistoryDelta* delta) {
    if (mIgbp) {
        mIgbp->getFrameTimestamps(delta);