diff options
| author | TreeHugger Robot <treehugger-gerrit@google.com> | 2018-10-06 03:18:24 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-10-06 03:18:24 +0000 |
| commit | bdba1773fc081ee55f99e7ea53ac2f69f37a8e5c (patch) | |
| tree | 5a14b4fd517b1a9cc0794f5581f246ec68da8b27 | |
| parent | 13ea39aead73803a898c712563c47038ef765999 (diff) | |
| parent | 38235ee93152ffd77b9a827b3a4765fd8c146a53 (diff) | |
Merge "Add observer to bufferpool clients"
| -rw-r--r-- | media/bufferpool/2.0/Android.bp | 2 | ||||
| -rw-r--r-- | media/bufferpool/2.0/IAccessor.hal | 10 | ||||
| -rw-r--r-- | media/bufferpool/2.0/IObserver.hal | 34 | ||||
| -rw-r--r-- | media/bufferpool/2.0/types.hal | 3 |
4 files changed, 48 insertions, 1 deletions
diff --git a/media/bufferpool/2.0/Android.bp b/media/bufferpool/2.0/Android.bp index 405990eb93..1f8bbdb888 100644 --- a/media/bufferpool/2.0/Android.bp +++ b/media/bufferpool/2.0/Android.bp @@ -11,12 +11,14 @@ hidl_interface { "IAccessor.hal", "IClientManager.hal", "IConnection.hal", + "IObserver.hal", ], interfaces: [ "android.hidl.base@1.0", ], types: [ "Buffer", + "BufferInvalidationMessage", "BufferStatus", "BufferStatusMessage", "ResultStatus", diff --git a/media/bufferpool/2.0/IAccessor.hal b/media/bufferpool/2.0/IAccessor.hal index ab7c02d458..66707fef73 100644 --- a/media/bufferpool/2.0/IAccessor.hal +++ b/media/bufferpool/2.0/IAccessor.hal @@ -17,6 +17,7 @@ package android.hardware.media.bufferpool@2.0; import IConnection; +import IObserver; /** * IAccessor creates IConnection which is used from IClientManager in order to * use functionality of the specified buffer pool. @@ -49,6 +50,13 @@ interface IAccessor { * made and kept private. Also part of transaction ID is a sender ID in * order to prevent fake transactions from other clients. This must be * verified with an FMQ message from a buffer pool. + + * @param observer The buffer pool event observer from the client. + * Observer is provided to ensure FMQ messages are processed even when + * client processes are idle. Buffer invalidation caused by + * reconfiguration does not call observer. Buffer invalidation caused + * by termination of pipeline call observer in order to ensure + * invalidation is done after pipeline completion. * * @return status The status of the call. * OK - A connection is made successfully. @@ -64,7 +72,7 @@ interface IAccessor { * @return fromFmqDesc FMQ descriptor. The descriptor is used to * receive buffer invalidation messages from the buffer pool. */ - connect() + connect(IObserver observer) generates (ResultStatus status, IConnection connection, int64_t connectionId, fmq_sync<BufferStatusMessage> toFmqDesc, diff --git a/media/bufferpool/2.0/IObserver.hal b/media/bufferpool/2.0/IObserver.hal new file mode 100644 index 0000000000..a998836912 --- /dev/null +++ b/media/bufferpool/2.0/IObserver.hal @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.media.bufferpool@2.0; + +/** + * IObserver listens on notifications from the buffer pool. On receiving + * notifications, FMQ messages from the specific buffer pool which are already + * in the FMQ are processed. + */ +interface IObserver { + + /** + * The specific buffer pool sent a message to the client. Calling this + * method from the buffer pool enforces a buffer pool client process the + * message. + * + * @param connectionId the connection Id of the specific buffer pool client + */ + oneway onMessage(int64_t connectionId); +}; diff --git a/media/bufferpool/2.0/types.hal b/media/bufferpool/2.0/types.hal index 456e4aabda..597e7b3722 100644 --- a/media/bufferpool/2.0/types.hal +++ b/media/bufferpool/2.0/types.hal @@ -65,6 +65,8 @@ enum BufferStatus : int32_t { TRANSFER_OK = 7, /** Buffer transaction failure. */ TRANSFER_ERROR = 8, + /** Buffer invalidation ack. */ + INVALIDATION_ACK = 9, }; /** @@ -98,6 +100,7 @@ struct BufferStatusMessage { * buffers as soon as possible upon receiving the message. */ struct BufferInvalidationMessage { + uint32_t messageId; /** * Buffers from fromBufferId to toBufferId must be invalidated. * fromBufferId is inclusive, but toBufferId is not inclusive. |
