summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--media/1.0/types.hal27
-rw-r--r--media/omx/1.0/Android.bp16
-rw-r--r--media/omx/1.0/IOmx.hal30
-rw-r--r--media/omx/1.0/IOmxBufferProducer.hal693
-rw-r--r--media/omx/1.0/IOmxNode.hal161
-rw-r--r--media/omx/1.0/IOmxProducerListener.hal27
-rw-r--r--media/omx/1.0/types.hal21
7 files changed, 870 insertions, 105 deletions
diff --git a/media/1.0/types.hal b/media/1.0/types.hal
index 89b7fa21..1f9c4dc4 100644
--- a/media/1.0/types.hal
+++ b/media/1.0/types.hal
@@ -40,7 +40,9 @@ struct AnwBufferAttributes {
40 uint32_t stride; 40 uint32_t stride;
41 PixelFormat format; 41 PixelFormat format;
42 uint32_t usage; // TODO: convert to an enum 42 uint32_t usage; // TODO: convert to an enum
43 uint32_t generationNumber;
43 uint64_t layerCount; 44 uint64_t layerCount;
45 uint64_t id;
44}; 46};
45 47
46/** 48/**
@@ -52,25 +54,18 @@ struct AnwBuffer {
52}; 54};
53 55
54/** 56/**
55 * Ref: frameworks/native/include/binder/IMemory.h 57 * Ref: frameworks/native/include/android/rect.h
56 * Ref: frameworks/native/libs/binder/IMemory.cpp 58 * Ref: frameworks/native/include/ui/Rect.h
57 */ 59 */
58 60struct Rect {
59/** 61 int32_t left;
60 * This struct contains attributes for a shared memory buffer that can be put 62 int32_t top;
61 * into a union. 63 int32_t right;
62 */ 64 int32_t bottom;
63struct SharedMemoryAttributes {
64 uint32_t size;
65 uint32_t flags; // TODO: convert to an enum
66 uint32_t offset;
67}; 65};
68 66
69/** 67/**
70 * A SharedMemory is simply SharedMemoryAttributes plus a native handle. 68 * Ref: frameworks/native/include/ui/Region.h
71 */ 69 */
72struct SharedMemory { 70typedef vec<Rect> Region;
73 handle nativeHandle;
74 SharedMemoryAttributes attr;
75};
76 71
diff --git a/media/omx/1.0/Android.bp b/media/omx/1.0/Android.bp
index 657c23b2..f79aabb2 100644
--- a/media/omx/1.0/Android.bp
+++ b/media/omx/1.0/Android.bp
@@ -8,17 +8,21 @@ genrule {
8 "types.hal", 8 "types.hal",
9 "IGraphicBufferSource.hal", 9 "IGraphicBufferSource.hal",
10 "IOmx.hal", 10 "IOmx.hal",
11 "IOmxBufferProducer.hal",
11 "IOmxBufferSource.hal", 12 "IOmxBufferSource.hal",
12 "IOmxNode.hal", 13 "IOmxNode.hal",
13 "IOmxObserver.hal", 14 "IOmxObserver.hal",
15 "IOmxProducerListener.hal",
14 ], 16 ],
15 out: [ 17 out: [
16 "android/hardware/media/omx/1.0/types.cpp", 18 "android/hardware/media/omx/1.0/types.cpp",
17 "android/hardware/media/omx/1.0/GraphicBufferSourceAll.cpp", 19 "android/hardware/media/omx/1.0/GraphicBufferSourceAll.cpp",
18 "android/hardware/media/omx/1.0/OmxAll.cpp", 20 "android/hardware/media/omx/1.0/OmxAll.cpp",
21 "android/hardware/media/omx/1.0/OmxBufferProducerAll.cpp",
19 "android/hardware/media/omx/1.0/OmxBufferSourceAll.cpp", 22 "android/hardware/media/omx/1.0/OmxBufferSourceAll.cpp",
20 "android/hardware/media/omx/1.0/OmxNodeAll.cpp", 23 "android/hardware/media/omx/1.0/OmxNodeAll.cpp",
21 "android/hardware/media/omx/1.0/OmxObserverAll.cpp", 24 "android/hardware/media/omx/1.0/OmxObserverAll.cpp",
25 "android/hardware/media/omx/1.0/OmxProducerListenerAll.cpp",
22 ], 26 ],
23} 27}
24 28
@@ -30,9 +34,11 @@ genrule {
30 "types.hal", 34 "types.hal",
31 "IGraphicBufferSource.hal", 35 "IGraphicBufferSource.hal",
32 "IOmx.hal", 36 "IOmx.hal",
37 "IOmxBufferProducer.hal",
33 "IOmxBufferSource.hal", 38 "IOmxBufferSource.hal",
34 "IOmxNode.hal", 39 "IOmxNode.hal",
35 "IOmxObserver.hal", 40 "IOmxObserver.hal",
41 "IOmxProducerListener.hal",
36 ], 42 ],
37 out: [ 43 out: [
38 "android/hardware/media/omx/1.0/types.h", 44 "android/hardware/media/omx/1.0/types.h",
@@ -46,6 +52,11 @@ genrule {
46 "android/hardware/media/omx/1.0/BnHwOmx.h", 52 "android/hardware/media/omx/1.0/BnHwOmx.h",
47 "android/hardware/media/omx/1.0/BpHwOmx.h", 53 "android/hardware/media/omx/1.0/BpHwOmx.h",
48 "android/hardware/media/omx/1.0/BsOmx.h", 54 "android/hardware/media/omx/1.0/BsOmx.h",
55 "android/hardware/media/omx/1.0/IOmxBufferProducer.h",
56 "android/hardware/media/omx/1.0/IHwOmxBufferProducer.h",
57 "android/hardware/media/omx/1.0/BnOmxBufferProducer.h",
58 "android/hardware/media/omx/1.0/BpOmxBufferProducer.h",
59 "android/hardware/media/omx/1.0/BsOmxBufferProducer.h",
49 "android/hardware/media/omx/1.0/IOmxBufferSource.h", 60 "android/hardware/media/omx/1.0/IOmxBufferSource.h",
50 "android/hardware/media/omx/1.0/IHwOmxBufferSource.h", 61 "android/hardware/media/omx/1.0/IHwOmxBufferSource.h",
51 "android/hardware/media/omx/1.0/BnHwOmxBufferSource.h", 62 "android/hardware/media/omx/1.0/BnHwOmxBufferSource.h",
@@ -61,6 +72,11 @@ genrule {
61 "android/hardware/media/omx/1.0/BnHwOmxObserver.h", 72 "android/hardware/media/omx/1.0/BnHwOmxObserver.h",
62 "android/hardware/media/omx/1.0/BpHwOmxObserver.h", 73 "android/hardware/media/omx/1.0/BpHwOmxObserver.h",
63 "android/hardware/media/omx/1.0/BsOmxObserver.h", 74 "android/hardware/media/omx/1.0/BsOmxObserver.h",
75 "android/hardware/media/omx/1.0/IOmxProducerListener.h",
76 "android/hardware/media/omx/1.0/IHwOmxProducerListener.h",
77 "android/hardware/media/omx/1.0/BnOmxProducerListener.h",
78 "android/hardware/media/omx/1.0/BpOmxProducerListener.h",
79 "android/hardware/media/omx/1.0/BsOmxProducerListener.h",
64 ], 80 ],
65} 81}
66 82
diff --git a/media/omx/1.0/IOmx.hal b/media/omx/1.0/IOmx.hal
index e9f0b763..acb1aaec 100644
--- a/media/omx/1.0/IOmx.hal
+++ b/media/omx/1.0/IOmx.hal
@@ -20,6 +20,8 @@ import android.hardware.media@1.0::types;
20 20
21import IOmxNode; 21import IOmxNode;
22import IOmxObserver; 22import IOmxObserver;
23import IOmxBufferProducer;
24import IGraphicBufferSource;
23 25
24/** 26/**
25 * Ref: frameworks/av/include/media/IOMX.h: IOMX 27 * Ref: frameworks/av/include/media/IOMX.h: IOMX
@@ -32,15 +34,15 @@ interface IOmx {
32 * Information for an IOmxNode component. 34 * Information for an IOmxNode component.
33 */ 35 */
34 struct ComponentInfo { 36 struct ComponentInfo {
35 string mName; //< Name of the component. 37 string mName;
36 vec<string> mRoles; //< Roles of the component. 38 vec<string> mRoles;
37 }; 39 };
38 40
39 /** 41 /**
40 * List available components. 42 * List available components.
41 * 43 *
42 * @param[out] status will be the status of the call. 44 * @param[out] status The status of the call.
43 * @param[out] nodeList will be a list of ComponentInfo. 45 * @param[out] nodeList The list of ComponentInfo.
44 */ 46 */
45 listNodes( 47 listNodes(
46 ) generates ( 48 ) generates (
@@ -51,11 +53,11 @@ interface IOmx {
51 /** 53 /**
52 * Allocate an IOmxNode instance with the specified component name. 54 * Allocate an IOmxNode instance with the specified component name.
53 * 55 *
54 * @param[in] name is the name of the component to create. 56 * @param[in] name The name of the component to create.
55 * @param[in] observer is an observer object that will receive messages from 57 * @param[in] observer An observer object that will receive messages from
56 * the created instance. 58 * the created instance.
57 * @param[out] status will be the status of the call. 59 * @param[out] status The status of the call.
58 * @param[out] omxNode will be the allocated instance of IOmxNode. 60 * @param[out] omxNode The allocated instance of IOmxNode.
59 */ 61 */
60 allocateNode( 62 allocateNode(
61 string name, 63 string name,
@@ -65,5 +67,17 @@ interface IOmx {
65 IOmxNode omxNode 67 IOmxNode omxNode
66 ); 68 );
67 69
70 /**
71 * Create an input surface for recording.
72 *
73 * @param[out] producer The associated producer end of the buffer queue.
74 * @param[out] source The associated `IGraphicBufferSource`.
75 */
76 createInputSurface(
77 ) generates (
78 Status status,
79 IOmxBufferProducer producer,
80 IGraphicBufferSource source
81 );
68}; 82};
69 83
diff --git a/media/omx/1.0/IOmxBufferProducer.hal b/media/omx/1.0/IOmxBufferProducer.hal
new file mode 100644
index 00000000..12b5d149
--- /dev/null
+++ b/media/omx/1.0/IOmxBufferProducer.hal
@@ -0,0 +1,693 @@
1/*
2 * Copyright (C) 2016 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
17package android.hardware.media.omx@1.0;
18
19import android.hardware.graphics.common@1.0::Dataspace;
20import android.hardware.graphics.common@1.0::PixelFormat;
21
22import android.hardware.media@1.0::types;
23import IOmxProducerListener;
24
25/**
26 * Ref: frameworks/native/include/gui/IGraphicBufferProducer.h:
27 * IGraphicBufferProducer
28 * This is a wrapper/wrapped HAL interface for the actual binder interface.
29 */
30interface IOmxBufferProducer {
31
32 /**
33 * Ref: frameworks/native/include/ui/FenceTime.h: FenceTime::Snapshot
34 *
35 * An atomic snapshot of the FenceTime that is flattenable.
36 */
37 struct FenceTimeSnapshot {
38 enum State : int32_t {
39 EMPTY,
40 FENCE,
41 SIGNAL_TIME,
42 };
43 State state;
44 Fence fence;
45 int64_t signalTimeNs;
46 };
47
48 /**
49 * Ref: frameworks/native/include/gui/FrameTimestamp.h: FrameEventsDelta
50 *
51 * A single frame update from the consumer to producer that can be sent
52 * through a HIDL interface. Although this may be sent multiple times for
53 * the same frame as new timestamps are set, Fences only need to be sent
54 * once.
55 */
56 struct FrameEventsDelta {
57 uint32_t index;
58 uint64_t frameNumber;
59 bool addPostCompositeCalled;
60 bool addRetireCalled;
61 bool addReleaseCalled;
62 int64_t postedTimeNs;
63 int64_t requestedPresentTimeNs;
64 int64_t latchTimeNs;
65 int64_t firstRefreshStartTimeNs;
66 int64_t lastRefreshStartTimeNs;
67 int64_t dequeueReadyTime;
68 FenceTimeSnapshot gpuCompositionDoneFence;
69 FenceTimeSnapshot displayPresentFence;
70 FenceTimeSnapshot displayRetireFence;
71 FenceTimeSnapshot releaseFence;
72 };
73
74 /**
75 * Ref: frameworks/native/include/gui/FrameTimestamp.h: FrameEventHistoryDelta
76 *
77 * A collection of updates from consumer to producer that can be sent
78 * through a HIDL interface.
79 */
80 typedef vec<FrameEventsDelta> FrameEventHistoryDelta;
81
82 /**
83 * Modes for disconnection.
84 */
85 enum DisconnectMode : int32_t {
86 /** Disconnect only the specified API. */
87 API,
88 /** Disconnect any API originally connected from the process calling
89 * disconnect. */
90 ALL_LOCAL
91 };
92
93 struct QueueBufferInput {
94 /** A monotonically increasing value in nanoseconds. */
95 int64_t timestamp;
96 /** Whether the timestamp was synthesized at queue time. */
97 int32_t isAutoTimestamp;
98 /** Description of the contents, interpretation depends on format. */
99 Dataspace dataSpace;
100 /** A crop rectangle that's used as a hint to the consumer. */
101 Rect crop;
102 /** A set of flags from NATIVE_WINDOW_SCALING_* in <window.h>. */
103 int32_t scalingMode;
104 /** A set of flags from NATIVE_WINDOW_TRANSFORM_* in <window.h>. */
105 uint32_t transform;
106 /** The sticky transform set in Surface (only used by the LEGACY camera
107 * mode). */
108 uint32_t stickyTransform;
109 /** A fence that the consumer must wait on before reading the buffer;
110 * set this to Fence::NO_FENCE if the buffer is ready immediately. */
111 Fence fence;
112 Region surfaceDamage;
113 /** Whether or not the latest frame timestamps should be retrieved from
114 * the consumer. */
115 bool getFrameTimestamps;
116 };
117
118 struct QueueBufferOutput {
119 uint32_t width;
120 uint32_t height;
121 uint32_t transformHint;
122 uint32_t numPendingBuffers;
123 uint64_t nextFrameNumber;
124 FrameEventHistoryDelta frameTimestamps;
125 };
126
127 /**
128 * requestBuffer requests a new buffer for the given index. The server (i.e.
129 * the IOmxBufferProducer implementation) assigns the newly created
130 * buffer to the given slot index, and the client is expected to mirror the
131 * slot->buffer mapping so that it's not necessary to transfer an
132 * AnwBuffer for every dequeue operation.
133 *
134 * The slot must be in the range of [0, NUM_BUFFER_SLOTS).
135 *
136 * Return of a value other than NO_ERROR means an error has occurred:
137 * * NO_INIT - the buffer queue has been abandoned or the producer is not
138 * connected.
139 * * BAD_VALUE - one of the two conditions occurred:
140 * * slot was out of range (see above)
141 * * buffer specified by the slot is not dequeued
142 */
143 requestBuffer(
144 int32_t slot
145 ) generates (
146 Status status,
147 AnwBuffer buffer
148 );
149
150 /**
151 * setMaxDequeuedBufferCount sets the maximum number of buffers that can be
152 * dequeued by the producer at one time. If this method succeeds, any new
153 * buffer slots will be both unallocated and owned by the BufferQueue object
154 * (i.e. they are not owned by the producer or consumer). Calling this may
155 * also cause some buffer slots to be emptied. If the caller is caching the
156 * contents of the buffer slots, it should empty that cache after calling
157 * this method.
158 *
159 * This function should not be called with a value of maxDequeuedBuffers
160 * that is less than the number of currently dequeued buffer slots. Doing so
161 * will result in a BAD_VALUE error.
162 *
163 * The buffer count should be at least 1 (inclusive), but at most
164 * (NUM_BUFFER_SLOTS - the minimum undequeued buffer count) (exclusive). The
165 * minimum undequeued buffer count can be obtained by calling
166 * query(NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS).
167 *
168 * Return of a value other than NO_ERROR means an error has occurred:
169 * * NO_INIT - the buffer queue has been abandoned.
170 * * BAD_VALUE - one of the below conditions occurred:
171 * * bufferCount was out of range (see above).
172 * * client would have more than the requested number of dequeued
173 * buffers after this call.
174 * * this call would cause the maxBufferCount value to be exceeded.
175 * * failure to adjust the number of available slots.
176 */
177 setMaxDequeuedBufferCount(
178 int32_t maxDequeuedBuffers
179 ) generates (
180 Status status
181 );
182
183 /**
184 * Set the async flag if the producer intends to asynchronously queue
185 * buffers without blocking. Typically this is used for triple-buffering
186 * and/or when the swap interval is set to zero.
187 *
188 * Enabling async mode will internally allocate an additional buffer to
189 * allow for the asynchronous behavior. If it is not enabled queue/dequeue
190 * calls may block.
191 *
192 * Return of a value other than NO_ERROR means an error has occurred:
193 * * NO_INIT - the buffer queue has been abandoned.
194 * * BAD_VALUE - one of the following has occurred:
195 * * this call would cause the maxBufferCount value to be
196 * exceeded
197 * * failure to adjust the number of available slots.
198 */
199 setAsyncMode(
200 bool async
201 ) generates (
202 Status status
203 );
204
205 /**
206 * dequeueBuffer requests a new buffer slot for the client to use. Ownership
207 * of the slot is transfered to the client, meaning that the server will not
208 * use the contents of the buffer associated with that slot.
209 *
210 * The slot index returned may or may not contain a buffer (client-side).
211 * If the slot is empty the client should call requestBuffer to assign a new
212 * buffer to that slot.
213 *
214 * Once the client is done filling this buffer, it is expected to transfer
215 * buffer ownership back to the server with either cancelBuffer on
216 * the dequeued slot or to fill in the contents of its associated buffer
217 * contents and call queueBuffer.
218 *
219 * If dequeueBuffer returns the BUFFER_NEEDS_REALLOCATION flag, the client is
220 * expected to call requestBuffer immediately.
221 *
222 * If dequeueBuffer returns the RELEASE_ALL_BUFFERS flag, the client is
223 * expected to release all of the mirrored slot->buffer mappings.
224 *
225 * The fence parameter will be updated to hold the fence associated with
226 * the buffer. The contents of the buffer must not be overwritten until the
227 * fence signals. If the fence is Fence::NO_FENCE, the buffer may be written
228 * immediately.
229 *
230 * The width and height parameters must be no greater than the minimum of
231 * GL_MAX_VIEWPORT_DIMS and GL_MAX_TEXTURE_SIZE (see: glGetIntegerv).
232 * An error due to invalid dimensions might not be reported until
233 * updateTexImage() is called. If width and height are both zero, the
234 * default values specified by setDefaultBufferSize() are used instead.
235 *
236 * If the format is 0, the default format will be used.
237 *
238 * The usage argument specifies gralloc buffer usage flags. The values
239 * are enumerated in <gralloc.h>, e.g. GRALLOC_USAGE_HW_RENDER. These
240 * will be merged with the usage flags specified by
241 * IGraphicBufferConsumer::setConsumerUsageBits.
242 *
243 * This call will block until a buffer is available to be dequeued. If
244 * both the producer and consumer are controlled by the app, then this call
245 * can never block and will return WOULD_BLOCK if no buffer is available.
246 *
247 * A non-negative value with flags set (see above) will be returned upon
248 * success as status.
249 *
250 * Return of a negative means an error has occurred:
251 * * NO_INIT - the buffer queue has been abandoned or the producer is not
252 * connected.
253 * * BAD_VALUE - both in async mode and buffer count was less than the
254 * max numbers of buffers that can be allocated at once.
255 * * INVALID_OPERATION - cannot attach the buffer because it would cause
256 * too many buffers to be dequeued, either because
257 * the producer already has a single buffer dequeued
258 * and did not set a buffer count, or because a
259 * buffer count was set and this call would cause
260 * it to be exceeded.
261 * * WOULD_BLOCK - no buffer is currently available, and blocking is disabled
262 * since both the producer/consumer are controlled by app
263 * * NO_MEMORY - out of memory, cannot allocate the graphics buffer.
264 * * TIMED_OUT - the timeout set by setDequeueTimeout was exceeded while
265 * waiting for a buffer to become available.
266 *
267 * All other negative values are an unknown error returned downstream
268 * from the graphics allocator (typically errno).
269 */
270 dequeueBuffer(
271 uint32_t width,
272 uint32_t height,
273 PixelFormat format,
274 uint32_t usage,
275 bool getFrameTimestamps
276 ) generates (
277 Status status,
278 int32_t slot,
279 Fence fence,
280 FrameEventHistoryDelta outTimestamps
281 );
282
283 /**
284 * detachBuffer attempts to remove all ownership of the buffer in the given
285 * slot from the buffer queue. If this call succeeds, the slot will be
286 * freed, and there will be no way to obtain the buffer from this interface.
287 * The freed slot will remain unallocated until either it is selected to
288 * hold a freshly allocated buffer in dequeueBuffer or a buffer is attached
289 * to the slot. The buffer must have already been dequeued, and the caller
290 * must already possesses the sp<AnwBuffer> (i.e., must have called
291 * requestBuffer).
292 *
293 * Return of a value other than NO_ERROR means an error has occurred:
294 * * NO_INIT - the buffer queue has been abandoned or the producer is not
295 * connected.
296 * * BAD_VALUE - the given slot number is invalid, either because it is
297 * out of the range [0, NUM_BUFFER_SLOTS), or because the slot
298 * it refers to is not currently dequeued and requested.
299 */
300 detachBuffer(
301 int32_t slot
302 ) generates (
303 Status status
304 );
305
306 /**
307 * detachNextBuffer is equivalent to calling dequeueBuffer, requestBuffer,
308 * and detachBuffer in sequence, except for two things:
309 *
310 * 1) It is unnecessary to know the dimensions, format, or usage of the
311 * next buffer.
312 * 2) It will not block, since if it cannot find an appropriate buffer to
313 * return, it will return an error instead.
314 *
315 * Only slots that are free but still contain an AnwBuffer will be
316 * considered, and the oldest of those will be returned. buffer is
317 * equivalent to buffer from the requestBuffer call, and fence is
318 * equivalent to fence from the dequeueBuffer call.
319 *
320 * Return of a value other than NO_ERROR means an error has occurred:
321 * * NO_INIT - the buffer queue has been abandoned or the producer is not
322 * connected.
323 * * BAD_VALUE - either outBuffer or outFence were NULL.
324 * * NO_MEMORY - no slots were found that were both free and contained a
325 * AnwBuffer.
326 */
327 detachNextBuffer(
328 ) generates (
329 Status status,
330 AnwBuffer buffer,
331 Fence fence
332 );
333
334 /**
335 * attachBuffer attempts to transfer ownership of a buffer to the buffer
336 * queue. If this call succeeds, it will be as if this buffer was dequeued
337 * from the returned slot number. As such, this call will fail if attaching
338 * this buffer would cause too many buffers to be simultaneously dequeued.
339 *
340 * If attachBuffer returns the RELEASE_ALL_BUFFERS flag, the caller is
341 * expected to release all of the mirrored slot->buffer mappings.
342 *
343 * A non-negative value with flags set (see above) will be returned upon
344 * success.
345 *
346 * Return of a negative value means an error has occurred:
347 * * NO_INIT - the buffer queue has been abandoned or the producer is not
348 * connected.
349 * * BAD_VALUE - outSlot or buffer were NULL, invalid combination of
350 * async mode and buffer count override, or the generation
351 * number of the buffer did not match the buffer queue.
352 * * INVALID_OPERATION - cannot attach the buffer because it would cause
353 * too many buffers to be dequeued, either because
354 * the producer already has a single buffer dequeued
355 * and did not set a buffer count, or because a
356 * buffer count was set and this call would cause
357 * it to be exceeded.
358 * * WOULD_BLOCK - no buffer slot is currently available, and blocking is
359 * disabled since both the producer/consumer are
360 * controlled by the app.
361 * * TIMED_OUT - the timeout set by setDequeueTimeout was exceeded while
362 * waiting for a slot to become available.
363 */
364 attachBuffer(
365 AnwBuffer buffer
366 ) generates (
367 Status status,
368 int32_t slot
369 );
370
371 /**
372 * queueBuffer indicates that the client has finished filling in the
373 * contents of the buffer associated with slot and transfers ownership of
374 * that slot back to the server.
375 *
376 * It is not valid to call queueBuffer on a slot that is not owned
377 * by the client or one for which a buffer associated via requestBuffer
378 * (an attempt to do so will fail with a return value of BAD_VALUE).
379 *
380 * In addition, the input must be described by the client (as documented
381 * below). Any other properties (zero point, etc)
382 * are client-dependent, and should be documented by the client.
383 *
384 * The slot must be in the range of [0, NUM_BUFFER_SLOTS).
385 *
386 * Upon success, the output will be filled with meaningful values
387 * (refer to the documentation below).
388 *
389 * Return of a value other than NO_ERROR means an error has occurred:
390 * * NO_INIT - the buffer queue has been abandoned or the producer is not
391 * connected.
392 * * BAD_VALUE - one of the below conditions occurred:
393 * * fence was NULL
394 * * scaling mode was unknown
395 * * both in async mode and buffer count was less than the
396 * max numbers of buffers that can be allocated at once
397 * * slot index was out of range (see above).
398 * * the slot was not in the dequeued state
399 * * the slot was enqueued without requesting a buffer
400 * * crop rect is out of bounds of the buffer dimensions
401 */
402 queueBuffer(
403 int32_t slot,
404 QueueBufferInput input
405 ) generates (
406 Status status,
407 QueueBufferOutput output
408 );
409
410 /**
411 * cancelBuffer indicates that the client does not wish to fill in the
412 * buffer associated with slot and transfers ownership of the slot back to
413 * the server.
414 *
415 * The buffer is not queued for use by the consumer.
416 *
417 * The slot must be in the range of [0, NUM_BUFFER_SLOTS).
418 *
419 * The buffer will not be overwritten until the fence signals. The fence
420 * will usually be the one obtained from dequeueBuffer.
421 *
422 * Return of a value other than NO_ERROR means an error has occurred:
423 * * NO_INIT - the buffer queue has been abandoned or the producer is not
424 * connected.
425 * * BAD_VALUE - one of the below conditions occurred:
426 * * fence was NULL
427 * * slot index was out of range (see above).
428 * * the slot was not in the dequeued state
429 */
430 cancelBuffer(
431 int32_t slot,
432 Fence fence
433 ) generates (
434 Status status
435 );
436
437 /**
438 * query retrieves some information for this surface
439 * 'what' tokens allowed are that of NATIVE_WINDOW_* in <window.h>
440 *
441 * Return of a value other than NO_ERROR means an error has occurred:
442 * * NO_INIT - the buffer queue has been abandoned.
443 * * BAD_VALUE - what was out of range
444 */
445 query(
446 int32_t what
447 ) generates (
448 int32_t result,
449 int32_t value
450 );
451
452 /**
453 * connect attempts to connect a client API to the IOmxBufferProducer.
454 * This must be called before any other IOmxBufferProducer methods are
455 * called except for getAllocator. A consumer must be already connected.
456 *
457 * This method will fail if the connect was previously called on the
458 * IOmxBufferProducer and no corresponding disconnect call was made.
459 *
460 * The listener is an optional binder callback object that can be used if
461 * the producer wants to be notified when the consumer releases a buffer
462 * back to the BufferQueue. It is also used to detect the death of the
463 * producer. If only the latter functionality is desired, there is a
464 * DummyProducerListener class in IProducerListener.h that can be used.
465 *
466 * The api should be one of the NATIVE_WINDOW_API_* values in <window.h>
467 *
468 * The producerControlledByApp should be set to true if the producer is hosted
469 * by an untrusted process (typically app_process-forked processes). If both
470 * the producer and the consumer are app-controlled then all buffer queues
471 * will operate in async mode regardless of the async flag.
472 *
473 * Upon success, the output will be filled with meaningful data
474 * (refer to QueueBufferOutput documentation above).
475 *
476 * Return of a value other than NO_ERROR means an error has occurred:
477 * * NO_INIT - one of the following occurred:
478 * * the buffer queue was abandoned
479 * * no consumer has yet connected
480 * * BAD_VALUE - one of the following has occurred:
481 * * the producer is already connected
482 * * api was out of range (see above).
483 * * output was NULL.
484 * * Failure to adjust the number of available slots. This can
485 * happen because of trying to allocate/deallocate the async
486 * buffer in response to the value of producerControlledByApp.
487 * * DEAD_OBJECT - the token is hosted by an already-dead process
488 *
489 * Additional negative errors may be returned by the internals, they
490 * should be treated as opaque fatal unrecoverable errors.
491 */
492 connect(
493 IOmxProducerListener listener,
494 int32_t api,
495 bool producerControlledByApp
496 ) generates (
497 Status status,
498 QueueBufferOutput output
499 );
500
501 /**
502 * disconnect attempts to disconnect a client API from the
503 * IOmxBufferProducer. Calling this method will cause any subsequent
504 * calls to other IOmxBufferProducer methods to fail except for
505 * getAllocator and connect. Successfully calling connect after this will
506 * allow the other methods to succeed again.
507 *
508 * The api should be one of the NATIVE_WINDOW_API_* values in <window.h>
509 *
510 * Alternatively if mode is AllLocal, then the API value is ignored, and any API
511 * connected from the same PID calling disconnect will be disconnected.
512 *
513 * Disconnecting from an abandoned IOmxBufferProducer is legal and
514 * is considered a no-op.
515 *
516 * Return of a value other than NO_ERROR means an error has occurred:
517 * * BAD_VALUE - one of the following has occurred:
518 * * the api specified does not match the one that was connected
519 * * api was out of range (see above).
520 * * DEAD_OBJECT - the token is hosted by an already-dead process
521 */
522 disconnect(
523 int32_t api,
524 DisconnectMode mode /* = DisconnectMode::API */
525 ) generates (
526 Status status
527 );
528
529 /**
530 * Attaches a sideband buffer stream to the IOmxBufferProducer.
531 *
532 * A sideband stream is a device-specific mechanism for passing buffers
533 * from the producer to the consumer without using dequeueBuffer/
534 * queueBuffer. If a sideband stream is present, the consumer can choose
535 * whether to acquire buffers from the sideband stream or from the queued
536 * buffers.
537 *
538 * Passing NULL or a different stream handle will detach the previous
539 * handle if any.
540 */
541 setSidebandStream(
542 handle stream
543 ) generates (
544 Status status
545 );
546
547 /**
548 * Allocates buffers based on the given dimensions/format.
549 *
550 * This function will allocate up to the maximum number of buffers
551 * permitted by the current BufferQueue configuration. It will use the
552 * given format, dimensions, and usage bits, which are interpreted in the
553 * same way as for dequeueBuffer, and the async flag must be set the same
554 * way as for dequeueBuffer to ensure that the correct number of buffers are
555 * allocated. This is most useful to avoid an allocation delay during
556 * dequeueBuffer. If there are already the maximum number of buffers
557 * allocated, this function has no effect.
558 */
559 allocateBuffers(
560 uint32_t width,
561 uint32_t height,
562 PixelFormat format,
563 uint32_t usage
564 );
565
566 /**
567 * Sets whether dequeueBuffer is allowed to allocate new buffers.
568 *
569 * Normally dequeueBuffer does not discriminate between free slots which
570 * already have an allocated buffer and those which do not, and will
571 * allocate a new buffer if the slot doesn't have a buffer or if the slot's
572 * buffer doesn't match the requested size, format, or usage. This method
573 * allows the producer to restrict the eligible slots to those which already
574 * have an allocated buffer of the correct size, format, and usage. If no
575 * eligible slot is available, dequeueBuffer will block or return an error
576 * as usual.
577 */
578 allowAllocation(
579 bool allow
580 ) generates (
581 Status status
582 );
583
584 /**
585 * Sets the current generation number of the BufferQueue.
586 *
587 * This generation number will be inserted into any buffers allocated by the
588 * BufferQueue, and any attempts to attach a buffer with a different
589 * generation number will fail. Buffers already in the queue are not
590 * affected and will retain their current generation number. The generation
591 * number defaults to 0.
592 */
593 setGenerationNumber(
594 uint32_t generationNumber
595 ) generates (
596 Status status
597 );
598
599 /**
600 * Returns the name of the connected consumer.
601 */
602 getConsumerName(
603 ) generates (
604 string name
605 );
606
607 /**
608 * Used to enable/disable shared buffer mode.
609 *
610 * When shared buffer mode is enabled the first buffer that is queued or
611 * dequeued will be cached and returned to all subsequent calls to
612 * dequeueBuffer and acquireBuffer. This allows the producer and consumer to
613 * simultaneously access the same buffer.
614 */
615 setSharedBufferMode(
616 bool sharedBufferMode
617 ) generates (
618 Status status
619 );
620
621 /**
622 * Used to enable/disable auto-refresh.
623 *
624 * Auto refresh has no effect outside of shared buffer mode. In shared
625 * buffer mode, when enabled, it indicates to the consumer that it should
626 * attempt to acquire buffers even if it is not aware of any being
627 * available.
628 */
629 setAutoRefresh(
630 bool autoRefresh
631 ) generates (
632 Status status
633 );
634
635 /**
636 * Sets how long dequeueBuffer will wait for a buffer to become available
637 * before returning an error (TIMED_OUT).
638 *
639 * This timeout also affects the attachBuffer call, which will block if
640 * there is not a free slot available into which the attached buffer can be
641 * placed.
642 *
643 * By default, the BufferQueue will wait forever, which is indicated by a
644 * timeout of -1. If set (to a value other than -1), this will disable
645 * non-blocking mode and its corresponding spare buffer (which is used to
646 * ensure a buffer is always available).
647 *
648 * Return of a value other than NO_ERROR means an error has occurred:
649 * * BAD_VALUE - Failure to adjust the number of available slots. This can
650 * happen because of trying to allocate/deallocate the async
651 * buffer.
652 */
653 setDequeueTimeout(
654 int64_t timeoutNs
655 ) generates (
656 Status status
657 );
658
659 /**
660 * Returns the last queued buffer along with a fence which must signal
661 * before the contents of the buffer are read. If there are no buffers in
662 * the queue, buffer.nativeHandle and fence will be null handles.
663 *
664 * transformMatrix is meaningless if buffer.nativeHandle is null.
665 */
666 getLastQueuedBuffer(
667 ) generates (
668 Status status,
669 AnwBuffer buffer,
670 Fence fence,
671 float[16] transformMatrix
672 );
673
674 /**
675 * Gets the frame events that haven't already been retrieved.
676 */
677 getFrameTimestamps(
678 ) generates (
679 FrameEventHistoryDelta timeStamps
680 );
681
682 /**
683 * Returns a unique id for this BufferQueue.
684 */
685 getUniqueId(
686 ) generates (
687 Status status,
688 uint64_t outId
689 );
690
691};
692
693
diff --git a/media/omx/1.0/IOmxNode.hal b/media/omx/1.0/IOmxNode.hal
index 5945b447..87296375 100644
--- a/media/omx/1.0/IOmxNode.hal
+++ b/media/omx/1.0/IOmxNode.hal
@@ -35,7 +35,7 @@ interface IOmxNode {
35 /** 35 /**
36 * Free the node. 36 * Free the node.
37 * 37 *
38 * @param[out] status will be the status of the call. 38 * @param[out] status Status of the call.
39 */ 39 */
40 freeNode( 40 freeNode(
41 ) generates ( 41 ) generates (
@@ -45,9 +45,9 @@ interface IOmxNode {
45 /** 45 /**
46 * Invoke a command on the node. 46 * Invoke a command on the node.
47 * 47 *
48 * @param[in] cmd indicates the type of the command. 48 * @param[in] cmd Type of the command.
49 * @param[in] param is a parameter for the command. 49 * @param[in] param Parameter for the command.
50 * @param[out] status will be the status of the call. 50 * @param[out] status Status of the call.
51 * 51 *
52 * @see OMX_SendCommand() in the OpenMax IL standard. 52 * @see OMX_SendCommand() in the OpenMax IL standard.
53 */ 53 */
@@ -61,33 +61,33 @@ interface IOmxNode {
61 /** 61 /**
62 * Retrieve a parameter setting from the node. 62 * Retrieve a parameter setting from the node.
63 * 63 *
64 * @param[in] index indicates the type of the parameter to retrieve. 64 * @param[in] index Type of the parameter to retrieve.
65 * @param[in] inParams holds some information about the retrieval. 65 * @param[in] inParams Information about the retrieval.
66 * @param[out] status will be the status of the call. 66 * @param[out] status Status of the call.
67 * @param[out] outParams will be the current parameter setting. 67 * @param[out] outParams Current parameter setting.
68 * 68 *
69 * @see OMX_GetParameter() in the OpenMax IL standard. 69 * @see OMX_GetParameter() in the OpenMax IL standard.
70 */ 70 */
71 getParameter( 71 getParameter(
72 uint32_t index, 72 uint32_t index,
73 Bytes inParams // TODO: describe structure better or point at standard 73 Bytes inParams
74 ) generates ( 74 ) generates (
75 Status status, 75 Status status,
76 Bytes outParams // TODO: describe structure better or point at standard 76 Bytes outParams
77 ); 77 );
78 78
79 /** 79 /**
80 * Change a parameter setting of the node. 80 * Change a parameter setting of the node.
81 * 81 *
82 * @param[in] index indicates the type of the parameter to change. 82 * @param[in] index Type of the parameter to change.
83 * @param[in] params holds the new parameter setting. 83 * @param[in] params New parameter setting.
84 * @param[out] status will be the status of the call. 84 * @param[out] status Status of the call.
85 * 85 *
86 * @see OMX_SetParameter() in the OpenMax IL standard. 86 * @see OMX_SetParameter() in the OpenMax IL standard.
87 */ 87 */
88 setParameter( 88 setParameter(
89 uint32_t index, 89 uint32_t index,
90 Bytes params // TODO: describe structure better or point at standard 90 Bytes params
91 ) generates ( 91 ) generates (
92 Status status 92 Status status
93 ); 93 );
@@ -95,33 +95,33 @@ interface IOmxNode {
95 /** 95 /**
96 * Retrieve a configuration from the node. 96 * Retrieve a configuration from the node.
97 * 97 *
98 * @param[in] index indicates the type of the configuration to retrieve. 98 * @param[in] index Type of the configuration to retrieve.
99 * @param[in] inConfig holds some information about the retrieval. 99 * @param[in] inConfig Information about the retrieval.
100 * @param[out] status will be the status of the call. 100 * @param[out] status Status of the call.
101 * @param[out] outConfig will be the current configuration. 101 * @param[out] outConfig Current configuration.
102 * 102 *
103 * @see OMX_GetConfig() in the OpenMax IL standard. 103 * @see OMX_GetConfig() in the OpenMax IL standard.
104 */ 104 */
105 getConfig( 105 getConfig(
106 uint32_t index, 106 uint32_t index,
107 Bytes inConfig // TODO: describe structure better or point at standard 107 Bytes inConfig
108 ) generates ( 108 ) generates (
109 Status status, 109 Status status,
110 Bytes outConfig // TODO: describe structure better or point at standard 110 Bytes outConfig
111 ); 111 );
112 112
113 /** 113 /**
114 * Change a configuration of the node. 114 * Change a configuration of the node.
115 * 115 *
116 * @param[in] index indicates the type of the configuration to change. 116 * @param[in] index Type of the configuration to change.
117 * @param[in] config holds the new configuration. 117 * @param[in] config New configuration.
118 * @param[out] status will be the status of the call. 118 * @param[out] status Status of the call.
119 * 119 *
120 * @see OMX_SetConfig() in the OpenMax IL standard. 120 * @see OMX_SetConfig() in the OpenMax IL standard.
121 */ 121 */
122 setConfig( 122 setConfig(
123 uint32_t index, 123 uint32_t index,
124 Bytes config // TODO: describe structure better or point at standard 124 Bytes config
125 ) generates ( 125 ) generates (
126 Status status 126 Status status
127 ); 127 );
@@ -129,8 +129,9 @@ interface IOmxNode {
129 /** 129 /**
130 * Set the mode of a port on the node. 130 * Set the mode of a port on the node.
131 * 131 *
132 * @param[in] portIndex is the index of the port. 132 * @param[in] portIndex Index of the port.
133 * @param[in] mode is the target mode on the specified port. 133 * @param[in] mode Target mode on the specified port.
134 * @param[out] status Status of the call.
134 */ 135 */
135 setPortMode( 136 setPortMode(
136 uint32_t portIndex, 137 uint32_t portIndex,
@@ -143,11 +144,11 @@ interface IOmxNode {
143 * Prepare a port for adaptive playback. This is based on the extension 144 * Prepare a port for adaptive playback. This is based on the extension
144 * "OMX.google.android.index.prepareForAdaptivePlayback". 145 * "OMX.google.android.index.prepareForAdaptivePlayback".
145 * 146 *
146 * @param[in] portIndex is the index of the port. 147 * @param[in] portIndex Index of the port.
147 * @param[in] enable indicates whether adaptive playback is enabled or not. 148 * @param[in] enable Whether the adaptive playback is enabled or not.
148 * @param[in] maxFrameWidth specifies the maximum frame width. 149 * @param[in] maxFrameWidth Maximum frame width.
149 * @param[in] maxFrameHeight specifies the maximum frame height. 150 * @param[in] maxFrameHeight Maximum frame height.
150 * @param[out] status status will be the status of the call. 151 * @param[out] status Status of the call.
151 */ 152 */
152 prepareForAdaptivePlayback( 153 prepareForAdaptivePlayback(
153 uint32_t portIndex, 154 uint32_t portIndex,
@@ -162,13 +163,12 @@ interface IOmxNode {
162 * Configure a port for a tunneled playback mode. This is based on the 163 * Configure a port for a tunneled playback mode. This is based on the
163 * extension "OMX.google.android.index.configureVideoTunnelMode". 164 * extension "OMX.google.android.index.configureVideoTunnelMode".
164 * 165 *
165 * @param[in] portIndex is the index of the port. 166 * @param[in] portIndex Index of the port.
166 * @param[in] tunneled indicates whether the tunneled mode is used or not. 167 * @param[in] tunneled Whether the tunneled mode is used or not.
167 * @param[in] audioHwSync is the HW SYNC ID of the audio HAL output stream 168 * @param[in] audioHwSync HW SYNC ID of the audio HAL output stream to sync
168 * to sync the video with. 169 * the video with.
169 * @param[out] status will be the status of the call. 170 * @param[out] status Status of the call.
170 * @param[out] sidebandHandle will contain the codec-allocated sideband 171 * @param[out] sidebandHandle Codec-allocated sideband window handle.
171 * window handle.
172 */ 172 */
173 configureVideoTunnelMode( 173 configureVideoTunnelMode(
174 uint32_t portIndex, 174 uint32_t portIndex,
@@ -183,23 +183,23 @@ interface IOmxNode {
183 * Retrieve the buffer usage on a port. This is based on the extension 183 * Retrieve the buffer usage on a port. This is based on the extension
184 * "OMX.google.android.index.getAndroidNativeBufferUsage". 184 * "OMX.google.android.index.getAndroidNativeBufferUsage".
185 * 185 *
186 * @param[in] portIndex is the index of the port. 186 * @param[in] portIndex Index of the port.
187 * @param[out] status will be the status of the call. 187 * @param[out] status Status of the call.
188 * @param[out] usage will be the usage. 188 * @param[out] usage Current graphic buffer usage.
189 */ 189 */
190 getGraphicBufferUsage( 190 getGraphicBufferUsage(
191 uint32_t portIndex 191 uint32_t portIndex
192 ) generates ( 192 ) generates (
193 Status status, 193 Status status,
194 uint32_t usage // TODO: Ask graphics team to define an enum. 194 uint32_t usage
195 ); 195 );
196 196
197 /** 197 /**
198 * Set up a listener to events related to the input surface. 198 * Set up a listener to events related to the input surface.
199 * 199 *
200 * @param[in] bufferSource is the listener object that implements 200 * @param[in] bufferSource Listener object that implements
201 * IOmxBufferSource. 201 * IOmxBufferSource.
202 * @param[out] status will be the status of the call. 202 * @param[out] status Status of the call.
203 * 203 *
204 * @see IOmxBufferSource. 204 * @see IOmxBufferSource.
205 */ 205 */
@@ -212,13 +212,12 @@ interface IOmxNode {
212 /** 212 /**
213 * Allocate an opaque buffer on a port as a native handle. 213 * Allocate an opaque buffer on a port as a native handle.
214 * 214 *
215 * @param[in] portIndex is the index of the port. 215 * @param[in] portIndex Index of the port.
216 * @param[in] size is the desired size of the buffer. 216 * @param[in] size Desired size of the buffer.
217 * @param[out] status will be the status of the call. 217 * @param[out] status Status of the call.
218 * @param[out] buffer will be the id of the allocated buffer, which will be 218 * @param[out] buffer Id of the allocated buffer, which will be needed in
219 * needed in some other buffer-related function calls. 219 * other buffer-related functions.
220 * @param[out] nativeHandle will be the native handle of the allocated 220 * @param[out] nativeHandle Native handle of the allocated buffer.
221 * buffer.
222 * 221 *
223 * @see OMX_AllocateBuffer() in the OpenMax IL standard. 222 * @see OMX_AllocateBuffer() in the OpenMax IL standard.
224 */ 223 */
@@ -234,11 +233,11 @@ interface IOmxNode {
234 /** 233 /**
235 * Assign a buffer to a port. 234 * Assign a buffer to a port.
236 * 235 *
237 * @param[in] portIndex is the index of the port. 236 * @param[in] portIndex Index of the port.
238 * @param[in] omxBuffer is the buffer to be assigned to the port. 237 * @param[in] omxBuffer Buffer to be assigned to the port.
239 * @param[out] status will be the status of the call. 238 * @param[out] status Status of the call.
240 * @param[out] buffer will be the id of the assigned buffer, which will be 239 * @param[out] buffer Id of the assigned buffer, which will be needed in
241 * needed in some other buffer-related function calls. 240 * other buffer-related functions.
242 * 241 *
243 * @see OMX_UseBuffer() in the OpenMax IL standard. 242 * @see OMX_UseBuffer() in the OpenMax IL standard.
244 */ 243 */
@@ -254,9 +253,9 @@ interface IOmxNode {
254 * Free a buffer previously assigned to a port by allocateSecureBuffer() or 253 * Free a buffer previously assigned to a port by allocateSecureBuffer() or
255 * useBuffer(). 254 * useBuffer().
256 * 255 *
257 * @param[in] portIndex is the index of the port. 256 * @param[in] portIndex Index of the port.
258 * @param[in] buffer is the id of the buffer to be freed. 257 * @param[in] buffer Id of the buffer to be freed.
259 * @param[out] status will be the status of the call. 258 * @param[out] status Status of the call.
260 * 259 *
261 * @see OMX_FreeBuffer() in the OpenMax IL standard. 260 * @see OMX_FreeBuffer() in the OpenMax IL standard.
262 */ 261 */
@@ -276,10 +275,10 @@ interface IOmxNode {
276 * the new buffer passed in via \p omxBuffer before OMX_FillThisBuffer() is 275 * the new buffer passed in via \p omxBuffer before OMX_FillThisBuffer() is
277 * called. Otherwise, \p omxBuffer is not used. 276 * called. Otherwise, \p omxBuffer is not used.
278 * 277 *
279 * @param[in] buffer is the id of the buffer to fill. 278 * @param[in] buffer Id of the buffer to fill.
280 * @param[in] omxBuffer points to the new buffer in metadata mode. 279 * @param[in] omxBuffer New buffer information (in metadata mode).
281 * @param[in] fence is the fence to wait for (if not null). 280 * @param[in] fence Fence to wait for (if not null).
282 * @param[out] status is the status of the call. 281 * @param[out] status Status of the call.
283 * 282 *
284 * @see OMX_FillThisBuffer() in the OpenMax IL standard. 283 * @see OMX_FillThisBuffer() in the OpenMax IL standard.
285 */ 284 */
@@ -300,21 +299,19 @@ interface IOmxNode {
300 * the new buffer passed in via \p omxBuffer before OMX_EmptyThisBuffer() is 299 * the new buffer passed in via \p omxBuffer before OMX_EmptyThisBuffer() is
301 * called. Otherwise, \p omxBuffer is not used. 300 * called. Otherwise, \p omxBuffer is not used.
302 * 301 *
303 * @param[in] buffer is the id of the buffer to fill. 302 * @param[in] buffer Id of the buffer to fill.
304 * @param[in] omxBuffer points to the new buffer in metadata mode. 303 * @param[in] omxBuffer New buffer information (in metadata mode).
305 * @param[in] flags is put into the header information that is passed to 304 * @param[in] flags Flags to be passed to OMX_EmptyBuffer().
306 * OMX_EmptyBuffer(). 305 * @param[in] timestampUs Timestamp OMX_EmptyBuffer().
307 * @param[in] timestampUs is put into the header information that is passed 306 * @param[in] fence Fence to wait for (if not null).
308 * to OMX_EmptyBuffer(). 307 * @param[out] status Status of the call.
309 * @param[in] fence is the fence to wait for (if not null).
310 * @param[out] status is the status of the call.
311 * 308 *
312 * @see OMX_EmptyThisBuffer() in the OpenMax IL standard. 309 * @see OMX_EmptyThisBuffer() in the OpenMax IL standard.
313 */ 310 */
314 emptyBuffer( 311 emptyBuffer(
315 BufferId buffer, 312 BufferId buffer,
316 CodecBuffer omxBuffer, 313 CodecBuffer omxBuffer,
317 uint32_t flags, // TODO: describe structure better or point at standard 314 uint32_t flags,
318 uint64_t timestampUs, 315 uint64_t timestampUs,
319 Fence fence 316 Fence fence
320 ) generates ( 317 ) generates (
@@ -324,9 +321,9 @@ interface IOmxNode {
324 /** 321 /**
325 * Request the node to translate an extension string to an index. 322 * Request the node to translate an extension string to an index.
326 * 323 *
327 * @param[in] parameterName is the requested extension string. 324 * @param[in] parameterName Requested extension string.
328 * @param[out] status is the status of the call. 325 * @param[out] status Status of the call.
329 * @param[out] index is the translated index. 326 * @param[out] index Translated index.
330 * 327 *
331 * @see OMX_GetExtensionIndex() in the OpenMax IL standard. 328 * @see OMX_GetExtensionIndex() in the OpenMax IL standard.
332 */ 329 */
@@ -343,8 +340,8 @@ interface IOmxNode {
343 * receive the message in batches by the callback 340 * receive the message in batches by the callback
344 * IOmxObserver::onMessages(). 341 * IOmxObserver::onMessages().
345 * 342 *
346 * @param[in] msg is the message to send. 343 * @param[in] msg Message to send.
347 * @param[out] status is the status of the call. 344 * @param[out] status Status of the call.
348 * 345 *
349 * @see IOmxObserver::onMessages(). 346 * @see IOmxObserver::onMessages().
350 */ 347 */
@@ -354,5 +351,15 @@ interface IOmxNode {
354 Status status 351 Status status
355 ); 352 );
356 353
354 /**
355 * Set quirks.
356 *
357 * @param[in] quirks Quirks for the component, generally obtained from
358 * MediaCodecList::getQuirksFor().
359 */
360 oneway setQuirks(
361 uint32_t quirks
362 );
363
357}; 364};
358 365
diff --git a/media/omx/1.0/IOmxProducerListener.hal b/media/omx/1.0/IOmxProducerListener.hal
new file mode 100644
index 00000000..7fde93ba
--- /dev/null
+++ b/media/omx/1.0/IOmxProducerListener.hal
@@ -0,0 +1,27 @@
1/*
2 * Copyright (C) 2016 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
17package android.hardware.media.omx@1.0;
18
19/**
20 * Ref: frameworks/native/include/gui/IProducerListener.h: IProducerListener
21 * This is a wrapper/wrapped HAL interface for the actual binder interface.
22 */
23interface IOmxProducerListener {
24 oneway onBufferReleased();
25 needsReleaseNotify() generates (bool result);
26};
27
diff --git a/media/omx/1.0/types.hal b/media/omx/1.0/types.hal
index ccb2ddfb..54133446 100644
--- a/media/omx/1.0/types.hal
+++ b/media/omx/1.0/types.hal
@@ -33,10 +33,18 @@ enum Status : int32_t {
33 NO_ERROR = 0, 33 NO_ERROR = 0,
34 34
35 NAME_NOT_FOUND = -2, 35 NAME_NOT_FOUND = -2,
36 WOULD_BLOCK = -11,
36 NO_MEMORY = -12, 37 NO_MEMORY = -12,
38 NO_INIT = -19,
37 BAD_VALUE = -22, 39 BAD_VALUE = -22,
40 DEAD_OBJECT = -32,
41 INVALID_OPERATION = -38,
42 TIMED_OUT = -110,
38 ERROR_UNSUPPORTED = -1010, 43 ERROR_UNSUPPORTED = -1010,
39 UNKNOWN_ERROR = -2147483648, 44 UNKNOWN_ERROR = -2147483648,
45
46 BUFFER_NEEDS_REALLOCATION = 0x1,
47 RELEASE_ALL_BUFFERS = 0x2,
40}; 48};
41 49
42/** 50/**
@@ -135,10 +143,11 @@ struct CodecBuffer {
135 PRESET, 143 PRESET,
136 SHARED_MEM, 144 SHARED_MEM,
137 ANW_BUFFER, 145 ANW_BUFFER,
138 NATIVE_HANDLE 146 NATIVE_HANDLE,
139 }; 147 };
140 148
141 struct PresetAttributes { 149 struct PresetAttributes {
150 uint32_t rangeOffset;
142 uint32_t rangeLength; 151 uint32_t rangeLength;
143 }; 152 };
144 153
@@ -147,7 +156,7 @@ struct CodecBuffer {
147 PresetAttributes preset; 156 PresetAttributes preset;
148 157
149 // if bufferType == SHARED_MEM 158 // if bufferType == SHARED_MEM
150 SharedMemoryAttributes sharedMem; 159 // No additional attributes.
151 160
152 // if bufferType == ANW_BUFFER 161 // if bufferType == ANW_BUFFER
153 AnwBufferAttributes anwBuffer; 162 AnwBufferAttributes anwBuffer;
@@ -167,14 +176,18 @@ struct CodecBuffer {
167 Attributes attr; 176 Attributes attr;
168 177
169 /** 178 /**
170 * \p nativeHandle is used only for types SHARED_MEM, ANW_BUFFER and 179 * Used only for types ANW_BUFFER and NATIVE_HANDLE.
171 * NATIVE_HANDLE.
172 * 180 *
173 * (A native handle cannot be put into a union as HIDL currently does not 181 * (A native handle cannot be put into a union as HIDL currently does not
174 * support discriminated unions.) 182 * support discriminated unions.)
175 */ 183 */
176 handle nativeHandle; 184 handle nativeHandle;
177 185
186 /**
187 * Used only for type SHARED_MEM.
188 */
189 memory sharedMemory;
190
178}; 191};
179 192
180/** 193/**