User allocated EVS camera capture buffers

This change introduces a new API to import frame capture buffers
allocated by the clients.

Bug: 152493110
Test: m -j and run /system/bin/evs_app --test --extmem
Change-Id: I679c61719e4d0e3a7d0c41110afe66e0a4ccb305
This commit is contained in:
Changyeon Jo 2020-03-27 14:19:46 -07:00
parent 704ada8dc2
commit 3e69744f0f
5 changed files with 33 additions and 2 deletions

View file

@ -215,4 +215,22 @@ interface IEvsCamera extends @1.0::IEvsCamera {
*/
setExtendedInfo_1_1(uint32_t opaqueIdentifier, vec<uint8_t> opaqueValue)
generates (EvsResult result);
/**
* Import external buffers to capture frames
*
* This API must be called with a physical camera device identifier.
*
* @param buffers A list of buffers allocated by the caller. EvsCamera
* will use these buffers to capture frames, in addition to
* other buffers already in its buffer pool.
* @return result EvsResult::OK if it succeeds to import buffers.
* EvsResult::UNDERLYING_SERVICE_ERROR if this is called
* for logical camera devices or EVS fails to import
* buffers.
* delta The amount of buffer pool size changes after importing
* given buffers.
*/
importExternalBuffers(vec<BufferDesc> buffers)
generates (EvsResult result, int32_t delta);
};

View file

@ -354,6 +354,14 @@ Return<void> EvsCamera::getExtendedInfo_1_1(uint32_t opaqueIdentifier,
}
Return<void>
EvsCamera::importExternalBuffers(const hidl_vec<BufferDesc_1_1>& /* buffers */,
importExternalBuffers_cb _hidl_cb) {
ALOGW("%s is not implemented yet.", __FUNCTION__);
_hidl_cb(EvsResult::UNDERLYING_SERVICE_ERROR, 0);
return {};
}
bool EvsCamera::setAvailableFrames_Locked(unsigned bufferCount) {
if (bufferCount < 1) {

View file

@ -82,6 +82,8 @@ public:
const hidl_vec<uint8_t>& opaqueValue) override;
Return<void> getExtendedInfo_1_1(uint32_t opaqueIdentifier,
getExtendedInfo_1_1_cb _hidl_cb) override;
Return<void> importExternalBuffers(const hidl_vec<BufferDesc_1_1>& buffers,
importExternalBuffers_cb _hidl_cb) override;
static sp<EvsCamera> Create(const char *deviceName);
static sp<EvsCamera> Create(const char *deviceName,

View file

@ -70,6 +70,9 @@ struct BufferDesc {
*/
int64_t timestamp;
/**
* Frame metadata. This is opaque to EVS manager.
*/
vec<uint8_t> metadata;
};

View file

@ -642,13 +642,13 @@ d06fc14b325beeef06bd39de8f178f490d9e9095255626866071aab42be1fc40 android.hardwar
07e387bd8bc0e4df5f372515ed960a0b1ae74ea7231d4490a0bb09b07046e4f1 android.hardware.automotive.can@1.0::ICanMessageListener
2166132d6c247630a193217b4338074f634d6691b1ed6796cb26b3812e90b46e android.hardware.automotive.can@1.0::ICloseHandle
83355471a3b6d7f777d3f129714585ffb77d9b6f8a3d0365741969631efb81b2 android.hardware.automotive.can@1.0::types
8afd93d525cf17818e3d46e72f30debeaacc6fb166a59a8e25272f2baeb0ef7a android.hardware.automotive.evs@1.1::IEvsCamera
50bfbeef15d7451bd07e4ad460fbcb7ff80521b89bb8049035c0d458b4125ae4 android.hardware.automotive.evs@1.1::IEvsCamera
89ff5ab18b3069f21a57f559b290caa50670f0ae1b74178f630183aef39b496b android.hardware.automotive.evs@1.1::IEvsCameraStream
4c67f768067a0aceac74381f6f62e778ab3b6a18f47db3c9b98c58190ef5619d android.hardware.automotive.evs@1.1::IEvsDisplay
87958d728d7c0ee9b9391ab4a072b097914921a7b38f7dc3df427f933a5b528e android.hardware.automotive.evs@1.1::IEvsEnumerator
f53b4e8de6209c6d0fa9036005671b34a2f98328b51423d3a5137a43bf42c84d android.hardware.automotive.evs@1.1::IEvsUltrasonicsArray
0460bacbde906a846a3d71b2b7b33d6927cac3ff072e523ffac7853577464406 android.hardware.automotive.evs@1.1::IEvsUltrasonicsArrayStream
8a156203892de3cfa47baaccabef3c45b3315cae93b332357598d60896b1ac7f android.hardware.automotive.evs@1.1::types
3e374b5c4777f959f62a320abb3b9edca8874e24e383dbb19c66d224f151b363 android.hardware.automotive.evs@1.1::types
4e4904c4067dadae974ddf90351f362331dcd04bba1d890d313cc8ba91f68c15 android.hardware.automotive.sv@1.0::ISurroundView2dSession
63336e9d03f545020ff2982ff76d9d8c44fa76ad476293b5ef6732cbbd71e61b android.hardware.automotive.sv@1.0::ISurroundView3dSession
b7015428cd52ce8192d13bfcbf2c4455cda3727d57f2aac80d65a1747104f5ac android.hardware.automotive.sv@1.0::ISurroundViewService