bufferpool2: add sync() method and etc

Add sync() method to IConnection interface.
Add existing connection flag to return parcelable of
IClientManager::registerSender().
Use plain integer for returning fetch result status.

Bug: 254050250
Merged-In: Ifebd4b16e9b8c37e074e7126f39264a18fed5de8
Change-Id: Ifebd4b16e9b8c37e074e7126f39264a18fed5de8
This commit is contained in:
Sungtak Lee 2022-11-18 07:19:00 +00:00 committed by Wonsik Kim
parent 28b2c1ad37
commit 72b2b38c7f
6 changed files with 28 additions and 8 deletions

View file

@ -34,5 +34,10 @@
package android.hardware.media.bufferpool2;
@VintfStability
interface IClientManager {
long registerSender(in android.hardware.media.bufferpool2.IAccessor bufferPool);
android.hardware.media.bufferpool2.IClientManager.Registration registerSender(in android.hardware.media.bufferpool2.IAccessor bufferPool);
@VintfStability
parcelable Registration {
long connectionId;
boolean isNew = true;
}
}

View file

@ -35,12 +35,13 @@ package android.hardware.media.bufferpool2;
@VintfStability
interface IConnection {
android.hardware.media.bufferpool2.IConnection.FetchResult[] fetch(in android.hardware.media.bufferpool2.IConnection.FetchInfo[] fetchInfos);
void sync();
parcelable FetchInfo {
long transactionId;
int bufferId;
}
union FetchResult {
android.hardware.media.bufferpool2.Buffer buffer;
android.hardware.media.bufferpool2.ResultStatus failure;
int failure;
}
}

View file

@ -34,7 +34,6 @@
package android.hardware.media.bufferpool2;
@VintfStability
parcelable ResultStatus {
int resultStatus;
const int OK = 0;
const int NO_MEMORY = 1;
const int ALREADY_EXISTS = 2;

View file

@ -27,6 +27,16 @@ import android.hardware.media.bufferpool2.IAccessor;
*/
@VintfStability
interface IClientManager {
/**
* Result of registerSender.
*/
@VintfStability
parcelable Registration {
/** registered connection id */
long connectionId;
/** true when the connection is new */
boolean isNew = true;
}
/**
* Sets up a buffer receiving communication node for the specified
* buffer pool. A manager must create a IConnection to the buffer
@ -39,8 +49,7 @@ interface IClientManager {
* sent to that connection during transfers.
* @throws ServiceSpecificException with one of the following values:
* ResultStatus::NO_MEMORY - Memory allocation failure occurred.
* ResultStatus::ALREADY_EXISTS - A sender was registered already.
* ResultStatus::CRITICAL_ERROR - Other errors.
*/
long registerSender(in IAccessor bufferPool);
Registration registerSender(in IAccessor bufferPool);
}

View file

@ -49,7 +49,7 @@ interface IConnection {
* ResultStatus::NOT_FOUND - A buffer was not found due to invalidation.
* ResultStatus::CRITICAL_ERROR - Other errors.
*/
ResultStatus failure;
int failure;
}
/**
@ -70,4 +70,12 @@ interface IConnection {
* ResultStatus::CRITICAL_ERROR - Other errors.
*/
FetchResult[] fetch(in FetchInfo[] fetchInfos);
/**
* Enforce processing of unprocessed bufferpool messages.
*
* BufferPool implementation optimizes message processing by piggy-backing approach.
* This method can ensure pending bufferpool messages being processed timely.
*/
void sync();
}

View file

@ -23,6 +23,4 @@ parcelable ResultStatus {
const int ALREADY_EXISTS = 2;
const int NOT_FOUND = 3;
const int CRITICAL_ERROR = 4;
int resultStatus;
}