diff options
Diffstat (limited to 'media/1.0/types.hal')
-rw-r--r-- | media/1.0/types.hal | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/media/1.0/types.hal b/media/1.0/types.hal new file mode 100644 index 00000000..25931f8c --- /dev/null +++ b/media/1.0/types.hal | |||
@@ -0,0 +1,77 @@ | |||
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 | |||
17 | package android.hardware.media@1.0; | ||
18 | |||
19 | import android.hardware.graphics.common@1.0::PixelFormat; | ||
20 | |||
21 | /** | ||
22 | * Aliases | ||
23 | */ | ||
24 | typedef handle FileDescriptor; // This must have no more than one fd. | ||
25 | typedef FileDescriptor Fence; | ||
26 | typedef int32_t Status; // TODO: convert to an enum | ||
27 | typedef vec<uint8_t> Bytes; | ||
28 | |||
29 | /** | ||
30 | * Ref: frameworks/native/include/ui/GraphicBuffer.h | ||
31 | * Ref: system/core/include/system/window.h | ||
32 | */ | ||
33 | |||
34 | /** | ||
35 | * This struct contains attributes for a gralloc buffer that can be put into a | ||
36 | * union. | ||
37 | */ | ||
38 | struct GraphicBufferAttributes { | ||
39 | uint32_t width; | ||
40 | uint32_t height; | ||
41 | uint32_t stride; | ||
42 | PixelFormat format; | ||
43 | uint32_t usage; // TODO: convert to an enum | ||
44 | uint32_t generationNumber; | ||
45 | }; | ||
46 | |||
47 | /** | ||
48 | * A GraphicBuffer is simply GraphicBufferAttributes plus a native handle. | ||
49 | */ | ||
50 | struct GraphicBuffer { | ||
51 | handle nativeHandle; | ||
52 | GraphicBufferAttributes attr; | ||
53 | }; | ||
54 | |||
55 | /** | ||
56 | * Ref: frameworks/native/include/binder/IMemory.h | ||
57 | * Ref: frameworks/native/libs/binder/IMemory.cpp | ||
58 | */ | ||
59 | |||
60 | /** | ||
61 | * This struct contains attributes for a shared memory buffer that can be put | ||
62 | * into a union. | ||
63 | */ | ||
64 | struct SharedMemoryAttributes { | ||
65 | uint32_t size; | ||
66 | uint32_t flags; // TODO: convert to an enum | ||
67 | uint32_t offset; | ||
68 | }; | ||
69 | |||
70 | /** | ||
71 | * A SharedMemory is simply SharedMemoryAttributes plus a native handle. | ||
72 | */ | ||
73 | struct SharedMemory { | ||
74 | handle nativeHandle; | ||
75 | SharedMemoryAttributes attr; | ||
76 | }; | ||
77 | |||