Revert "Enable EVS service"
This reverts commit 6fb4b69a407540e1344dfabddbb4917af7e11713.
Change-Id: I09756b315abde19f317efd5bba0061341ffc4e20
diff --git a/evs/app/evs_app.rc b/evs/app/evs_app.rc
index a61edfe..69832f9 100644
--- a/evs/app/evs_app.rc
+++ b/evs/app/evs_app.rc
@@ -1,5 +1,5 @@
-service evs_app /system/bin/evs_app
- class hal
- priority -20
- user automotive_evs
- group automotive_evs
+#service evs_app /system/bin/evs_app
+# class hal
+# priority -20
+# user automotive_evs
+# group automotive_evs
diff --git a/evs/manager/android.automotive.evs.manager@1.0.rc b/evs/manager/android.automotive.evs.manager@1.0.rc
index 8a53ba7..b1b2c97 100644
--- a/evs/manager/android.automotive.evs.manager@1.0.rc
+++ b/evs/manager/android.automotive.evs.manager@1.0.rc
@@ -1,6 +1,6 @@
-service evs_manager /system/bin/android.automotive.evs.manager@1.0
- class hal
- priority -20
- user automotive_evs
- group automotive_evs
- onrestart restart evs_app
+#service evs_manager /system/bin/android.automotive.evs.manager@1.0
+# class hal
+# priority -20
+# user automotive_evs
+# group automotive_evs
+# onrestart restart evs_app
diff --git a/evs/sampleDriver/EvsEnumerator.cpp b/evs/sampleDriver/EvsEnumerator.cpp
index 2336bf3..d31f672 100644
--- a/evs/sampleDriver/EvsEnumerator.cpp
+++ b/evs/sampleDriver/EvsEnumerator.cpp
@@ -39,10 +39,9 @@
EvsEnumerator::EvsEnumerator() {
ALOGD("EvsEnumerator created");
- enumerateDevices();
-}
+ unsigned videoCount = 0;
+ unsigned captureCount = 0;
-void EvsEnumerator::enumerateDevices() {
// For every video* entry in the dev folder, see if it reports suitable capabilities
// WARNING: Depending on the driver implementations this could be slow, especially if
// there are timeouts or round trips to hardware required to collect the needed
@@ -51,9 +50,7 @@
// For example, this code might be replaced with nothing more than:
// sCameraList.emplace_back("/dev/video0");
// sCameraList.emplace_back("/dev/video1");
- ALOGI("%s: Starting dev/video* enumeration", __FUNCTION__);
- unsigned videoCount = 0;
- unsigned captureCount = 0;
+ ALOGI("Starting dev/video* enumeration");
DIR* dir = opendir("/dev");
if (!dir) {
LOG_FATAL("Failed to open /dev folder\n");
@@ -75,6 +72,7 @@
ALOGI("Found %d qualified video capture devices of %d checked\n", captureCount, videoCount);
}
+
// Methods from ::android::hardware::automotive::evs::V1_0::IEvsEnumerator follow.
Return<void> EvsEnumerator::getCameraList(getCameraList_cb _hidl_cb) {
ALOGD("getCameraList");
@@ -104,13 +102,8 @@
// Is this a recognized camera id?
CameraRecord *pRecord = findCameraById(cameraId);
if (!pRecord) {
- ALOGE("Requested camera %s not found, enumerate again", cameraId.c_str());
- enumerateDevices();
- pRecord = findCameraById(cameraId);
- if (!pRecord) {
- ALOGE("Requested camera %s not found", cameraId.c_str());
- return nullptr;
- }
+ ALOGE("Requested camera %s not found", cameraId.c_str());
+ return nullptr;
}
// Has this camera already been instantiated by another caller?
@@ -252,33 +245,21 @@
// Enumerate the available capture formats (if any)
v4l2_fmtdesc formatDescription;
formatDescription.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- union {
- uint32_t format;
- uint8_t c[4];
- } str;
- bool found = false;
- for (int i=0; !found; i++) {
+ for (int i=0; true; i++) {
formatDescription.index = i;
if (ioctl(fd, VIDIOC_ENUM_FMT, &formatDescription) == 0) {
- str.format = formatDescription.pixelformat;
- ALOGI("FORMAT %c%c%c%c (0x%X), type 0x%X, desc %s, flags 0x%X",
- str.c[0], str.c[1], str.c[2], str.c[3],
- formatDescription.pixelformat, formatDescription.type,
- formatDescription.description, formatDescription.flags);
switch (formatDescription.pixelformat)
{
- case V4L2_PIX_FMT_YUYV: found = true; break;
- case V4L2_PIX_FMT_NV21: found = true; break;
- case V4L2_PIX_FMT_NV16: found = true; break;
- case V4L2_PIX_FMT_YVU420: found = true; break;
- case V4L2_PIX_FMT_RGB32: found = true; break;
+ case V4L2_PIX_FMT_YUYV: return true;
+ case V4L2_PIX_FMT_NV21: return true;
+ case V4L2_PIX_FMT_NV16: return true;
+ case V4L2_PIX_FMT_YVU420: return true;
+ case V4L2_PIX_FMT_RGB32: return true;
#ifdef V4L2_PIX_FMT_ARGB32 // introduced with kernel v3.17
- case V4L2_PIX_FMT_ARGB32: found = true; break;
- case V4L2_PIX_FMT_XRGB32: found = true; break;
+ case V4L2_PIX_FMT_ARGB32: return true;
+ case V4L2_PIX_FMT_XRGB32: return true;
#endif // V4L2_PIX_FMT_ARGB32
- default:
- ALOGW("Unsupported, 0x%X", formatDescription.pixelformat);
- break;
+ default: break;
}
} else {
// No more formats available
@@ -287,7 +268,7 @@
}
// If we get here, we didn't find a usable output format
- return found;
+ return false;
}
diff --git a/evs/sampleDriver/EvsEnumerator.h b/evs/sampleDriver/EvsEnumerator.h
index a4bfe7e..d8d7b36 100644
--- a/evs/sampleDriver/EvsEnumerator.h
+++ b/evs/sampleDriver/EvsEnumerator.h
@@ -70,8 +70,6 @@
static std::list<CameraRecord> sCameraList;
static wp<EvsGlDisplay> sActiveDisplay; // Weak pointer. Object destructs if client dies.
-
- void enumerateDevices();
};
} // namespace implementation
diff --git a/evs/sampleDriver/EvsV4lCamera.cpp b/evs/sampleDriver/EvsV4lCamera.cpp
index 55ea497..f811a1f 100644
--- a/evs/sampleDriver/EvsV4lCamera.cpp
+++ b/evs/sampleDriver/EvsV4lCamera.cpp
@@ -47,9 +47,13 @@
ALOGE("Failed to open v4l device %s\n", deviceName);
}
- // Output buffer format.
- // TODO: Does this need to be configurable?
- mFormat = HAL_PIXEL_FORMAT_RGBA_8888;
+ // NOTE: Our current spec says only support NV21 -- can we stick to that with software
+ // conversion? Will this work with the hardware texture units?
+ // TODO: Settle on the one official format that works on all platforms
+ // TODO: Get NV21 working? It is scrambled somewhere along the way right now.
+// mFormat = HAL_PIXEL_FORMAT_YCRCB_420_SP; // 420SP == NV21
+// mFormat = HAL_PIXEL_FORMAT_RGBA_8888;
+ mFormat = HAL_PIXEL_FORMAT_YCBCR_422_I;
// How we expect to use the gralloc buffers we'll exchange with our client
mUsage = GRALLOC_USAGE_HW_TEXTURE |
@@ -155,15 +159,17 @@
// Choose which image transfer function we need
// Map from V4L2 to Android graphic buffer format
const uint32_t videoSrcFormat = mVideo.getV4LFormat();
- ALOGI("Configuring to accept %4.4s camera data and convert to 0x%X",
- (char*)&videoSrcFormat, mFormat);
+ ALOGI("Configuring to accept %4.4s camera data and convert to %4.4s",
+ (char*)&videoSrcFormat, (char*)&mFormat);
// TODO: Simplify this by supporting only ONE fixed output format
switch (mFormat) {
case HAL_PIXEL_FORMAT_YCRCB_420_SP:
switch (videoSrcFormat) {
case V4L2_PIX_FMT_NV21: mFillBufferFromVideo = fillNV21FromNV21; break;
+ // case V4L2_PIX_FMT_YV12: mFillBufferFromVideo = fillNV21FromYV12; break;
case V4L2_PIX_FMT_YUYV: mFillBufferFromVideo = fillNV21FromYUYV; break;
+ // case V4L2_PIX_FORMAT_NV16: mFillBufferFromVideo = fillNV21FromNV16; break;
default:
// TODO: Are there other V4L2 formats we must support?
ALOGE("Unhandled camera output format %c%c%c%c (0x%8X)\n",