Start media.omx HIDL project.
Test: None
Bug: 31399200
Change-Id: I2fb1a6758ccc001c5631be1c642ad537d1ff5a10
diff --git a/media/1.0/Android.bp b/media/1.0/Android.bp
new file mode 100644
index 0000000..c8bdd82
--- /dev/null
+++ b/media/1.0/Android.bp
@@ -0,0 +1,45 @@
+// This file is autogenerated by hidl-gen. Do not edit manually.
+
+genrule {
+ name: "android.hardware.media@1.0_genc++",
+ tools: ["hidl-gen"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces android.hardware.media@1.0",
+ srcs: [
+ "types.hal",
+ ],
+ out: [
+ "android/hardware/media/1.0/types.cpp",
+ ],
+}
+
+genrule {
+ name: "android.hardware.media@1.0_genc++_headers",
+ tools: ["hidl-gen"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces android.hardware.media@1.0",
+ srcs: [
+ "types.hal",
+ ],
+ out: [
+ "android/hardware/media/1.0/types.h",
+ ],
+}
+
+cc_library_shared {
+ name: "android.hardware.media@1.0",
+ generated_sources: ["android.hardware.media@1.0_genc++"],
+ generated_headers: ["android.hardware.media@1.0_genc++_headers"],
+ export_generated_headers: ["android.hardware.media@1.0_genc++_headers"],
+ shared_libs: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
+ "libcutils",
+ "android.hardware.graphics.common@1.0",
+ ],
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
+ "android.hardware.graphics.common@1.0",
+ ],
+}
diff --git a/media/1.0/types.hal b/media/1.0/types.hal
new file mode 100644
index 0000000..25931f8
--- /dev/null
+++ b/media/1.0/types.hal
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2016 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@1.0;
+
+import android.hardware.graphics.common@1.0::PixelFormat;
+
+/**
+ * Aliases
+ */
+typedef handle FileDescriptor; // This must have no more than one fd.
+typedef FileDescriptor Fence;
+typedef int32_t Status; // TODO: convert to an enum
+typedef vec<uint8_t> Bytes;
+
+/**
+ * Ref: frameworks/native/include/ui/GraphicBuffer.h
+ * Ref: system/core/include/system/window.h
+ */
+
+/**
+ * This struct contains attributes for a gralloc buffer that can be put into a
+ * union.
+ */
+struct GraphicBufferAttributes {
+ uint32_t width;
+ uint32_t height;
+ uint32_t stride;
+ PixelFormat format;
+ uint32_t usage; // TODO: convert to an enum
+ uint32_t generationNumber;
+};
+
+/**
+ * A GraphicBuffer is simply GraphicBufferAttributes plus a native handle.
+ */
+struct GraphicBuffer {
+ handle nativeHandle;
+ GraphicBufferAttributes attr;
+};
+
+/**
+ * Ref: frameworks/native/include/binder/IMemory.h
+ * Ref: frameworks/native/libs/binder/IMemory.cpp
+ */
+
+/**
+ * This struct contains attributes for a shared memory buffer that can be put
+ * into a union.
+ */
+struct SharedMemoryAttributes {
+ uint32_t size;
+ uint32_t flags; // TODO: convert to an enum
+ uint32_t offset;
+};
+
+/**
+ * A SharedMemory is simply SharedMemoryAttributes plus a native handle.
+ */
+struct SharedMemory {
+ handle nativeHandle;
+ SharedMemoryAttributes attr;
+};
+