summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice/device3
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2014-03-21 15:04:25 -0700
committerColin Cross <ccross@android.com>2014-03-21 15:04:25 -0700
commite5729fac81c8a984e984fefc90afc64135817d4f (patch)
tree526e94e71d66a2cf8faac48c16716bf3c757a2a6 /services/camera/libcameraservice/device3
parent24e1bd71ac6850d9062b3bd803b37c0e92f69c7a (diff)
downloadframeworks_av-e5729fac81c8a984e984fefc90afc64135817d4f.zip
frameworks_av-e5729fac81c8a984e984fefc90afc64135817d4f.tar.gz
frameworks_av-e5729fac81c8a984e984fefc90afc64135817d4f.tar.bz2
libcameraservice: fix 64-bit print format warnings
Use PRId64 from inttypes.h to print nsecs_t (int64_t) Use %zu to print size_t Change-Id: I135620e0388db33587a8a7da393b48a45cb7275a
Diffstat (limited to 'services/camera/libcameraservice/device3')
-rw-r--r--services/camera/libcameraservice/device3/Camera3Device.cpp16
-rw-r--r--services/camera/libcameraservice/device3/Camera3IOStreamBase.cpp11
-rw-r--r--services/camera/libcameraservice/device3/Camera3Stream.cpp2
-rw-r--r--services/camera/libcameraservice/device3/Camera3ZslStream.cpp4
-rw-r--r--services/camera/libcameraservice/device3/StatusTracker.cpp5
5 files changed, 19 insertions, 19 deletions
diff --git a/services/camera/libcameraservice/device3/Camera3Device.cpp b/services/camera/libcameraservice/device3/Camera3Device.cpp
index 3dbc1b0..7e11a3b 100644
--- a/services/camera/libcameraservice/device3/Camera3Device.cpp
+++ b/services/camera/libcameraservice/device3/Camera3Device.cpp
@@ -37,6 +37,8 @@
"%s: " fmt, __FUNCTION__, \
##__VA_ARGS__)
+#include <inttypes.h>
+
#include <utils/Log.h>
#include <utils/Trace.h>
#include <utils/Timers.h>
@@ -345,7 +347,7 @@ status_t Camera3Device::dump(int fd, const Vector<String16> &args) {
} else {
for (size_t i = 0; i < mInFlightMap.size(); i++) {
InFlightRequest r = mInFlightMap.valueAt(i);
- lines.appendFormat(" Frame %d | Timestamp: %lld, metadata"
+ lines.appendFormat(" Frame %d | Timestamp: %" PRId64 ", metadata"
" arrived: %s, buffers left: %d\n", mInFlightMap.keyAt(i),
r.captureTimestamp, r.haveResultMetadata ? "true" : "false",
r.numBuffersLeft);
@@ -676,7 +678,7 @@ status_t Camera3Device::createStream(sp<ANativeWindow> consumer,
ATRACE_CALL();
Mutex::Autolock il(mInterfaceLock);
Mutex::Autolock l(mLock);
- ALOGV("Camera %d: Creating new stream %d: %d x %d, format %d, size %d",
+ ALOGV("Camera %d: Creating new stream %d: %d x %d, format %d, size %zu",
mId, mNextStreamId, width, height, format, size);
status_t res;
@@ -1018,7 +1020,7 @@ status_t Camera3Device::waitForNextFrame(nsecs_t timeout) {
if (res == TIMED_OUT) {
return res;
} else if (res != OK) {
- ALOGW("%s: Camera %d: No frame in %lld ns: %s (%d)",
+ ALOGW("%s: Camera %d: No frame in %" PRId64 " ns: %s (%d)",
__FUNCTION__, mId, timeout, strerror(-res), res);
return res;
}
@@ -1673,7 +1675,7 @@ void Camera3Device::processCaptureResult(const camera3_capture_result *result) {
// Sanity check - if we have too many in-flight frames, something has
// likely gone wrong
if (mInFlightMap.size() > kInFlightWarnLimit) {
- CLOGE("In-flight list too large: %d", mInFlightMap.size());
+ CLOGE("In-flight list too large: %zu", mInFlightMap.size());
}
}
@@ -1723,7 +1725,7 @@ void Camera3Device::processCaptureResult(const camera3_capture_result *result) {
gotResult = false;
} else if (timestamp != entry.data.i64[0]) {
SET_ERR("Timestamp mismatch between shutter notify and result"
- " metadata for frame %d (%lld vs %lld respectively)",
+ " metadata for frame %d (%" PRId64 " vs %" PRId64 " respectively)",
frameNumber, timestamp, entry.data.i64[0]);
gotResult = false;
}
@@ -1745,7 +1747,7 @@ void Camera3Device::processCaptureResult(const camera3_capture_result *result) {
// Note: stream may be deallocated at this point, if this buffer was the
// last reference to it.
if (res != OK) {
- ALOGE("Can't return buffer %d for frame %d to its stream: "
+ ALOGE("Can't return buffer %zu for frame %d to its stream: "
" %s (%d)", i, frameNumber, strerror(-res), res);
}
}
@@ -1835,7 +1837,7 @@ void Camera3Device::notify(const camera3_notify_msg *msg) {
frameNumber);
break;
}
- ALOGVV("Camera %d: %s: Shutter fired for frame %d (id %d) at %lld",
+ ALOGVV("Camera %d: %s: Shutter fired for frame %d (id %d) at %" PRId64,
mId, __FUNCTION__, frameNumber, requestId, timestamp);
// Call listener, if any
if (listener != NULL) {
diff --git a/services/camera/libcameraservice/device3/Camera3IOStreamBase.cpp b/services/camera/libcameraservice/device3/Camera3IOStreamBase.cpp
index 42e02d8..d662cc2 100644
--- a/services/camera/libcameraservice/device3/Camera3IOStreamBase.cpp
+++ b/services/camera/libcameraservice/device3/Camera3IOStreamBase.cpp
@@ -18,8 +18,7 @@
#define ATRACE_TAG ATRACE_TAG_CAMERA
//#define LOG_NDEBUG 0
-// This is needed for stdint.h to define INT64_MAX in C++
-#define __STDC_LIMIT_MACROS
+#include <inttypes.h>
#include <utils/Log.h>
#include <utils/Trace.h>
@@ -54,8 +53,8 @@ Camera3IOStreamBase::~Camera3IOStreamBase() {
bool Camera3IOStreamBase::hasOutstandingBuffersLocked() const {
nsecs_t signalTime = mCombinedFence->getSignalTime();
- ALOGV("%s: Stream %d: Has %d outstanding buffers,"
- " buffer signal time is %lld",
+ ALOGV("%s: Stream %d: Has %zu outstanding buffers,"
+ " buffer signal time is %" PRId64,
__FUNCTION__, mId, mDequeuedBufferCount, signalTime);
if (mDequeuedBufferCount > 0 || signalTime == INT64_MAX) {
return true;
@@ -73,7 +72,7 @@ void Camera3IOStreamBase::dump(int fd, const Vector<String16> &args) const {
lines.appendFormat(" Max size: %zu\n", mMaxSize);
lines.appendFormat(" Usage: %d, max HAL buffers: %d\n",
camera3_stream::usage, camera3_stream::max_buffers);
- lines.appendFormat(" Frames produced: %d, last timestamp: %lld ns\n",
+ lines.appendFormat(" Frames produced: %d, last timestamp: %" PRId64 " ns\n",
mFrameCount, mLastTimestamp);
lines.appendFormat(" Total buffers: %zu, currently dequeued: %zu\n",
mTotalBufferCount, mDequeuedBufferCount);
@@ -119,7 +118,7 @@ status_t Camera3IOStreamBase::disconnectLocked() {
}
if (mDequeuedBufferCount > 0) {
- ALOGE("%s: Can't disconnect with %d buffers still dequeued!",
+ ALOGE("%s: Can't disconnect with %zu buffers still dequeued!",
__FUNCTION__, mDequeuedBufferCount);
return INVALID_OPERATION;
}
diff --git a/services/camera/libcameraservice/device3/Camera3Stream.cpp b/services/camera/libcameraservice/device3/Camera3Stream.cpp
index 6d2cf94..70406f1 100644
--- a/services/camera/libcameraservice/device3/Camera3Stream.cpp
+++ b/services/camera/libcameraservice/device3/Camera3Stream.cpp
@@ -353,7 +353,7 @@ status_t Camera3Stream::registerBuffersLocked(camera3_device *hal3Device) {
}
if (bufferIdx == bufferCount) {
// Got all buffers, register with HAL
- ALOGV("%s: Registering %d buffers with camera HAL",
+ ALOGV("%s: Registering %zu buffers with camera HAL",
__FUNCTION__, bufferCount);
ATRACE_BEGIN("camera3->register_stream_buffers");
res = hal3Device->ops->register_stream_buffers(hal3Device,
diff --git a/services/camera/libcameraservice/device3/Camera3ZslStream.cpp b/services/camera/libcameraservice/device3/Camera3ZslStream.cpp
index 1a54923..44d8188 100644
--- a/services/camera/libcameraservice/device3/Camera3ZslStream.cpp
+++ b/services/camera/libcameraservice/device3/Camera3ZslStream.cpp
@@ -18,6 +18,8 @@
#define ATRACE_TAG ATRACE_TAG_CAMERA
//#define LOG_NDEBUG 0
+#include <inttypes.h>
+
#include <utils/Log.h>
#include <utils/Trace.h>
#include "Camera3ZslStream.h"
@@ -297,7 +299,7 @@ status_t Camera3ZslStream::enqueueInputBufferByTimestamp(
if (actual != timestamp) {
ALOGW("%s: ZSL buffer candidate search didn't find an exact match --"
- " requested timestamp = %lld, actual timestamp = %lld",
+ " requested timestamp = %" PRId64 ", actual timestamp = %" PRId64,
__FUNCTION__, timestamp, actual);
}
diff --git a/services/camera/libcameraservice/device3/StatusTracker.cpp b/services/camera/libcameraservice/device3/StatusTracker.cpp
index ab5419f..723b5c2 100644
--- a/services/camera/libcameraservice/device3/StatusTracker.cpp
+++ b/services/camera/libcameraservice/device3/StatusTracker.cpp
@@ -18,9 +18,6 @@
#define ATRACE_TAG ATRACE_TAG_CAMERA
//#define LOG_NDEBUG 0
-// This is needed for stdint.h to define INT64_MAX in C++
-#define __STDC_LIMIT_MACROS
-
#include <utils/Log.h>
#include <utils/Trace.h>
#include <ui/Fence.h>
@@ -52,7 +49,7 @@ int StatusTracker::addComponent() {
ALOGV("%s: Adding new component %d", __FUNCTION__, id);
err = mStates.add(id, IDLE);
- ALOGE_IF(err < 0, "%s: Can't add new component %d: %s (%d)",
+ ALOGE_IF(err < 0, "%s: Can't add new component %d: %s (%zd)",
__FUNCTION__, id, strerror(-err), err);
}