summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhuans <huans@google.com>2018-07-06 16:12:30 -0700
committerhuans <huans@google.com>2018-07-06 16:12:30 -0700
commit005c10e381d8c5d87ee17204b4cd6ac5023ee337 (patch)
treeec8bc291a9423574f5613bec02cc9eaec11972f3
parent31eb958813c6d026e9f9a6dafed1e2b23bba164f (diff)
downloaddevice_generic_goldfish-005c10e381d8c5d87ee17204b4cd6ac5023ee337.tar.gz
device_generic_goldfish-005c10e381d8c5d87ee17204b4cd6ac5023ee337.tar.bz2
device_generic_goldfish-005c10e381d8c5d87ee17204b4cd6ac5023ee337.zip
Fix compile warnings for goldfish camera and hwcomposer
Bug: 80194417 Test: check warnings are gone when compile Change-Id: Iaba227444accfb552fae1c333d29dc26e3cdd736
-rwxr-xr-xcamera/CallbackNotifier.cpp2
-rwxr-xr-xcamera/Converters.cpp2
-rw-r--r--camera/EmulatedBaseCamera.cpp2
-rw-r--r--camera/EmulatedBaseCamera.h2
-rwxr-xr-xcamera/EmulatedCamera.cpp35
-rw-r--r--camera/EmulatedCamera2.cpp2
-rw-r--r--camera/EmulatedCamera3.cpp2
-rwxr-xr-xcamera/EmulatedCameraDevice.cpp2
-rwxr-xr-xcamera/EmulatedCameraFactory.cpp4
-rwxr-xr-xcamera/EmulatedCameraFactory.h2
-rwxr-xr-xcamera/EmulatedCameraHal.cpp30
-rw-r--r--camera/EmulatedCameraHotplugThread.cpp2
-rwxr-xr-xcamera/EmulatedFakeCamera.cpp2
-rw-r--r--camera/EmulatedFakeCamera2.cpp12
-rw-r--r--camera/EmulatedFakeCamera3.cpp15
-rwxr-xr-xcamera/EmulatedFakeCameraDevice.cpp2
-rwxr-xr-xcamera/EmulatedFakeRotatingCameraDevice.cpp6
-rwxr-xr-xcamera/EmulatedQemuCamera.cpp2
-rw-r--r--camera/EmulatedQemuCamera2.cpp2
-rw-r--r--camera/EmulatedQemuCamera3.cpp8
-rwxr-xr-xcamera/EmulatedQemuCameraDevice.cpp2
-rw-r--r--camera/Exif.cpp14
-rw-r--r--camera/GrallocModule.h2
-rw-r--r--camera/JpegCompressor.cpp2
-rwxr-xr-xcamera/PreviewWindow.cpp2
-rwxr-xr-xcamera/QemuClient.cpp2
-rw-r--r--camera/Thumbnail.cpp2
-rw-r--r--camera/WorkerThread.cpp2
-rw-r--r--camera/fake-pipeline2/JpegCompressor.cpp5
-rw-r--r--camera/fake-pipeline2/Scene.cpp6
-rw-r--r--camera/fake-pipeline2/Scene.h2
-rw-r--r--camera/fake-pipeline2/Sensor.cpp8
-rw-r--r--camera/jpeg-stub/Compressor.cpp2
-rw-r--r--camera/jpeg-stub/JpegStub.cpp2
-rw-r--r--camera/qemu-pipeline3/QemuSensor.cpp14
-rw-r--r--hwcomposer/hwcomposer.cpp21
36 files changed, 89 insertions, 135 deletions
diff --git a/camera/CallbackNotifier.cpp b/camera/CallbackNotifier.cpp
index e7fea45a..fca2a80d 100755
--- a/camera/CallbackNotifier.cpp
+++ b/camera/CallbackNotifier.cpp
@@ -21,7 +21,7 @@
#define LOG_NDEBUG 0
#define LOG_TAG "EmulatedCamera_CallbackNotifier"
-#include <cutils/log.h>
+#include <log/log.h>
#include <MetadataBufferType.h>
#include "EmulatedCameraDevice.h"
#undef min
diff --git a/camera/Converters.cpp b/camera/Converters.cpp
index 4765bf2d..cb09946d 100755
--- a/camera/Converters.cpp
+++ b/camera/Converters.cpp
@@ -20,7 +20,7 @@
#define LOG_NDEBUG 0
#define LOG_TAG "EmulatedCamera_Converter"
-#include <cutils/log.h>
+#include <log/log.h>
#include "Converters.h"
#include "Alignment.h"
diff --git a/camera/EmulatedBaseCamera.cpp b/camera/EmulatedBaseCamera.cpp
index 5fe7d733..0b85dcfc 100644
--- a/camera/EmulatedBaseCamera.cpp
+++ b/camera/EmulatedBaseCamera.cpp
@@ -26,7 +26,7 @@
#define LOG_NDEBUG 0
#define LOG_TAG "EmulatedCamera_BaseCamera"
-#include <cutils/log.h>
+#include <log/log.h>
#include "EmulatedBaseCamera.h"
diff --git a/camera/EmulatedBaseCamera.h b/camera/EmulatedBaseCamera.h
index 3b8a6a09..abaed98d 100644
--- a/camera/EmulatedBaseCamera.h
+++ b/camera/EmulatedBaseCamera.h
@@ -52,7 +52,7 @@ class EmulatedBaseCamera {
*/
virtual status_t Initialize() = 0;
- /****************************************************************************
+ /****************************************************************************
* Camera API implementation
***************************************************************************/
diff --git a/camera/EmulatedCamera.cpp b/camera/EmulatedCamera.cpp
index fe4fcaec..b13a5c33 100755
--- a/camera/EmulatedCamera.cpp
+++ b/camera/EmulatedCamera.cpp
@@ -25,8 +25,8 @@
#define LOG_NDEBUG 0
#define LOG_TAG "EmulatedCamera_Camera"
-#include <cutils/log.h>
- #include <stdio.h>
+#include <log/log.h>
+#include <stdio.h>
#include "EmulatedCamera.h"
//#include "EmulatedFakeCameraDevice.h"
#include "Converters.h"
@@ -57,17 +57,6 @@ static void PrintParamDiff(const CameraParameters& current, const char* new_par)
#define PrintParamDiff(current, new_par) (void(0))
#endif /* DEBUG_PARAM */
-/* A helper routine that adds a value to the camera parameter.
- * Param:
- * param - Camera parameter to add a value to.
- * val - Value to add.
- * Return:
- * A new string containing parameter with the added value on success, or NULL on
- * a failure. If non-NULL string is returned, the caller is responsible for
- * freeing it with 'free'.
- */
-static char* AddValue(const char* param, const char* val);
-
/*
* Check if a given string |value| equals at least one of the strings in |list|
*/
@@ -495,7 +484,6 @@ status_t EmulatedCamera::takePicture()
{
ALOGV("%s", __FUNCTION__);
- status_t res;
int width, height;
uint32_t org_fmt;
@@ -1236,25 +1224,6 @@ const char EmulatedCamera::FACING_BACK[] = "back";
const char EmulatedCamera::FACING_FRONT[] = "front";
/****************************************************************************
- * Helper routines
- ***************************************************************************/
-
-static char* AddValue(const char* param, const char* val)
-{
- const size_t len1 = strlen(param);
- const size_t len2 = strlen(val);
- char* ret = reinterpret_cast<char*>(malloc(len1 + len2 + 2));
- ALOGE_IF(ret == NULL, "%s: Memory failure", __FUNCTION__);
- if (ret != NULL) {
- memcpy(ret, param, len1);
- ret[len1] = ',';
- memcpy(ret + len1 + 1, val, len2);
- ret[len1 + len2 + 1] = '\0';
- }
- return ret;
-}
-
-/****************************************************************************
* Parameter debugging helpers
***************************************************************************/
diff --git a/camera/EmulatedCamera2.cpp b/camera/EmulatedCamera2.cpp
index ea7424b6..72e1c07f 100644
--- a/camera/EmulatedCamera2.cpp
+++ b/camera/EmulatedCamera2.cpp
@@ -24,7 +24,7 @@
//#define LOG_NDEBUG 0
#define LOG_TAG "EmulatedCamera2_Camera"
-#include <cutils/log.h>
+#include <log/log.h>
#include "EmulatedCamera2.h"
#include "system/camera_metadata.h"
diff --git a/camera/EmulatedCamera3.cpp b/camera/EmulatedCamera3.cpp
index e9110cc1..0cc373ae 100644
--- a/camera/EmulatedCamera3.cpp
+++ b/camera/EmulatedCamera3.cpp
@@ -24,7 +24,7 @@
//#define LOG_NDEBUG 0
#define LOG_TAG "EmulatedCamera3_Camera"
-#include <cutils/log.h>
+#include <log/log.h>
#include "EmulatedCamera3.h"
#include "system/camera_metadata.h"
diff --git a/camera/EmulatedCameraDevice.cpp b/camera/EmulatedCameraDevice.cpp
index 31e2affd..f1aced41 100755
--- a/camera/EmulatedCameraDevice.cpp
+++ b/camera/EmulatedCameraDevice.cpp
@@ -25,7 +25,7 @@
#define LOG_NDEBUG 0
#define LOG_TAG "EmulatedCamera_Device"
-#include <cutils/log.h>
+#include <log/log.h>
#include <sys/select.h>
#include <cmath>
#include "Alignment.h"
diff --git a/camera/EmulatedCameraFactory.cpp b/camera/EmulatedCameraFactory.cpp
index cf26a9e5..414289a4 100755
--- a/camera/EmulatedCameraFactory.cpp
+++ b/camera/EmulatedCameraFactory.cpp
@@ -30,7 +30,7 @@
#include "EmulatedQemuCamera.h"
#include "EmulatedQemuCamera3.h"
-#include <cutils/log.h>
+#include <log/log.h>
#include <cutils/properties.h>
extern camera_module_t HAL_MODULE_INFO_SYM;
@@ -580,7 +580,7 @@ void EmulatedCameraFactory::onStatusChanged(int cameraId, int newStatus) {
// Entry point for camera HAL API.
struct hw_module_methods_t EmulatedCameraFactory::mCameraModuleMethods = {
- open: EmulatedCameraFactory::device_open
+ .open = EmulatedCameraFactory::device_open
};
}; // end of namespace android
diff --git a/camera/EmulatedCameraFactory.h b/camera/EmulatedCameraFactory.h
index fe70401e..4091bfc1 100755
--- a/camera/EmulatedCameraFactory.h
+++ b/camera/EmulatedCameraFactory.h
@@ -27,7 +27,7 @@
namespace android {
-struct EmulatedCameraHotplugThread;
+class EmulatedCameraHotplugThread;
/*
* Contains declaration of a class EmulatedCameraFactory that manages cameras
diff --git a/camera/EmulatedCameraHal.cpp b/camera/EmulatedCameraHal.cpp
index b1f8b3a6..f60b0d20 100755
--- a/camera/EmulatedCameraHal.cpp
+++ b/camera/EmulatedCameraHal.cpp
@@ -29,20 +29,20 @@
* Required HAL header.
*/
camera_module_t HAL_MODULE_INFO_SYM = {
- common: {
- tag: HARDWARE_MODULE_TAG,
- module_api_version: CAMERA_MODULE_API_VERSION_2_3,
- hal_api_version: HARDWARE_HAL_API_VERSION,
- id: CAMERA_HARDWARE_MODULE_ID,
- name: "Emulated Camera Module",
- author: "The Android Open Source Project",
- methods: &android::EmulatedCameraFactory::mCameraModuleMethods,
- dso: NULL,
- reserved: {0},
+ .common = {
+ .tag = HARDWARE_MODULE_TAG,
+ .module_api_version = CAMERA_MODULE_API_VERSION_2_3,
+ .hal_api_version = HARDWARE_HAL_API_VERSION,
+ .id = CAMERA_HARDWARE_MODULE_ID,
+ .name = "Emulated Camera Module",
+ .author = "The Android Open Source Project",
+ .methods = &android::EmulatedCameraFactory::mCameraModuleMethods,
+ .dso = NULL,
+ .reserved = {0},
},
- get_number_of_cameras: android::EmulatedCameraFactory::get_number_of_cameras,
- get_camera_info: android::EmulatedCameraFactory::get_camera_info,
- set_callbacks: android::EmulatedCameraFactory::set_callbacks,
- get_vendor_tag_ops: android::EmulatedCameraFactory::get_vendor_tag_ops,
- open_legacy: android::EmulatedCameraFactory::open_legacy
+ .get_number_of_cameras = android::EmulatedCameraFactory::get_number_of_cameras,
+ .get_camera_info = android::EmulatedCameraFactory::get_camera_info,
+ .set_callbacks = android::EmulatedCameraFactory::set_callbacks,
+ .get_vendor_tag_ops = android::EmulatedCameraFactory::get_vendor_tag_ops,
+ .open_legacy = android::EmulatedCameraFactory::open_legacy
};
diff --git a/camera/EmulatedCameraHotplugThread.cpp b/camera/EmulatedCameraHotplugThread.cpp
index de944296..f7782bef 100644
--- a/camera/EmulatedCameraHotplugThread.cpp
+++ b/camera/EmulatedCameraHotplugThread.cpp
@@ -15,7 +15,7 @@
*/
//#define LOG_NDEBUG 0
#define LOG_TAG "EmulatedCamera_HotplugThread"
-#include <cutils/log.h>
+#include <log/log.h>
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/camera/EmulatedFakeCamera.cpp b/camera/EmulatedFakeCamera.cpp
index ff19fd07..bf41fb62 100755
--- a/camera/EmulatedFakeCamera.cpp
+++ b/camera/EmulatedFakeCamera.cpp
@@ -21,7 +21,7 @@
#define LOG_NDEBUG 0
#define LOG_TAG "EmulatedCamera_FakeCamera"
-#include <cutils/log.h>
+#include <log/log.h>
#include <cutils/properties.h>
#include "EmulatedFakeCamera.h"
#include "EmulatedCameraFactory.h"
diff --git a/camera/EmulatedFakeCamera2.cpp b/camera/EmulatedFakeCamera2.cpp
index dad384cc..6bff5eb0 100644
--- a/camera/EmulatedFakeCamera2.cpp
+++ b/camera/EmulatedFakeCamera2.cpp
@@ -23,7 +23,7 @@
//#define LOG_NDEBUG 0
#define LOG_TAG "EmulatedCamera_FakeCamera2"
-#include <utils/Log.h>
+#include <log/log.h>
#include "EmulatedFakeCamera2.h"
#include "EmulatedCameraFactory.h"
@@ -114,8 +114,8 @@ status_t EmulatedFakeCamera2::Initialize() {
int32_t width = 0, height = 0;
size_t rawSizeCount = sizeof(kAvailableRawSizes)/sizeof(kAvailableRawSizes[0]);
for (size_t index = 0; index + 1 < rawSizeCount; index += 2) {
- if (width <= kAvailableRawSizes[index] &&
- height <= kAvailableRawSizes[index+1]) {
+ if (width <= (int32_t)kAvailableRawSizes[index] &&
+ height <= (int32_t)kAvailableRawSizes[index+1]) {
width = kAvailableRawSizes[index];
height = kAvailableRawSizes[index+1];
}
@@ -377,7 +377,6 @@ int EmulatedFakeCamera2::allocateStream(
if (format != HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED) {
unsigned int numFormats = sizeof(kAvailableFormats) / sizeof(uint32_t);
unsigned int formatIdx = 0;
- unsigned int sizeOffsetIdx = 0;
for (; formatIdx < numFormats; formatIdx++) {
if (format == (int)kAvailableFormats[formatIdx]) break;
}
@@ -1789,8 +1788,6 @@ bool EmulatedFakeCamera2::ControlThread::threadLoop() {
mLockAfterPassiveScan = false;
}
- uint8_t oldAfState = afState;
-
if (afTriggered) {
afState = processAfTrigger(afMode, afState);
}
@@ -2090,7 +2087,7 @@ status_t EmulatedFakeCamera2::constructStaticInfo(
// 5 m hyperfocal distance for back camera, infinity (fixed focus) for front
const float hyperFocalDistance = mFacingBack ? 1.0/5.0 : 0.0;
ADD_OR_SIZE(ANDROID_LENS_INFO_HYPERFOCAL_DISTANCE,
- &minFocusDistance, 1);
+ &hyperFocalDistance, 1);
static const float focalLength = 3.30f; // mm
ADD_OR_SIZE(ANDROID_LENS_INFO_AVAILABLE_FOCAL_LENGTHS,
@@ -2679,7 +2676,6 @@ status_t EmulatedFakeCamera2::addOrSize(camera_metadata_t *request,
uint32_t tag,
const void *entryData,
size_t entryDataCount) {
- status_t res;
if (!sizeRequest) {
return add_camera_metadata_entry(request, tag, entryData,
entryDataCount);
diff --git a/camera/EmulatedFakeCamera3.cpp b/camera/EmulatedFakeCamera3.cpp
index 296d06e9..4330c026 100644
--- a/camera/EmulatedFakeCamera3.cpp
+++ b/camera/EmulatedFakeCamera3.cpp
@@ -25,7 +25,7 @@
//#define LOG_NNDEBUG 0
#define LOG_TAG "EmulatedCamera_FakeCamera3"
#include <cutils/properties.h>
-#include <utils/Log.h>
+#include <log/log.h>
#include "EmulatedFakeCamera3.h"
#include "EmulatedCameraFactory.h"
@@ -53,7 +53,6 @@ namespace android {
const int64_t USEC = 1000LL;
const int64_t MSEC = USEC * 1000LL;
-const int64_t SEC = MSEC * 1000LL;
const int32_t EmulatedFakeCamera3::kAvailableFormats[] = {
HAL_PIXEL_FORMAT_RAW16,
@@ -292,8 +291,10 @@ status_t EmulatedFakeCamera3::configureStreams(
}
}
- if (newStream->width <= 0 || newStream->width > mSensorWidth ||
- newStream->height <= 0 || newStream->height > mSensorHeight) {
+ if (newStream->width <= 0 ||
+ (int32_t)newStream->width > mSensorWidth ||
+ newStream->height <= 0 ||
+ (int32_t)newStream->height > mSensorHeight) {
ALOGE("%s: Unsupported stream width 0x%x height 0x%x",
__FUNCTION__, newStream->width, newStream->height);
return BAD_VALUE;
@@ -1158,8 +1159,8 @@ status_t EmulatedFakeCamera3::constructStaticInfo() {
int32_t width = 0, height = 0;
size_t rawSizeCount = sizeof(kAvailableRawSizes)/sizeof(kAvailableRawSizes[0]);
for (size_t index = 0; index + 1 < rawSizeCount; index += 2) {
- if (width <= kAvailableRawSizes[index] &&
- height <= kAvailableRawSizes[index+1]) {
+ if (width <= (int32_t)kAvailableRawSizes[index] &&
+ height <= (int32_t)kAvailableRawSizes[index+1]) {
width = kAvailableRawSizes[index];
height = kAvailableRawSizes[index+1];
}
@@ -1940,8 +1941,6 @@ status_t EmulatedFakeCamera3::process3A(CameraMetadata &settings) {
*/
status_t res;
- bool facePriority = false;
-
camera_metadata_entry e;
e = settings.find(ANDROID_CONTROL_MODE);
diff --git a/camera/EmulatedFakeCameraDevice.cpp b/camera/EmulatedFakeCameraDevice.cpp
index 747c55a7..85f0e795 100755
--- a/camera/EmulatedFakeCameraDevice.cpp
+++ b/camera/EmulatedFakeCameraDevice.cpp
@@ -21,7 +21,7 @@
#define LOG_NDEBUG 0
#define LOG_TAG "EmulatedCamera_FakeDevice"
-#include <cutils/log.h>
+#include <log/log.h>
#include "EmulatedFakeCamera.h"
#include "EmulatedFakeCameraDevice.h"
diff --git a/camera/EmulatedFakeRotatingCameraDevice.cpp b/camera/EmulatedFakeRotatingCameraDevice.cpp
index 0e54b6ca..fc1951ea 100755
--- a/camera/EmulatedFakeRotatingCameraDevice.cpp
+++ b/camera/EmulatedFakeRotatingCameraDevice.cpp
@@ -23,7 +23,7 @@
#define LOG_NDEBUG 0
#define LOG_TAG "EmulatedCamera_FakeDevice"
#define FAKE_CAMERA_SENSOR "FakeRotatingCameraSensor"
-#include <cutils/log.h>
+#include <log/log.h>
#include "EmulatedFakeCamera.h"
#include "EmulatedFakeRotatingCameraDevice.h"
#include "qemud.h"
@@ -94,7 +94,6 @@ static void rgba8888_to_nv21(uint8_t* input, uint8_t* output, int width, int hei
static void nv21_to_rgba8888(uint8_t* input, uint32_t * output, int width, int height) {
int align = 16;
- uint32_t* output0 = output;
int yStride = (width + (align -1)) & ~(align-1);
uint8_t* inputVU = input + height*yStride;
uint8_t Y, U, V;
@@ -117,8 +116,6 @@ void EmulatedFakeRotatingCameraDevice::render(int width, int height)
{
update_scene((float)width, (float)height);
create_texture_dotx(1280, 720);
- int i, j;
- int quads = 1;
int w= 992/2;
int h = 1280/2;
@@ -402,7 +399,6 @@ int EmulatedFakeRotatingCameraDevice::init_gl_surface(int width, int height)
checkEglError("eglQuerySurface");
eglQuerySurface(mEglDisplay, mEglSurface, EGL_HEIGHT, &h);
checkEglError("eglQuerySurface");
- GLint dim = w < h ? w : h;
ALOGD("Window dimensions: %d x %d\n", w, h);
diff --git a/camera/EmulatedQemuCamera.cpp b/camera/EmulatedQemuCamera.cpp
index 496954b6..d08baad9 100755
--- a/camera/EmulatedQemuCamera.cpp
+++ b/camera/EmulatedQemuCamera.cpp
@@ -21,7 +21,7 @@
#define LOG_NDEBUG 0
#define LOG_TAG "EmulatedCamera_QemuCamera"
-#include <cutils/log.h>
+#include <log/log.h>
#include "EmulatedQemuCamera.h"
#include "EmulatedCameraFactory.h"
diff --git a/camera/EmulatedQemuCamera2.cpp b/camera/EmulatedQemuCamera2.cpp
index 2c94f0e3..77d8ff82 100644
--- a/camera/EmulatedQemuCamera2.cpp
+++ b/camera/EmulatedQemuCamera2.cpp
@@ -22,7 +22,7 @@
#define LOG_NDEBUG 0
#define LOG_TAG "EmulatedCamera_QemuCamera2"
-#include <cutils/log.h>
+#include <log/log.h>
#include <cutils/properties.h>
#include "EmulatedQemuCamera2.h"
#include "EmulatedCameraFactory.h"
diff --git a/camera/EmulatedQemuCamera3.cpp b/camera/EmulatedQemuCamera3.cpp
index 123ab1ce..7cc3d869 100644
--- a/camera/EmulatedQemuCamera3.cpp
+++ b/camera/EmulatedQemuCamera3.cpp
@@ -42,7 +42,7 @@
#include <inttypes.h>
#include <sstream>
#include <ui/Fence.h>
-#include <utils/Log.h>
+#include <log/log.h>
#include <vector>
namespace android {
@@ -53,7 +53,6 @@ namespace android {
const int64_t USEC = 1000LL;
const int64_t MSEC = USEC * 1000LL;
-const int64_t SEC = MSEC * 1000LL;
const int32_t EmulatedQemuCamera3::kAvailableFormats[] = {
HAL_PIXEL_FORMAT_BLOB,
@@ -165,7 +164,8 @@ void EmulatedQemuCamera3::parseResolutions(const char *frameDims) {
// Remove any resolution with a dimension exceeding the sensor size.
for (auto res = mResolutions.begin(); res != mResolutions.end(); ) {
- if (res->first > mSensorWidth || res->second > mSensorHeight) {
+ if (res->first > (int32_t)mSensorWidth ||
+ res->second > (int32_t)mSensorHeight) {
// Width and/or height larger than sensor. Remove it.
res = mResolutions.erase(res);
} else {
@@ -1630,8 +1630,6 @@ status_t EmulatedQemuCamera3::process3A(CameraMetadata &settings) {
*/
status_t res;
- bool facePriority = false;
-
camera_metadata_entry e;
e = settings.find(ANDROID_CONTROL_MODE);
diff --git a/camera/EmulatedQemuCameraDevice.cpp b/camera/EmulatedQemuCameraDevice.cpp
index 0ff6df2c..c416454a 100755
--- a/camera/EmulatedQemuCameraDevice.cpp
+++ b/camera/EmulatedQemuCameraDevice.cpp
@@ -21,7 +21,7 @@
#define LOG_NDEBUG 0
#define LOG_TAG "EmulatedCamera_QemuDevice"
-#include <cutils/log.h>
+#include <log/log.h>
#include "EmulatedQemuCamera.h"
#include "EmulatedQemuCameraDevice.h"
diff --git a/camera/Exif.cpp b/camera/Exif.cpp
index f7f85f50..0f451ffd 100644
--- a/camera/Exif.cpp
+++ b/camera/Exif.cpp
@@ -16,7 +16,7 @@
//#define LOG_NDEBUG 0
#define LOG_TAG "EmulatedCamera_Exif"
-#include <cutils/log.h>
+#include <log/log.h>
#include <cutils/properties.h>
#include <inttypes.h>
@@ -151,12 +151,12 @@ static bool createEntry(ExifData* exifData,
// Create an entry and place it in |exifData|, the entry is initialized with a
// single byte in |value|
-static bool createEntry(ExifData* exifData,
- ExifIfd ifd,
- int tag,
- uint8_t value) {
- return createEntry(exifData, ifd, tag, &value, 1, EXIF_FORMAT_BYTE);
-}
+//static bool createEntry(ExifData* exifData,
+// ExifIfd ifd,
+// int tag,
+// uint8_t value) {
+// return createEntry(exifData, ifd, tag, &value, 1, EXIF_FORMAT_BYTE);
+//}
// Create an entry and place it in |exifData|, the entry is default initialized
// by the exif library based on |tag|
diff --git a/camera/GrallocModule.h b/camera/GrallocModule.h
index 72b63222..c6d48400 100644
--- a/camera/GrallocModule.h
+++ b/camera/GrallocModule.h
@@ -2,7 +2,7 @@
#define EMU_CAMERA_GRALLOC_MODULE_H
#include <hardware/gralloc.h>
-#include <utils/Log.h>
+#include <log/log.h>
class GrallocModule
{
diff --git a/camera/JpegCompressor.cpp b/camera/JpegCompressor.cpp
index d757a3de..3a5b15e1 100644
--- a/camera/JpegCompressor.cpp
+++ b/camera/JpegCompressor.cpp
@@ -21,7 +21,7 @@
#define LOG_NDEBUG 0
#define LOG_TAG "EmulatedCamera_JPEG"
-#include <cutils/log.h>
+#include <log/log.h>
#include <assert.h>
#include <dlfcn.h>
#include "JpegCompressor.h"
diff --git a/camera/PreviewWindow.cpp b/camera/PreviewWindow.cpp
index 4c7ee24e..aad54e24 100755
--- a/camera/PreviewWindow.cpp
+++ b/camera/PreviewWindow.cpp
@@ -21,7 +21,7 @@
#define LOG_NDEBUG 0
#define LOG_TAG "EmulatedCamera_Preview"
-#include <cutils/log.h>
+#include <log/log.h>
#include "EmulatedCameraDevice.h"
#include "PreviewWindow.h"
#include "GrallocModule.h"
diff --git a/camera/QemuClient.cpp b/camera/QemuClient.cpp
index f5cfe6bc..18beb693 100755
--- a/camera/QemuClient.cpp
+++ b/camera/QemuClient.cpp
@@ -21,7 +21,7 @@
#define LOG_NDEBUG 1
#define LOG_TAG "EmulatedCamera_QemuClient"
-#include <cutils/log.h>
+#include <log/log.h>
#include "EmulatedCamera.h"
#include "QemuClient.h"
diff --git a/camera/Thumbnail.cpp b/camera/Thumbnail.cpp
index 4d66f106..8f901a31 100644
--- a/camera/Thumbnail.cpp
+++ b/camera/Thumbnail.cpp
@@ -18,7 +18,7 @@
#define LOG_NDEBUG 0
#define LOG_TAG "EmulatedCamera_Thumbnail"
-#include <cutils/log.h>
+#include <log/log.h>
#include <libexif/exif-data.h>
#include <libyuv.h>
diff --git a/camera/WorkerThread.cpp b/camera/WorkerThread.cpp
index 2b5fe922..42505a34 100644
--- a/camera/WorkerThread.cpp
+++ b/camera/WorkerThread.cpp
@@ -18,7 +18,7 @@
#define LOG_NDEBUG 0
#define LOG_TAG "EmulatedCamera_WorkerThread"
-#include <cutils/log.h>
+#include <log/log.h>
#include <algorithm>
diff --git a/camera/fake-pipeline2/JpegCompressor.cpp b/camera/fake-pipeline2/JpegCompressor.cpp
index f4952b2f..51de0c02 100644
--- a/camera/fake-pipeline2/JpegCompressor.cpp
+++ b/camera/fake-pipeline2/JpegCompressor.cpp
@@ -17,7 +17,7 @@
//#define LOG_NDEBUG 0
#define LOG_TAG "EmulatedCamera2_JpegCompressor"
-#include <utils/Log.h>
+#include <log/log.h>
#include "gralloc_cb.h"
#include "JpegCompressor.h"
@@ -131,7 +131,7 @@ bool JpegCompressor::threadLoop() {
status_t JpegCompressor::compress() {
// Find source and target buffers. Assumes only one buffer matches
// each condition!
- bool foundJpeg = false, mFoundAux = false;
+ bool mFoundAux = false;
int thumbWidth = 0, thumbHeight = 0;
unsigned char thumbJpegQuality = 90;
unsigned char jpegQuality = 90;
@@ -223,7 +223,6 @@ bool JpegCompressor::waitForDone(nsecs_t timeout) {
}
void JpegCompressor::cleanUp() {
- status_t res;
Mutex::Autolock lock(mBusyMutex);
if (mFoundAux) {
diff --git a/camera/fake-pipeline2/Scene.cpp b/camera/fake-pipeline2/Scene.cpp
index 81dcd319..0fea38e9 100644
--- a/camera/fake-pipeline2/Scene.cpp
+++ b/camera/fake-pipeline2/Scene.cpp
@@ -16,7 +16,7 @@
//#define LOG_NDEBUG 0
#define LOG_TAG "EmulatedCamera_Scene"
-#include <utils/Log.h>
+#include <log/log.h>
#include <stdlib.h>
#include <cmath>
#include "Scene.h"
@@ -87,8 +87,8 @@ Scene::Scene(
mSensorWidth(sensorWidthPx),
mSensorHeight(sensorHeightPx),
mHour(12),
- mExposureDuration(0.033f),
- mSensorSensitivity(sensorSensitivity)
+ mExposureDuration(0.033f)
+ //mSensorSensitivity(sensorSensitivity)
{
// Map scene to sensor pixels
if (mSensorWidth > mSensorHeight) {
diff --git a/camera/fake-pipeline2/Scene.h b/camera/fake-pipeline2/Scene.h
index 66d1a69c..3a7a001a 100644
--- a/camera/fake-pipeline2/Scene.h
+++ b/camera/fake-pipeline2/Scene.h
@@ -108,7 +108,7 @@ class Scene {
int mHour;
float mExposureDuration;
- float mSensorSensitivity;
+ //float mSensorSensitivity;
enum Materials {
GRASS = 0,
diff --git a/camera/fake-pipeline2/Sensor.cpp b/camera/fake-pipeline2/Sensor.cpp
index b4800224..c5552754 100644
--- a/camera/fake-pipeline2/Sensor.cpp
+++ b/camera/fake-pipeline2/Sensor.cpp
@@ -24,7 +24,7 @@
#define ALOGVV(...) ((void)0)
#endif
-#include <utils/Log.h>
+#include <log/log.h>
#include "../EmulatedFakeCamera2.h"
#include "Sensor.h"
@@ -190,7 +190,6 @@ bool Sensor::waitForVSync(nsecs_t reltime) {
bool Sensor::waitForNewFrame(nsecs_t reltime,
nsecs_t *captureTime) {
Mutex::Autolock lock(mReadoutMutex);
- uint8_t *ret;
if (mCapturedBuffers == NULL) {
int res;
res = mReadoutAvailable.waitRelative(mReadoutMutex, reltime);
@@ -270,8 +269,6 @@ bool Sensor::threadLoop() {
// time on that.
nsecs_t simulatedTime = startRealTime;
nsecs_t frameEndRealTime = startRealTime + frameDuration;
- nsecs_t frameReadoutEndRealTime = startRealTime +
- mRowReadoutTime * mResolution[1];
if (mNextCapturedBuffers != NULL) {
ALOGVV("Sensor starting readout");
@@ -380,9 +377,8 @@ bool Sensor::threadLoop() {
ret = nanosleep(&t, &t);
} while (ret != 0);
}
- nsecs_t endRealTime = systemTime();
ALOGVV("Frame cycle took %d ms, target %d ms",
- (int)((endRealTime - startRealTime)/1000000),
+ (int)((systemTime() - startRealTime)/1000000),
(int)(frameDuration / 1000000));
return true;
};
diff --git a/camera/jpeg-stub/Compressor.cpp b/camera/jpeg-stub/Compressor.cpp
index 76c4a246..3fe0bd6c 100644
--- a/camera/jpeg-stub/Compressor.cpp
+++ b/camera/jpeg-stub/Compressor.cpp
@@ -18,7 +18,7 @@
#define LOG_NDEBUG 0
#define LOG_TAG "EmulatedCamera_JPEGStub_Compressor"
-#include <cutils/log.h>
+#include <log/log.h>
#include <libexif/exif-data.h>
Compressor::Compressor() {
diff --git a/camera/jpeg-stub/JpegStub.cpp b/camera/jpeg-stub/JpegStub.cpp
index 1eef9e2c..3e02de06 100644
--- a/camera/jpeg-stub/JpegStub.cpp
+++ b/camera/jpeg-stub/JpegStub.cpp
@@ -19,7 +19,7 @@
#define LOG_NDEBUG 0
#define LOG_TAG "EmulatedCamera_JPEGStub"
#include <errno.h>
-#include <cutils/log.h>
+#include <log/log.h>
#include <stdlib.h>
#include "Compressor.h"
diff --git a/camera/qemu-pipeline3/QemuSensor.cpp b/camera/qemu-pipeline3/QemuSensor.cpp
index d52bffd4..529bf961 100644
--- a/camera/qemu-pipeline3/QemuSensor.cpp
+++ b/camera/qemu-pipeline3/QemuSensor.cpp
@@ -34,7 +34,7 @@
#include <cmath>
#include <cstdlib>
#include <linux/videodev2.h>
-#include <utils/Log.h>
+#include <log/log.h>
namespace android {
@@ -55,8 +55,8 @@ QemuSensor::QemuSensor(const char *deviceName, uint32_t width, uint32_t height):
mLastRequestWidth(-1),
mLastRequestHeight(-1),
mCameraQemuClient(),
- mGotVSync(false),
mDeviceName(deviceName),
+ mGotVSync(false),
mFrameDuration(kFrameDurationRange[0]),
mNextBuffers(nullptr),
mFrameNumber(0),
@@ -153,7 +153,6 @@ bool QemuSensor::waitForVSync(nsecs_t reltime) {
bool QemuSensor::waitForNewFrame(nsecs_t reltime, nsecs_t *captureTime) {
Mutex::Autolock lock(mReadoutMutex);
- uint8_t *ret;
if (mCapturedBuffers == nullptr) {
int res;
res = mReadoutAvailable.waitRelative(mReadoutMutex, reltime);
@@ -336,9 +335,8 @@ bool QemuSensor::threadLoop() {
ret = nanosleep(&t, &t);
} while (ret != 0);
}
- nsecs_t endRealTime = systemTime();
ALOGVV("Frame cycle took %d ms, target %d ms",
- (int) ((endRealTime - startRealTime) / 1000000),
+ (int) ((systemTime() - startRealTime) / 1000000),
(int) (frameDuration / 1000000));
return true;
}
@@ -346,7 +344,8 @@ bool QemuSensor::threadLoop() {
void QemuSensor::captureRGBA(uint8_t *img, uint32_t width, uint32_t height,
uint32_t stride, int64_t *timestamp) {
status_t res;
- if (width != mLastRequestWidth || height != mLastRequestHeight) {
+ if (width != (uint32_t)mLastRequestWidth ||
+ height != (uint32_t)mLastRequestHeight) {
ALOGI("%s: Dimensions for the current request (%dx%d) differ "
"from the previous request (%dx%d). Restarting camera",
__FUNCTION__, width, height, mLastRequestWidth,
@@ -414,7 +413,8 @@ void QemuSensor::captureRGB(uint8_t *img, uint32_t width, uint32_t height, uint3
void QemuSensor::captureNV21(uint8_t *img, uint32_t width, uint32_t height, uint32_t stride, int64_t *timestamp) {
status_t res;
- if (width != mLastRequestWidth || height != mLastRequestHeight) {
+ if (width != (uint32_t)mLastRequestWidth ||
+ height != (uint32_t)mLastRequestHeight) {
ALOGI("%s: Dimensions for the current request (%dx%d) differ "
"from the previous request (%dx%d). Restarting camera",
__FUNCTION__, width, height, mLastRequestWidth,
diff --git a/hwcomposer/hwcomposer.cpp b/hwcomposer/hwcomposer.cpp
index 702527fd..cc0dc66f 100644
--- a/hwcomposer/hwcomposer.cpp
+++ b/hwcomposer/hwcomposer.cpp
@@ -271,7 +271,8 @@ static void* hwc_vsync_thread(void* data) {
int64_t timestamp = int64_t(rt.tv_sec) * 1e9 + rt.tv_nsec;
pdev->procs->vsync(pdev->procs, 0, timestamp);
if (rt.tv_sec - last_logged >= log_interval) {
- ALOGD("hw_composer sent %d syncs in %ds", sent - last_sent, rt.tv_sec - last_logged);
+ ALOGD("hw_composer sent %d syncs in %ds", (uint32_t)(sent - last_sent),
+ (uint32_t)(rt.tv_sec - last_logged));
last_logged = rt.tv_sec;
last_sent = sent;
}
@@ -345,17 +346,17 @@ static int hwc_open(const struct hw_module_t* module, const char* name,
static struct hw_module_methods_t hwc_module_methods = {
- open: hwc_open,
+ .open = hwc_open,
};
hwc_module_t HAL_MODULE_INFO_SYM = {
- common: {
- tag: HARDWARE_MODULE_TAG,
- module_api_version: HWC_MODULE_API_VERSION_0_1,
- hal_api_version: HARDWARE_HAL_API_VERSION,
- id: HWC_HARDWARE_MODULE_ID,
- name: "Android Emulator hwcomposer module",
- author: "The Android Open Source Project",
- methods: &hwc_module_methods,
+ .common = {
+ .tag = HARDWARE_MODULE_TAG,
+ .module_api_version = HWC_MODULE_API_VERSION_0_1,
+ .hal_api_version = HARDWARE_HAL_API_VERSION,
+ .id = HWC_HARDWARE_MODULE_ID,
+ .name = "Android Emulator hwcomposer module",
+ .author = "The Android Open Source Project",
+ .methods = &hwc_module_methods,
}
};