diff options
author | Sungtak Lee | 2018-01-25 17:07:40 -0600 |
---|---|---|
committer | Sungtak Lee | 2018-01-29 17:49:41 -0600 |
commit | 108a2fe68cf68b76207b540457ab4e8bd97f5a76 (patch) | |
tree | 2b4b156bcba06974fd422ce9308d5b2b694a2385 /media/bufferpool/1.0/IAccessor.hal | |
parent | 6327b866963d7bea96edf02332f9b24267b53e5f (diff) | |
download | platform-hardware-interfaces-108a2fe68cf68b76207b540457ab4e8bd97f5a76.tar.gz platform-hardware-interfaces-108a2fe68cf68b76207b540457ab4e8bd97f5a76.tar.xz platform-hardware-interfaces-108a2fe68cf68b76207b540457ab4e8bd97f5a76.zip |
android.hardware.media.bufferpool@1.0 HAL
BufferPool HAL for allocating, deallocating, and recycling buffers
on behalf of media.stagefright.
Bug: 72651719
Change-Id: I30bf630e41de2c8718aaaf8cbf5ee3f48f2859bc
Diffstat (limited to 'media/bufferpool/1.0/IAccessor.hal')
-rw-r--r-- | media/bufferpool/1.0/IAccessor.hal | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/media/bufferpool/1.0/IAccessor.hal b/media/bufferpool/1.0/IAccessor.hal new file mode 100644 index 00000000..5b5aec04 --- /dev/null +++ b/media/bufferpool/1.0/IAccessor.hal | |||
@@ -0,0 +1,68 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2018 The Android Open Source Project | ||
3 | * | ||
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | * you may not use this file except in compliance with the License. | ||
6 | * You may obtain a copy of the License at | ||
7 | * | ||
8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | * | ||
10 | * Unless required by applicable law or agreed to in writing, software | ||
11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | * See the License for the specific language governing permissions and | ||
14 | * limitations under the License. | ||
15 | */ | ||
16 | |||
17 | package android.hardware.media.bufferpool@1.0; | ||
18 | |||
19 | import IConnection; | ||
20 | /** | ||
21 | * IAccessor creates IConnection which is used from IClientManager in order to | ||
22 | * use functionality of the specified buffer pool. | ||
23 | */ | ||
24 | interface IAccessor { | ||
25 | |||
26 | /** | ||
27 | * Registers a new client and creates IConnection to the buffer pool for | ||
28 | * the client. IConnection and FMQ are used by IClientManager in order to | ||
29 | * communicate with the buffer pool. Via FMQ IClientManager sends | ||
30 | * BufferStatusMesage(s) to the buffer pool. | ||
31 | * | ||
32 | * FMQ is used to send buffer ownership status changes to a buffer pool | ||
33 | * from a buffer pool client. A buffer pool synchronizes FMQ messages when | ||
34 | * there is a hidl request from the clients. Every client has its own | ||
35 | * connection and FMQ to communicate with the buffer pool. So sending an | ||
36 | * FMQ message on behalf of other clients is not possible. | ||
37 | * | ||
38 | * FMQ messages are sent when a buffer is acquired or released. Also, FMQ | ||
39 | * messages are sent when a buffer is transferred from a client to another | ||
40 | * client. FMQ has its own ID from a buffer pool. A client is specified | ||
41 | * with the ID. | ||
42 | * | ||
43 | * To transfer a buffer, a sender must send an FMQ message. The message | ||
44 | * must include a receiver's ID and a transaction ID. A receiver must send | ||
45 | * the transaction ID to fetch a buffer from a buffer pool. Since the | ||
46 | * sender already registered the receiver via an FMQ message, The buffer | ||
47 | * pool must verify the receiver with the transaction ID. In order to | ||
48 | * prevent faking a receiver, a connection to a buffer pool from client is | ||
49 | * made and kept private. Also part of transaction ID is a sender ID in | ||
50 | * order to prevent fake transactions from other clients. This must be | ||
51 | * verified with an FMQ message from a buffer pool. | ||
52 | * | ||
53 | * @return status The status of the call. | ||
54 | * OK - A connection is made successfully. | ||
55 | * NO_MEMORY - Memory allocation failure occurred. | ||
56 | * ALREADY_EXISTS - A connection was already made. | ||
57 | * CRITICAL_ERROR - Other errors. | ||
58 | * @return connection The IConnection have interfaces | ||
59 | * to get shared buffers from the buffer pool. | ||
60 | * @return connectionId Id of IConnection. The Id identifies | ||
61 | * sender and receiver in FMQ messages during buffer transfer. | ||
62 | * @return mqDesc FMQ descriptor. The descriptor can be used to | ||
63 | * send/receive FMQ messages. | ||
64 | */ | ||
65 | connect() | ||
66 | generates (ResultStatus status, IConnection connection, | ||
67 | int64_t connectionId, fmq_sync<BufferStatusMessage> mqDesc); | ||
68 | }; | ||