Update android.hardware.media.bufferpool@2.0 HAL

Add buffer invalidation message for bufferpool@2.0

Bug: 112203066
Change-Id: Ia1fca213c7e663f619e2061dd0055228aecbf15c
This commit is contained in:
Sungtak Lee 2018-08-08 17:24:34 -07:00
parent 7c042c53b7
commit c40c77ef0d
2 changed files with 23 additions and 3 deletions

View file

@ -59,10 +59,14 @@ interface IAccessor {
* to get shared buffers from the buffer pool.
* @return connectionId Id of IConnection. The Id identifies
* sender and receiver in FMQ messages during buffer transfer.
* @return mqDesc FMQ descriptor. The descriptor can be used to
* send/receive FMQ messages.
* @return toFmqDesc FMQ descriptor. The descriptor is used to
* post buffer status messages.
* @return fromFmqDesc FMQ descriptor. The descriptor is used to
* receive buffer invalidation messages from the buffer pool.
*/
connect()
generates (ResultStatus status, IConnection connection,
int64_t connectionId, fmq_sync<BufferStatusMessage> mqDesc);
int64_t connectionId,
fmq_sync<BufferStatusMessage> toFmqDesc,
fmq_sync<BufferInvalidationMessage> fromFmqDesc);
};

View file

@ -91,3 +91,19 @@ struct BufferStatusMessage {
*/
int64_t timestampUs;
};
/*
* Buffer pool sends a buffer invalidation message to clients in order to
* ensure fast reclamation of the buffers. Clients must free the invalidated
* buffers as soon as possible upon receiving the message.
*/
struct BufferInvalidationMessage {
/**
* Buffers from fromBufferId to toBufferId must be invalidated.
* Both of fromBufferId and toBufferId are inclusive.
* If fromBufferId > toBufferID, wrap happens. In that case
* the wrap is based on UINT32_MAX.
*/
uint32_t fromBufferId;
uint32_t toBufferId;
};