media.bufferpool2: Support receiver side initated buffer transfer am: ae00908369 am: 00073e477d

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2912757

Change-Id: I154f4a5f473c7ea6d422cc70a1b7a3534309c9b2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Sungtak Lee
2024-01-19 19:05:40 +00:00
committed by Automerger Merge Worker
4 changed files with 33 additions and 1 deletions

View File

@@ -35,6 +35,7 @@ package android.hardware.media.bufferpool2;
@VintfStability
interface IClientManager {
android.hardware.media.bufferpool2.IClientManager.Registration registerSender(in android.hardware.media.bufferpool2.IAccessor bufferPool);
android.hardware.media.bufferpool2.IClientManager.Registration registerPassiveSender(in android.hardware.media.bufferpool2.IAccessor bufferPool);
@VintfStability
parcelable Registration {
long connectionId;

View File

@@ -40,7 +40,8 @@ interface IClientManager {
/**
* Sets up a buffer receiving communication node for the specified
* buffer pool. A manager must create a IConnection to the buffer
* pool if it does not already have a connection.
* pool if it does not already have a connection. To transfer buffers
* using the interface, the sender must initiates transfer.
*
* @param bufferPool a buffer pool which is specified with the IAccessor.
* The specified buffer pool is the owner of received buffers.
@@ -52,4 +53,21 @@ interface IClientManager {
* ResultStatus::CRITICAL_ERROR - Other errors.
*/
Registration registerSender(in IAccessor bufferPool);
/**
* Sets up a buffer receiving communication node for the specified
* buffer pool. A manager must create a IConnection to the buffer
* pool if it does not already have a connection. To transfer buffers
* using the interface, the receiver must initiates transfer(on demand).
*
* @param bufferPool a buffer pool which is specified with the IAccessor.
* The specified buffer pool is the owner of received buffers.
* @return the Id of the communication node to the buffer pool.
* This id is used in FMQ to notify IAccessor that a buffer has been
* sent to that connection during transfers.
* @throws ServiceSpecificException with one of the following values:
* ResultStatus::NO_MEMORY - Memory allocation failure occurred.
* ResultStatus::CRITICAL_ERROR - Other errors.
*/
Registration registerPassiveSender(in IAccessor bufferPool);
}

View File

@@ -422,6 +422,14 @@ void ClientManager::Impl::cleanUp(bool clearCache) {
return ::ndk::ScopedAStatus::ok();
}
::ndk::ScopedAStatus ClientManager::registerPassiveSender(
const std::shared_ptr<IAccessor>& in_bufferPool, Registration* _aidl_return) {
// TODO
(void) in_bufferPool;
(void) _aidl_return;
return ::ndk::ScopedAStatus::fromServiceSpecificError(ResultStatus::NOT_FOUND);
}
// Methods for local use.
std::shared_ptr<ClientManager> ClientManager::sInstance;
std::mutex ClientManager::sInstanceLock;

View File

@@ -34,6 +34,11 @@ struct ClientManager : public BnClientManager {
::aidl::android::hardware::media::bufferpool2::IClientManager::Registration* _aidl_return)
override;
::ndk::ScopedAStatus registerPassiveSender(
const std::shared_ptr<IAccessor>& in_bufferPool,
::aidl::android::hardware::media::bufferpool2::IClientManager::Registration* _aidl_return)
override;
/** Gets an instance. */
static std::shared_ptr<ClientManager> getInstance();