C2AIDL: unblock allocate from C2IGBA on stop()/reelase()
alocate() can be blocked if consumer does not release buffer during
stop()/release(). unblock allocate() in the case.
Bug: 366059860
Test: presubmit
Change-Id: I856cb40d531984341156693258d3dd294c7a9ac9
diff --git a/media/codec2/hal/client/client.cpp b/media/codec2/hal/client/client.cpp
index 9ee9b9e..068ca6c 100644
--- a/media/codec2/hal/client/client.cpp
+++ b/media/codec2/hal/client/client.cpp
@@ -3170,6 +3170,11 @@
c2_status_t Codec2Client::Component::stop() {
if (mAidlBase) {
+ std::shared_ptr<AidlGraphicBufferAllocator> gba =
+ mGraphicBufferAllocators->current();
+ if (gba) {
+ gba->onRequestStop();
+ }
::ndk::ScopedAStatus transStatus = mAidlBase->stop();
return GetC2Status(transStatus, "stop");
}
@@ -3220,6 +3225,11 @@
}
}
if (mAidlBase) {
+ std::shared_ptr<AidlGraphicBufferAllocator> gba =
+ mGraphicBufferAllocators->current();
+ if (gba) {
+ gba->onRequestStop();
+ }
::ndk::ScopedAStatus transStatus = mAidlBase->release();
return GetC2Status(transStatus, "release");
}