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

Commit dde8ed3d authored by Scott Randolph's avatar Scott Randolph Committed by Android (Google) Code Review
Browse files

Merge "Initial Android Auto External View Systems drivers"

parents 6e2086e0 5c99d856
Loading
Loading
Loading
Loading

evs/1.0/Android.bp

0 → 100644
+80 −0
Original line number Diff line number Diff line
// This file is autogenerated by hidl-gen. Do not edit manually.

genrule {
    name: "android.hardware.evs@1.0_genc++",
    tools: ["hidl-gen"],
    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.evs@1.0",
    srcs: [
        "types.hal",
        "IEvsCamera.hal",
        "IEvsCameraStream.hal",
        "IEvsDisplay.hal",
        "IEvsEnumerator.hal",
    ],
    out: [
        "android/hardware/evs/1.0/types.cpp",
        "android/hardware/evs/1.0/EvsCameraAll.cpp",
        "android/hardware/evs/1.0/EvsCameraStreamAll.cpp",
        "android/hardware/evs/1.0/EvsDisplayAll.cpp",
        "android/hardware/evs/1.0/EvsEnumeratorAll.cpp",
    ],
}

genrule {
    name: "android.hardware.evs@1.0_genc++_headers",
    tools: ["hidl-gen"],
    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.evs@1.0",
    srcs: [
        "types.hal",
        "IEvsCamera.hal",
        "IEvsCameraStream.hal",
        "IEvsDisplay.hal",
        "IEvsEnumerator.hal",
    ],
    out: [
        "android/hardware/evs/1.0/types.h",
        "android/hardware/evs/1.0/IEvsCamera.h",
        "android/hardware/evs/1.0/IHwEvsCamera.h",
        "android/hardware/evs/1.0/BnEvsCamera.h",
        "android/hardware/evs/1.0/BpEvsCamera.h",
        "android/hardware/evs/1.0/BsEvsCamera.h",
        "android/hardware/evs/1.0/IEvsCameraStream.h",
        "android/hardware/evs/1.0/IHwEvsCameraStream.h",
        "android/hardware/evs/1.0/BnEvsCameraStream.h",
        "android/hardware/evs/1.0/BpEvsCameraStream.h",
        "android/hardware/evs/1.0/BsEvsCameraStream.h",
        "android/hardware/evs/1.0/IEvsDisplay.h",
        "android/hardware/evs/1.0/IHwEvsDisplay.h",
        "android/hardware/evs/1.0/BnEvsDisplay.h",
        "android/hardware/evs/1.0/BpEvsDisplay.h",
        "android/hardware/evs/1.0/BsEvsDisplay.h",
        "android/hardware/evs/1.0/IEvsEnumerator.h",
        "android/hardware/evs/1.0/IHwEvsEnumerator.h",
        "android/hardware/evs/1.0/BnEvsEnumerator.h",
        "android/hardware/evs/1.0/BpEvsEnumerator.h",
        "android/hardware/evs/1.0/BsEvsEnumerator.h",
    ],
}

cc_library_shared {
    name: "android.hardware.evs@1.0",
    generated_sources: ["android.hardware.evs@1.0_genc++"],
    generated_headers: ["android.hardware.evs@1.0_genc++_headers"],
    export_generated_headers: ["android.hardware.evs@1.0_genc++_headers"],
    shared_libs: [
        "libhidlbase",
        "libhidltransport",
        "libhwbinder",
        "liblog",
        "libutils",
        "libcutils",
        "android.hidl.base@1.0",
    ],
    export_shared_lib_headers: [
        "libhidlbase",
        "libhidltransport",
        "libhwbinder",
        "libutils",
        "android.hidl.base@1.0",
    ],
}

evs/1.0/IEvsCamera.hal

0 → 100644
+99 −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.evs@1.0;

import types;
import IEvsCameraStream;


/**
 * Represents a single camera and is the primary interface for capturing images.
 */
interface IEvsCamera {

    /**
     * Returns the ID of this camera.
     *
     * Returns the string id of this camera. This must be the same value as reported in
     * the camera_id field of the CameraDesc structure by EvsEnumerator::getCamerList().
     */
    getId() generates (string cameraId);

    /**
     * Specifies the depth of the buffer chain the camera is asked to support.
     *
     * Up to this many frames may be held concurrently by the client of IEvsCamera.
     * If this many frames have been delivered to the receiver without being returned
     * by doneWithFrame, the stream must skip frames until a buffer is returned for reuse.
     * It is legal for this call to come at any time, even while streams are already running,
     * in which case buffers should be added or removed from the chain as appropriate.
     * If no call is made to this entry point, the IEvsCamera must support at least one
     * frame by default. More is acceptable.
     * BUFFER_NOT_AVAILABLE is returned if the implementation cannot support the
     * requested number of concurrent frames.
     */
    setMaxFramesInFlight(uint32_t bufferCount) generates (EvsResult result);

    /**
     * Request delivery of EVS camera frames from this camera.
     *
     * The IEvsCameraStream must begin receiving periodic calls with new image
     * frames until stopVideoStream() is called.
     */
    startVideoStream(IEvsCameraStream receiver) generates (EvsResult result);

    /**
     * Return a frame that was delivered by to the IEvsCameraStream.
     *
     * When done consuming a frame delivered to the IEvsCameraStream
     * interface, it must be returned to the IEvsCamera for reuse.
     * A small, finite number of buffers are available (possibly as small
     * as one), and if the supply is exhausted, no further frames may be
     * delivered until a buffer is returned.
     */
    doneWithFrame(uint32_t frameId, handle bufferHandle) generates (EvsResult result);

