From eec87d908115b8c8686af646e0227e475a9d0141 Mon Sep 17 00:00:00 2001 From: Sungtak Lee Date: Thu, 26 Oct 2023 10:26:07 +0000 Subject: [PATCH] media.c2 aidl: provide a waitable fd for blockpool creation Provide a waitable fd as a param for IComponent::createBlockPool() along with IGraphicBufferAllocator interface. This will remove one IPC call from HAL to client to get a waitable fd during blockpool creation. Test: m Bug: 254050314 Change-Id: I38d9bde987793e352299385fb141e484c758f89d --- .../android/hardware/media/c2/IComponent.aidl | 6 +++++- .../android/hardware/media/c2/IComponent.aidl | 16 +++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponent.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponent.aidl index c7d8a970cf..7d58340923 100644 --- a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponent.aidl +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponent.aidl @@ -49,8 +49,12 @@ interface IComponent { long blockPoolId; android.hardware.media.c2.IConfigurable configurable; } + parcelable C2AidlGbAllocator { + android.hardware.media.c2.IGraphicBufferAllocator igba; + ParcelFileDescriptor waitableFd; + } union BlockPoolAllocator { int allocatorId; - android.hardware.media.c2.IGraphicBufferAllocator igba; + android.hardware.media.c2.IComponent.C2AidlGbAllocator allocator; } } diff --git a/media/c2/aidl/android/hardware/media/c2/IComponent.aidl b/media/c2/aidl/android/hardware/media/c2/IComponent.aidl index a330d46c40..e96cae5622 100644 --- a/media/c2/aidl/android/hardware/media/c2/IComponent.aidl +++ b/media/c2/aidl/android/hardware/media/c2/IComponent.aidl @@ -21,6 +21,8 @@ import android.hardware.media.c2.IComponentInterface; import android.hardware.media.c2.IConfigurable; import android.hardware.media.c2.IGraphicBufferAllocator; import android.hardware.media.c2.WorkBundle; +import android.os.ParcelFileDescriptor; + /** * Interface for an AIDL Codec2 component. @@ -44,6 +46,18 @@ interface IComponent { IConfigurable configurable; } + /** + * C2AIDL allocator interface along with a waitable fd. + * + * The interface is used from a specific type of C2BlockPool to allocate + * graphic blocks. the waitable fd is used to create a specific type of + * C2Fence which can be used for waiting until to allocate is not blocked. + */ + parcelable C2AidlGbAllocator { + IGraphicBufferAllocator igba; + ParcelFileDescriptor waitableFd; + } + /** * Allocator for C2BlockPool. * @@ -52,7 +66,7 @@ interface IComponent { */ union BlockPoolAllocator { int allocatorId; - IGraphicBufferAllocator igba; + C2AidlGbAllocator allocator; } /**