media.c2 aidl: Implement IGBA/AHwB based blockpool
Implement IGBA/AHwB based BlockPool(C2IgbaBlockPool).
Also implement IGBA/AHwB based GraphicBlock transfer between HAL and the
client.
Test: m
Bug: 254050314
Change-Id: Ie27a36d071440d807adda00fe1fa9f78ec413834
diff --git a/media/codec2/hal/aidl/Component.cpp b/media/codec2/hal/aidl/Component.cpp
index 9c21a5b..2e0859b 100644
--- a/media/codec2/hal/aidl/Component.cpp
+++ b/media/codec2/hal/aidl/Component.cpp
@@ -113,26 +113,22 @@
WorkBundle workBundle;
std::shared_ptr<Component> strongComponent = mComponent.lock();
- // TODO
- // beginTransferBufferQueueBlocks(c2workItems, true);
if (!ToAidl(&workBundle, c2workItems, strongComponent ?
&strongComponent->mBufferPoolSender : nullptr)) {
LOG(ERROR) << "Component::Listener::onWorkDone_nb -- "
<< "received corrupted work items.";
- // TODO
- // endTransferBufferQueueBlocks(c2workItems, false, true);
return;
}
ScopedAStatus transStatus = listener->onWorkDone(workBundle);
if (!transStatus.isOk()) {
LOG(ERROR) << "Component::Listener::onWorkDone_nb -- "
<< "transaction failed.";
- // TODO
- // endTransferBufferQueueBlocks(c2workItems, false, true);
return;
}
- // TODO
- // endTransferBufferQueueBlocks(c2workItems, true, true);
+ // If output blocks are originally owned by the client(not by HAL),
+ // return the ownership to the client. (Since the blocks are
+ // transferred to the client here.)
+ ReturnOutputBlocksToClientIfNeeded(c2workItems);
}
}
@@ -210,15 +206,15 @@
}
}
- // TODO
- // beginTransferBufferQueueBlocks(c2flushedWorks, true);
if (c2res == C2_OK) {
if (!ToAidl(flushedWorkBundle, c2flushedWorks, &mBufferPoolSender)) {
c2res = C2_CORRUPTED;
}
}
- // TODO
- // endTransferBufferQueueBlocks(c2flushedWorks, true, true);
+ // If output blocks are originally owned by the client(not by HAL),
+ // return the ownership to the client. (Since the blocks are
+ // transferred to the client here.)
+ ReturnOutputBlocksToClientIfNeeded(c2flushedWorks);
if (c2res == C2_OK) {
return ScopedAStatus::ok();
}