platform_hardware_interfaces/automotive/evs/1.0/IEvsDisplay.hal

81 lines
3.1 KiB
Text
Raw Normal View History

/*
* 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.automotive.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 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.
*/
EVS HAL with multi-buffer support via BufferDesc HAL changes required in order to enable required functionality. Specifically, support for use of supplied buffers as OpenGL textures. Addition of getDisplayState is needed in order to meet original API spec (allow secondary clients to monitor display state). Expected to be needed specifically by Car Service. Note that this HAL is not used on the phone and only relevant to the Android Auto at this point. Test: compile & run evs_test. Still issues with buffer locking. Added getDisplayState() to IEvsEnumerator to allow secondary clients to query for display state without having to acquire the display. Introduced the use of weak pointers in the service to detect when clients holding an object disappear unexpectedly. Plus squashed commit of the following: commit 26c685b430028384157f573b31264ff03ea4c37b Author: Scott Randolph <randolphs@google.com> Date: Thu Jan 19 17:29:54 2017 -0800 Convert EVS HAL to use BufferDesc (vs raw handles) Use a structure that includes the buffer properties in addition to the memory handle itself to make it easier/safer for the HAL client code to reconstruct ANativeWindowBuffer objects (as required when using the buffer as a GL texture, for example) Change-Id: Ifebf0c03b9ad167d61152b85f8229d5970cc41af commit 0286385694282e017c12f238f5aaa86d8d1bd600 Author: Scott Randolph <randolphs@google.com> Date: Tue Jan 17 12:01:09 2017 -0800 Incremental cleanup of EVS driver Change-Id: Ibba2b7d9a1c55629d76ee6faf2a9f36c715e7bd7 commit 71e7b85f3919a60c5a194028a586ce81846c6c0d Author: Scott Randolph <randolphs@google.com> Date: Thu Jan 12 10:40:45 2017 -0800 Fix error check bug that cause stream start to fail Also fixes a minor warning related to log message string formatting. Change-Id: I74edf9a02db87c3632b4883ca40207fe861fd75d commit 164e7ef048eba9bc184319ea928d231a26b695bc Author: Scott Randolph <randolphs@google.com> Date: Wed Jan 11 17:27:46 2017 -0800 Fix HAL update related compile bugs Minor changes to accomodate recent HIDL/HAL changes. Change-Id: I466d8979e8e56424442840aff8d17762eac0a590 commit 67391db6a04b2cbbda1a0b5c8b717fe79994f5b9 Author: Scott Randolph <randolphs@google.com> Date: Wed Jan 11 13:56:23 2017 -0800 Avoid mutex reentrancy when setting frame count At initialization time, we need to be able to set the number of frames available for capture. This change makes the code to do this a private function called from within a mutex in order to avoid having one mutex protected call trying to make another mutex protected call as would happen if it called directly into the public API. Change-Id: I05c383976dd8db1acf5874bd47b2a3c3521d7032 commit 993f6e7e1e43f2bc4a48f6aae32d9ba2c3125d23 Author: Scott Randolph <randolphs@google.com> Date: Mon Dec 19 18:39:38 2016 -0800 Avoid forced exit if frame delivery fails If we don't read the error code from the frame delivery call, the underlying code forces an application exit if an error was returned. Even when we don't care about the result, we have to read it to avoid this. Change-Id: Ie3695faa10d1c5e340f66c369bfc2595ac516434 commit 08298db0f2d5d0ae7cd0781fde834fc7e63375d0 Author: Scott Randolph <randolphs@google.com> Date: Mon Dec 19 18:21:16 2016 -0800 Support adjustable number of frames in flight Add enhanced support for SetMaxFramesInFlight which is required to support concurrent camera clients at the EVS Manager level. Change-Id: I23b606a017529514370a03cd2eca3ee286af8fec commit 198050b2cff70d1a232745ce8e7f35e87581562e Author: Scott Randolph <randolphs@google.com> Date: Fri Dec 16 16:27:19 2016 -0800 Add frame contents validation to EvsDisplay Update the default "mock" implementation of EvsDisplay hardware layer to provide a frame contents validation based on knowledge of what the "mock" EvsCamera implementation will emit. Change-Id: If0624f855a440f52a47af7751ed3b09e8b21ff74 commit c830b7ca466155049d6eee047f6c323521451e8b Author: Scott Randolph <randolphs@google.com> Date: Fri Dec 16 15:25:48 2016 -0800 Add multi-buffer support to EvsCamera Extend the EvsCamera implmentation to support more than one buffer in flight at a time. This is necessary in order to support concurrent client access through the EvsManager proxy layer. Change-Id: I0c32336be40c7bedd797140569650906458d27c1 commit 1bdbb9d641f95d494ec2a398b6d1f5202276d17b Author: Scott Randolph <randolphs@google.com> Date: Fri Dec 16 15:24:28 2016 -0800 Add additional validation on round trip pointers Now that HIDL support returning the same pointer to an interface object after a round trip through the transport, we can add a bit more validation. Change-Id: Ia9a3a6ec7552f5e5523c0f9ad66ceb02b46b2db4 Change-Id: I47468932d6a7b2b5eab47819917cdb20154d8f18
2017-01-23 21:35:05 +01:00
getTargetBuffer() generates (BufferDesc buffer);
/**
* 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.
*/
EVS HAL with multi-buffer support via BufferDesc HAL changes required in order to enable required functionality. Specifically, support for use of supplied buffers as OpenGL textures. Addition of getDisplayState is needed in order to meet original API spec (allow secondary clients to monitor display state). Expected to be needed specifically by Car Service. Note that this HAL is not used on the phone and only relevant to the Android Auto at this point. Test: compile & run evs_test. Still issues with buffer locking. Added getDisplayState() to IEvsEnumerator to allow secondary clients to query for display state without having to acquire the display. Introduced the use of weak pointers in the service to detect when clients holding an object disappear unexpectedly. Plus squashed commit of the following: commit 26c685b430028384157f573b31264ff03ea4c37b Author: Scott Randolph <randolphs@google.com> Date: Thu Jan 19 17:29:54 2017 -0800 Convert EVS HAL to use BufferDesc (vs raw handles) Use a structure that includes the buffer properties in addition to the memory handle itself to make it easier/safer for the HAL client code to reconstruct ANativeWindowBuffer objects (as required when using the buffer as a GL texture, for example) Change-Id: Ifebf0c03b9ad167d61152b85f8229d5970cc41af commit 0286385694282e017c12f238f5aaa86d8d1bd600 Author: Scott Randolph <randolphs@google.com> Date: Tue Jan 17 12:01:09 2017 -0800 Incremental cleanup of EVS driver Change-Id: Ibba2b7d9a1c55629d76ee6faf2a9f36c715e7bd7 commit 71e7b85f3919a60c5a194028a586ce81846c6c0d Author: Scott Randolph <randolphs@google.com> Date: Thu Jan 12 10:40:45 2017 -0800 Fix error check bug that cause stream start to fail Also fixes a minor warning related to log message string formatting. Change-Id: I74edf9a02db87c3632b4883ca40207fe861fd75d commit 164e7ef048eba9bc184319ea928d231a26b695bc Author: Scott Randolph <randolphs@google.com> Date: Wed Jan 11 17:27:46 2017 -0800 Fix HAL update related compile bugs Minor changes to accomodate recent HIDL/HAL changes. Change-Id: I466d8979e8e56424442840aff8d17762eac0a590 commit 67391db6a04b2cbbda1a0b5c8b717fe79994f5b9 Author: Scott Randolph <randolphs@google.com> Date: Wed Jan 11 13:56:23 2017 -0800 Avoid mutex reentrancy when setting frame count At initialization time, we need to be able to set the number of frames available for capture. This change makes the code to do this a private function called from within a mutex in order to avoid having one mutex protected call trying to make another mutex protected call as would happen if it called directly into the public API. Change-Id: I05c383976dd8db1acf5874bd47b2a3c3521d7032 commit 993f6e7e1e43f2bc4a48f6aae32d9ba2c3125d23 Author: Scott Randolph <randolphs@google.com> Date: Mon Dec 19 18:39:38 2016 -0800 Avoid forced exit if frame delivery fails If we don't read the error code from the frame delivery call, the underlying code forces an application exit if an error was returned. Even when we don't care about the result, we have to read it to avoid this. Change-Id: Ie3695faa10d1c5e340f66c369bfc2595ac516434 commit 08298db0f2d5d0ae7cd0781fde834fc7e63375d0 Author: Scott Randolph <randolphs@google.com> Date: Mon Dec 19 18:21:16 2016 -0800 Support adjustable number of frames in flight Add enhanced support for SetMaxFramesInFlight which is required to support concurrent camera clients at the EVS Manager level. Change-Id: I23b606a017529514370a03cd2eca3ee286af8fec commit 198050b2cff70d1a232745ce8e7f35e87581562e Author: Scott Randolph <randolphs@google.com> Date: Fri Dec 16 16:27:19 2016 -0800 Add frame contents validation to EvsDisplay Update the default "mock" implementation of EvsDisplay hardware layer to provide a frame contents validation based on knowledge of what the "mock" EvsCamera implementation will emit. Change-Id: If0624f855a440f52a47af7751ed3b09e8b21ff74 commit c830b7ca466155049d6eee047f6c323521451e8b Author: Scott Randolph <randolphs@google.com> Date: Fri Dec 16 15:25:48 2016 -0800 Add multi-buffer support to EvsCamera Extend the EvsCamera implmentation to support more than one buffer in flight at a time. This is necessary in order to support concurrent client access through the EvsManager proxy layer. Change-Id: I0c32336be40c7bedd797140569650906458d27c1 commit 1bdbb9d641f95d494ec2a398b6d1f5202276d17b Author: Scott Randolph <randolphs@google.com> Date: Fri Dec 16 15:24:28 2016 -0800 Add additional validation on round trip pointers Now that HIDL support returning the same pointer to an interface object after a round trip through the transport, we can add a bit more validation. Change-Id: Ia9a3a6ec7552f5e5523c0f9ad66ceb02b46b2db4 Change-Id: I47468932d6a7b2b5eab47819917cdb20154d8f18
2017-01-23 21:35:05 +01:00
returnTargetBufferForDisplay(BufferDesc buffer) generates (EvsResult result);
};