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

Commit 1010d0af authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "C2AIDL: Provide rendered frame history" into main am: c08bf49d

parents 823b24c2 c08bf49d
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -96,6 +96,10 @@ void GraphicBufferAllocator::onBufferAttached(uint32_t generation) {
    mGraphicsTracker->onAttached(generation);
    mGraphicsTracker->onAttached(generation);
}
}


void GraphicBufferAllocator::pollForRenderedFrames(FrameEventHistoryDelta* delta) {
    mGraphicsTracker->pollForRenderedFrames(delta);
}

c2_status_t GraphicBufferAllocator::allocate(
c2_status_t GraphicBufferAllocator::allocate(
        uint32_t width, uint32_t height, ::android::PixelFormat format, uint64_t usage,
        uint32_t width, uint32_t height, ::android::PixelFormat format, uint64_t usage,
        AHardwareBuffer **buf, ::android::sp<::android::Fence> *fence) {
        AHardwareBuffer **buf, ::android::sp<::android::Fence> *fence) {
+13 −0
Original line number Original line Diff line number Diff line
@@ -1056,6 +1056,19 @@ c2_status_t GraphicsTracker::render(const C2ConstGraphicBlock& blk,
    return C2_OK;
    return C2_OK;
}
}


void GraphicsTracker::pollForRenderedFrames(FrameEventHistoryDelta* delta) {
    sp<IGraphicBufferProducer> igbp;
    {
        std::unique_lock<std::mutex> l(mLock);
        if (mBufferCache) {
            igbp = mBufferCache->mIgbp;
        }
    }
    if (igbp) {
        igbp->getFrameTimestamps(delta);
    }
}

void GraphicsTracker::onReleased(uint32_t generation) {
void GraphicsTracker::onReleased(uint32_t generation) {
    bool updateDequeue = false;
    bool updateDequeue = false;
    {
    {
+5 −1
Original line number Original line Diff line number Diff line
@@ -3417,7 +3417,11 @@ uint64_t Codec2Client::Component::configConsumerUsage(


void Codec2Client::Component::pollForRenderedFrames(FrameEventHistoryDelta* delta) {
void Codec2Client::Component::pollForRenderedFrames(FrameEventHistoryDelta* delta) {
    if (mAidlBase) {
    if (mAidlBase) {
        // TODO b/311348680
        std::shared_ptr<AidlGraphicBufferAllocator> gba =
                mGraphicBufferAllocators->current();
        if (gba) {
            gba->pollForRenderedFrames(delta);
        }
        return;
        return;
    }
    }
    mOutputBufferQueue->pollForRenderedFrames(delta);
    mOutputBufferQueue->pollForRenderedFrames(delta);
+5 −0
Original line number Original line Diff line number Diff line
@@ -84,6 +84,11 @@ public:
     */
     */
    void onBufferAttached(uint32_t generation);
    void onBufferAttached(uint32_t generation);


    /**
     * Retrieve frame event history from the crurrent surface if any.
     */
    void pollForRenderedFrames(::android::FrameEventHistoryDelta* delta);

    /**
    /**
     * Allocates a buffer.
     * Allocates a buffer.
     *
     *
+6 −0
Original line number Original line Diff line number Diff line
@@ -35,6 +35,7 @@ namespace aidl::android::hardware::media::c2::implementation {


using ::android::IGraphicBufferProducer;
using ::android::IGraphicBufferProducer;
using ::android::GraphicBuffer;
using ::android::GraphicBuffer;
using ::android::FrameEventHistoryDelta;
using ::android::Fence;
using ::android::Fence;
using ::android::PixelFormat;
using ::android::PixelFormat;
using ::android::sp;
using ::android::sp;
@@ -132,6 +133,11 @@ public:
                       const IGraphicBufferProducer::QueueBufferInput& input,
                       const IGraphicBufferProducer::QueueBufferInput& input,
                       IGraphicBufferProducer::QueueBufferOutput *output);
                       IGraphicBufferProducer::QueueBufferOutput *output);


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

    /**
    /**
     * Notifies when a Buffer is ready to allocate from Graphics.
     * Notifies when a Buffer is ready to allocate from Graphics.
     * If generation does not match to the current, notifications via the interface
     * If generation does not match to the current, notifications via the interface