Loading media/codec2/hal/client/GraphicBufferAllocator.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,10 @@ void GraphicBufferAllocator::onBufferAttached(uint32_t generation) { mGraphicsTracker->onAttached(generation); } void GraphicBufferAllocator::pollForRenderedFrames(FrameEventHistoryDelta* delta) { mGraphicsTracker->pollForRenderedFrames(delta); } c2_status_t GraphicBufferAllocator::allocate( uint32_t width, uint32_t height, ::android::PixelFormat format, uint64_t usage, AHardwareBuffer **buf, ::android::sp<::android::Fence> *fence) { Loading media/codec2/hal/client/GraphicsTracker.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -1056,6 +1056,19 @@ c2_status_t GraphicsTracker::render(const C2ConstGraphicBlock& blk, 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) { bool updateDequeue = false; { Loading media/codec2/hal/client/client.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -3417,7 +3417,11 @@ uint64_t Codec2Client::Component::configConsumerUsage( void Codec2Client::Component::pollForRenderedFrames(FrameEventHistoryDelta* delta) { if (mAidlBase) { // TODO b/311348680 std::shared_ptr<AidlGraphicBufferAllocator> gba = mGraphicBufferAllocators->current(); if (gba) { gba->pollForRenderedFrames(delta); } return; } mOutputBufferQueue->pollForRenderedFrames(delta); Loading media/codec2/hal/client/include/codec2/aidl/GraphicBufferAllocator.h +5 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,11 @@ public: */ void onBufferAttached(uint32_t generation); /** * Retrieve frame event history from the crurrent surface if any. */ void pollForRenderedFrames(::android::FrameEventHistoryDelta* delta); /** * Allocates a buffer. * Loading media/codec2/hal/client/include/codec2/aidl/GraphicsTracker.h +6 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ namespace aidl::android::hardware::media::c2::implementation { using ::android::IGraphicBufferProducer; using ::android::GraphicBuffer; using ::android::FrameEventHistoryDelta; using ::android::Fence; using ::android::PixelFormat; using ::android::sp; Loading Loading @@ -132,6 +133,11 @@ public: const IGraphicBufferProducer::QueueBufferInput& input, 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. * If generation does not match to the current, notifications via the interface Loading Loading
media/codec2/hal/client/GraphicBufferAllocator.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,10 @@ void GraphicBufferAllocator::onBufferAttached(uint32_t generation) { mGraphicsTracker->onAttached(generation); } void GraphicBufferAllocator::pollForRenderedFrames(FrameEventHistoryDelta* delta) { mGraphicsTracker->pollForRenderedFrames(delta); } c2_status_t GraphicBufferAllocator::allocate( uint32_t width, uint32_t height, ::android::PixelFormat format, uint64_t usage, AHardwareBuffer **buf, ::android::sp<::android::Fence> *fence) { Loading
media/codec2/hal/client/GraphicsTracker.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -1056,6 +1056,19 @@ c2_status_t GraphicsTracker::render(const C2ConstGraphicBlock& blk, 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) { bool updateDequeue = false; { Loading
media/codec2/hal/client/client.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -3417,7 +3417,11 @@ uint64_t Codec2Client::Component::configConsumerUsage( void Codec2Client::Component::pollForRenderedFrames(FrameEventHistoryDelta* delta) { if (mAidlBase) { // TODO b/311348680 std::shared_ptr<AidlGraphicBufferAllocator> gba = mGraphicBufferAllocators->current(); if (gba) { gba->pollForRenderedFrames(delta); } return; } mOutputBufferQueue->pollForRenderedFrames(delta); Loading
media/codec2/hal/client/include/codec2/aidl/GraphicBufferAllocator.h +5 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,11 @@ public: */ void onBufferAttached(uint32_t generation); /** * Retrieve frame event history from the crurrent surface if any. */ void pollForRenderedFrames(::android::FrameEventHistoryDelta* delta); /** * Allocates a buffer. * Loading
media/codec2/hal/client/include/codec2/aidl/GraphicsTracker.h +6 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ namespace aidl::android::hardware::media::c2::implementation { using ::android::IGraphicBufferProducer; using ::android::GraphicBuffer; using ::android::FrameEventHistoryDelta; using ::android::Fence; using ::android::PixelFormat; using ::android::sp; Loading Loading @@ -132,6 +133,11 @@ public: const IGraphicBufferProducer::QueueBufferInput& input, 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. * If generation does not match to the current, notifications via the interface Loading