Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ec37b9e authored by Pawin Vongmasa's avatar Pawin Vongmasa Committed by Iliyan Malchev
Browse files

Start media.omx HIDL project.

Test: None

Bug: 31399200
Change-Id: I2fb1a6758ccc001c5631be1c642ad537d1ff5a10
parent 4a9f187d
Loading
Loading
Loading
Loading

media/1.0/Android.bp

0 → 100644
+45 −0
Original line number Diff line number Diff line
// 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",
    ],
}

media/1.0/types.hal

0 → 100644
+77 −0
Original line number Diff line number Diff line
/*
 * 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;
};

media/Android.bp

0 → 100644
+5 −0
Original line number Diff line number Diff line
// This is an autogenerated file, do not edit.
subdirs = [
    "1.0",
    "omx/1.0",
]
+87 −0
Original line number Diff line number Diff line
// This file is autogenerated by hidl-gen. Do not edit manually.

genrule {
    name: "android.hardware.media.omx@1.0_genc++",
    tools: ["hidl-gen"],
    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces android.hardware.media.omx@1.0",
    srcs: [
        "types.hal",
        "IGraphicBufferSource.hal",
        "IOmx.hal",
        "IOmxBufferSource.hal",
        "IOmxNode.hal",
        "IOmxObserver.hal",
    ],
    out: [
        "android/hardware/media/omx/1.0/types.cpp",
        "android/hardware/media/omx/1.0/GraphicBufferSourceAll.cpp",
        "android/hardware/media/omx/1.0/OmxAll.cpp",
        "android/hardware/media/omx/1.0/OmxBufferSourceAll.cpp",
        "android/hardware/media/omx/1.0/OmxNodeAll.cpp",
        "android/hardware/media/omx/1.0/OmxObserverAll.cpp",
    ],
}

genrule {
    name: "android.hardware.media.omx@1.0_genc++_headers",
    tools: ["hidl-gen"],
    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces android.hardware.media.omx@1.0",
    srcs: [
        "types.hal",
        "IGraphicBufferSource.hal",
        "IOmx.hal",
        "IOmxBufferSource.hal",
        "IOmxNode.hal",
        "IOmxObserver.hal",
    ],
    out: [
        "android/hardware/media/omx/1.0/types.h",
        "android/hardware/media/omx/1.0/IGraphicBufferSource.h",
        "android/hardware/media/omx/1.0/IHwGraphicBufferSource.h",
        "android/hardware/media/omx/1.0/BnGraphicBufferSource.h",
        "android/hardware/media/omx/1.0/BpGraphicBufferSource.h",
        "android/hardware/media/omx/1.0/BsGraphicBufferSource.h",
        "android/hardware/media/omx/1.0/IOmx.h",
        "android/hardware/media/omx/1.0/IHwOmx.h",
        "android/hardware/media/omx/1.0/BnOmx.h",
        "android/hardware/media/omx/1.0/BpOmx.h",
        "android/hardware/media/omx/1.0/BsOmx.h",
        "android/hardware/media/omx/1.0/IOmxBufferSource.h",
        "android/hardware/media/omx/1.0/IHwOmxBufferSource.h",
        "android/hardware/media/omx/1.0/BnOmxBufferSource.h",
        "android/hardware/media/omx/1.0/BpOmxBufferSource.h",
        "android/hardware/media/omx/1.0/BsOmxBufferSource.h",
        "android/hardware/media/omx/1.0/IOmxNode.h",
        "android/hardware/media/omx/1.0/IHwOmxNode.h",
        "android/hardware/media/omx/1.0/BnOmxNode.h",
        "android/hardware/media/omx/1.0/BpOmxNode.h",
        "android/hardware/media/omx/1.0/BsOmxNode.h",
        "android/hardware/media/omx/1.0/IOmxObserver.h",
        "android/hardware/media/omx/1.0/IHwOmxObserver.h",
        "android/hardware/media/omx/1.0/BnOmxObserver.h",
        "android/hardware/media/omx/1.0/BpOmxObserver.h",
        "android/hardware/media/omx/1.0/BsOmxObserver.h",
    ],
}

cc_library_shared {
    name: "android.hardware.media.omx@1.0",
    generated_sources: ["android.hardware.media.omx@1.0_genc++"],
    generated_headers: ["android.hardware.media.omx@1.0_genc++_headers"],
    export_generated_headers: ["android.hardware.media.omx@1.0_genc++_headers"],
    shared_libs: [
        "libhidl",
        "libhwbinder",
        "libutils",
        "libcutils",
        "android.hardware.graphics.common@1.0",
        "android.hardware.media@1.0",
    ],
    export_shared_lib_headers: [
        "libhidl",
        "libhwbinder",
        "libutils",
        "android.hardware.graphics.common@1.0",
        "android.hardware.media@1.0",
    ],
}
+60 −0
Original line number Diff line number Diff line
/*
 * 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.omx@1.0;

import android.hardware.graphics.common@1.0::Dataspace;

import android.hardware.media@1.0::types;

import IOmxNode;

/**
 * Ref: frameworks/av/media/libmedia/aidl/android/IGraphicBufferSource.aidl
 *
 * TODO: Add documentations.
 */
interface IGraphicBufferSource {

    configure(IOmxNode omxNode, Dataspace dataspace)
        generates (Status status);

    setSuspend(bool suspend)
        generates (Status status);

    setRepeatPreviousFrameDelayUs(int64_t repeatAfterUs)
        generates (Status status);

    setMaxFps(float maxFps)
        generates (Status status);

    setTimeLapseConfig(int64_t timePerFrameUs, int64_t timePerCaptureUs)
        generates (Status status);

    setStartTimeUs(int64_t startTimeUs)
        generates (Status status);

    setColorAspects(uint32_t aspects) // TODO: Maybe break down aspects.
        generates (Status status);

    setTimeOffsetUs(int64_t timeOffsetUs)
        generates (Status status);

    signalEndOfInputStream()
        generates (Status status);

};
Loading