    /**
     * Stop the delivery of EVS camera frames.
     *
     * Because delivery is asynchronous, frames may continue to arrive for
     * some time after this call returns. Each must be returned until the
     * closure of the stream is signaled to the IEvsCameraStream.
     * This function cannot fail and is simply ignored if the stream isn't running.
     */
    stopVideoStream();

    /**
     * Request driver specific information from the HAL implementation.
     *
     * The values allowed for opaqueIdentifier are driver specific,
     * but no value passed in may crash the driver. The driver should
     * return 0 for any unrecognized opaqueIdentifier.
     */
    getExtendedInfo(uint32_t opaqueIdentifier) generates (int32_t value);

    /**
     * Send a driver specific value to the HAL implementation.
     *
     * This extension is provided to facilitate car specific
     * extensions, but no HAL implementation may require this call
     * in order to function in a default state.
     * INVALID_ARG is returned if the opaqueValue is not meaningful to
     * the driver implementation.
     */
    setExtendedInfo(uint32_t opaqueIdentifier, int32_t opaqueValue) generates (EvsResult result);
};
+36 −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.evs@1.0;


/**
 * Implemented on client side to receive asynchronous video frame deliveries.
 */
interface IEvsCameraStream {

    /**
     * Receives calls from the HAL each time a video frame is ready for inspection.
     * Buffer handles received by this method must be returned via calls to
     * IEvsCamera::doneWithFrame(). When the video stream is stopped via a call
     * to IEvsCamera::stopVideoStream(), this callback may continue to happen for
     * some time as the pipeline drains. Each frame must still be returned.
     * When the last frame in the stream has been delivered, a NULL bufferHandle
     * must be delivered, signifying the end of the stream. No further frame
     * deliveries may happen thereafter.
     */
    oneway deliverFrame(uint32_t frameId, handle bufferHandle);
};
+80 −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.evs@1.0;

import types;


/**
 * Represents a single camera and is the primary interface for capturing images.
 */
interface IEvsDisplay {

    /**
     * Returns basic information about the EVS display provided by the system.
     *
     * See the description of the DisplayDesc structure below for details.
     */
     getDisplayInfo() generates (DisplayDesc info);


    /**
     * Clients may set the display state to express their desired state.
     *
     * The HAL implementation must gracefully accept a request for any state while in
     * any other state, although the response may be to defer or ignore the request. The display
     * is defined to start in the NOT_VISIBLE state upon initialization. The client is
     * then expected to request the VISIBLE_ON_NEXT_FRAME state, and then begin providing
     * video. When the display is no longer required, the client is expected to request
     * the NOT_VISIBLE state after passing the last video frame.
     * Returns INVALID_ARG if the requested state is not a recognized value.
     */
     setDisplayState(DisplayState state) generates (EvsResult result);


    /**
     * This call requests the current state of the display
     *
     * The HAL implementation should report the actual current state, which might
     * transiently differ from the most recently requested state. Note, however, that
     * the logic responsible for changing display states should generally live above
     * the device layer, making it undesirable for the HAL implementation to spontaneously
     * change display states.
     */
     getDisplayState() generates (DisplayState state);


    /**
     * This call returns a handle to a frame buffer associated with the display.
     *
     * The returned buffer may be locked and written to by software and/or GL. This buffer
     * must be returned via a call to returnTargetBufferForDisplay() even if the
     * display is no longer visible.
     */
     getTargetBuffer() generates (handle bufferHandle);


    /**
     * This call tells the display that the buffer is ready for display.
     *
     * The buffer is no longer valid for use by the client after this call.
     * There is no maximum time the caller may hold onto the buffer before making this
     * call. The buffer may be returned at any time and in any DisplayState, but all
     * buffers are expected to be returned before the IEvsDisplay interface is destroyed.
     */
    returnTargetBufferForDisplay(handle bufferHandle) generates (EvsResult result);
};
+71 −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.evs@1.0;

import types;
import IEvsCamera;
import IEvsDisplay;


/**
 * Provides the mechanism for EVS camera discovery
 */
interface IEvsEnumerator {

    /**
     * Returns a list of all EVS cameras available to the system
     */
    getCameraList() generates (vec<CameraDesc> cameras);


    /**
     * Get the IEvsCamera associated with a cameraId from a CameraDesc
     *
     * Given a camera's unique cameraId from ca CameraDesc, returns
     * the ICamera interface assocaited with the specified camera.
     * When done using the camera, it must be returned by calling
     * closeCamera on the ICamera interface.
     */
    openCamera(string cameraId) generates (IEvsCamera carCamera);

    /**
     * Return the specified IEvsCamera interface as no longer in use
     *
     * When the IEvsCamera object is no longer required, it must be released.
     * NOTE: Video streaming must be cleanly stopped before making this call.
     */
    closeCamera(IEvsCamera carCamera);


    /**
     * Get exclusive access to IEvsDisplay for the system
     *
     * There can be at most one EVS display object for the system and this function
     * requests access to it. If the EVS display is not available or is already in use,
     * a null pointer is returned.
     */
    openDisplay() generates (IEvsDisplay display);

    /**
     * Return the specified IEvsDisplay interface as no longer in use
     *
     * When the IEvsDisplay object is no longer required, it must be released.
     * NOTE: All buffer must have been returned to the display before making this call.
     */
    closeDisplay(IEvsDisplay display);
};
Loading