diff options
Diffstat (limited to 'services/camera/libcameraservice/api1/client2')
8 files changed, 43 insertions, 34 deletions
diff --git a/services/camera/libcameraservice/api1/client2/CaptureSequencer.cpp b/services/camera/libcameraservice/api1/client2/CaptureSequencer.cpp index 8a4ce4e..f5c28ed 100644 --- a/services/camera/libcameraservice/api1/client2/CaptureSequencer.cpp +++ b/services/camera/libcameraservice/api1/client2/CaptureSequencer.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 <utils/Vector.h> @@ -585,8 +587,8 @@ CaptureSequencer::CaptureState CaptureSequencer::manageStandardCaptureWait( ALOGE("No timestamp field in capture frame!"); } if (entry.data.i64[0] != mCaptureTimestamp) { - ALOGW("Mismatched capture timestamps: Metadata frame %lld," - " captured buffer %lld", + ALOGW("Mismatched capture timestamps: Metadata frame %" PRId64 "," + " captured buffer %" PRId64, entry.data.i64[0], mCaptureTimestamp); } diff --git a/services/camera/libcameraservice/api1/client2/FrameProcessor.cpp b/services/camera/libcameraservice/api1/client2/FrameProcessor.cpp index 19acae4..dd5b27c 100644 --- a/services/camera/libcameraservice/api1/client2/FrameProcessor.cpp +++ b/services/camera/libcameraservice/api1/client2/FrameProcessor.cpp @@ -168,7 +168,7 @@ status_t FrameProcessor::processFaceDetect(const CameraMetadata &frame, continue; } if (faceScores[i] > 100) { - ALOGW("%s: Face index %d with out of range score %d", + ALOGW("%s: Face index %zu with out of range score %d", __FUNCTION__, i, faceScores[i]); } diff --git a/services/camera/libcameraservice/api1/client2/JpegCompressor.cpp b/services/camera/libcameraservice/api1/client2/JpegCompressor.cpp index 2f0c67d..9ecab71 100644 --- a/services/camera/libcameraservice/api1/client2/JpegCompressor.cpp +++ b/services/camera/libcameraservice/api1/client2/JpegCompressor.cpp @@ -197,7 +197,7 @@ void JpegCompressor::jpegErrorHandler(j_common_ptr cinfo) { void JpegCompressor::jpegInitDestination(j_compress_ptr cinfo) { ALOGV("%s", __FUNCTION__); JpegDestination *dest= static_cast<JpegDestination*>(cinfo->dest); - ALOGV("%s: Setting destination to %p, size %d", + ALOGV("%s: Setting destination to %p, size %zu", __FUNCTION__, dest->parent->mJpegBuffer->data, kMaxJpegSize); dest->next_output_byte = (JOCTET*)(dest->parent->mJpegBuffer->data); dest->free_in_buffer = kMaxJpegSize; @@ -213,7 +213,7 @@ boolean JpegCompressor::jpegEmptyOutputBuffer(j_compress_ptr /*cinfo*/) { void JpegCompressor::jpegTermDestination(j_compress_ptr cinfo) { (void) cinfo; // TODO: clean up ALOGV("%s", __FUNCTION__); - ALOGV("%s: Done writing JPEG data. %d bytes left in buffer", + ALOGV("%s: Done writing JPEG data. %zu bytes left in buffer", __FUNCTION__, cinfo->dest->free_in_buffer); } diff --git a/services/camera/libcameraservice/api1/client2/JpegProcessor.cpp b/services/camera/libcameraservice/api1/client2/JpegProcessor.cpp index ec81456..2de7a2b 100644 --- a/services/camera/libcameraservice/api1/client2/JpegProcessor.cpp +++ b/services/camera/libcameraservice/api1/client2/JpegProcessor.cpp @@ -241,7 +241,7 @@ status_t JpegProcessor::processNewCapture() { size_t heapSize = mCaptureHeap->getSize(); if (jpegSize > heapSize) { ALOGW("%s: JPEG image is larger than expected, truncating " - "(got %d, expected at most %d bytes)", + "(got %zu, expected at most %zu bytes)", __FUNCTION__, jpegSize, heapSize); jpegSize = heapSize; } @@ -335,13 +335,13 @@ size_t JpegProcessor::findJpegSize(uint8_t* jpegBuffer, size_t maxSize) { size_t offset = size - MARKER_LENGTH; uint8_t *end = jpegBuffer + offset; if (checkJpegStart(jpegBuffer) && checkJpegEnd(end)) { - ALOGV("Found JPEG transport header, img size %d", size); + ALOGV("Found JPEG transport header, img size %zu", size); return size; } else { ALOGW("Found JPEG transport header with bad Image Start/End"); } } else { - ALOGW("Found JPEG transport header with bad size %d", size); + ALOGW("Found JPEG transport header with bad size %zu", size); } } @@ -357,15 +357,15 @@ size_t JpegProcessor::findJpegSize(uint8_t* jpegBuffer, size_t maxSize) { segment_t *segment = (segment_t*)(jpegBuffer + size); uint8_t type = checkJpegMarker(segment->marker); if (type == 0) { // invalid marker, no more segments, begin JPEG data - ALOGV("JPEG stream found beginning at offset %d", size); + ALOGV("JPEG stream found beginning at offset %zu", size); break; } if (type == EOI || size > maxSize - sizeof(segment_t)) { - ALOGE("Got premature End before JPEG data, offset %d", size); + ALOGE("Got premature End before JPEG data, offset %zu", size); return 0; } size_t length = ntohs(segment->length); - ALOGV("JFIF Segment, type %x length %x", type, length); + ALOGV("JFIF Segment, type %x length %zx", type, length); size += length + MARKER_LENGTH; } @@ -385,10 +385,10 @@ size_t JpegProcessor::findJpegSize(uint8_t* jpegBuffer, size_t maxSize) { } if (size > maxSize) { - ALOGW("JPEG size %d too large, reducing to maxSize %d", size, maxSize); + ALOGW("JPEG size %zu too large, reducing to maxSize %zu", size, maxSize); size = maxSize; } - ALOGV("Final JPEG size %d", size); + ALOGV("Final JPEG size %zu", size); return size; } diff --git a/services/camera/libcameraservice/api1/client2/Parameters.cpp b/services/camera/libcameraservice/api1/client2/Parameters.cpp index 61e3588..081a6e6 100644 --- a/services/camera/libcameraservice/api1/client2/Parameters.cpp +++ b/services/camera/libcameraservice/api1/client2/Parameters.cpp @@ -948,7 +948,7 @@ status_t Parameters::buildFastInfo() { if (sceneModeOverrides.count != availableSceneModes.count * kModesPerSceneMode) { ALOGE("%s: Camera %d: Scene mode override list is an " - "unexpected size: %d (expected %d)", __FUNCTION__, + "unexpected size: %zu (expected %zu)", __FUNCTION__, cameraId, sceneModeOverrides.count, availableSceneModes.count); return NO_INIT; @@ -1078,7 +1078,7 @@ camera_metadata_ro_entry_t Parameters::staticInfo(uint32_t tag, const char* tagName = get_camera_metadata_tag_name(tag); if (tagName == NULL) tagName = "<unknown>"; ALOGE("Malformed static metadata entry '%s.%s' (%x):" - "Expected between %d and %d values, but got %d values", + "Expected between %zu and %zu values, but got %zu values", tagSection, tagName, tag, minCount, maxCount, entry.count); } @@ -1826,6 +1826,9 @@ status_t Parameters::updateRequest(CameraMetadata *request) const { camera_metadata_entry_t intent = request->find(ANDROID_CONTROL_CAPTURE_INTENT); + + if (intent.count == 0) return BAD_VALUE; + if (intent.data.u8[0] == ANDROID_CONTROL_CAPTURE_INTENT_STILL_CAPTURE) { res = request->update(ANDROID_CONTROL_AE_TARGET_FPS_RANGE, fastInfo.bestStillCaptureFpsRange, 2); @@ -2406,7 +2409,7 @@ status_t Parameters::validateAreas(const Vector<Parameters::Area> &areas, } if (areas.size() > maxRegions) { - ALOGE("%s: Too many areas requested: %d", + ALOGE("%s: Too many areas requested: %zu", __FUNCTION__, areas.size()); return BAD_VALUE; } diff --git a/services/camera/libcameraservice/api1/client2/StreamingProcessor.cpp b/services/camera/libcameraservice/api1/client2/StreamingProcessor.cpp index 6076dae..77ae7ec 100644 --- a/services/camera/libcameraservice/api1/client2/StreamingProcessor.cpp +++ b/services/camera/libcameraservice/api1/client2/StreamingProcessor.cpp @@ -225,14 +225,14 @@ status_t StreamingProcessor::setRecordingBufferCount(size_t count) { ATRACE_CALL(); // Make sure we can support this many buffer slots if (count > BufferQueue::NUM_BUFFER_SLOTS) { - ALOGE("%s: Camera %d: Too many recording buffers requested: %d, max %d", + ALOGE("%s: Camera %d: Too many recording buffers requested: %zu, max %d", __FUNCTION__, mId, count, BufferQueue::NUM_BUFFER_SLOTS); return BAD_VALUE; } Mutex::Autolock m(mMutex); - ALOGV("%s: Camera %d: New recording buffer count from encoder: %d", + ALOGV("%s: Camera %d: New recording buffer count from encoder: %zu", __FUNCTION__, mId, count); // Need to re-size consumer and heap @@ -314,7 +314,7 @@ status_t StreamingProcessor::updateRecordingStream(const Parameters ¶ms) { bool newConsumer = false; if (mRecordingConsumer == 0) { - ALOGV("%s: Camera %d: Creating recording consumer with %d + 1 " + ALOGV("%s: Camera %d: Creating recording consumer with %zu + 1 " "consumer-side buffers", __FUNCTION__, mId, mRecordingHeapCount); // Create CPU buffer queue endpoint. We need one more buffer here so that we can // always acquire and free a buffer when the heap is full; otherwise the consumer @@ -435,7 +435,7 @@ status_t StreamingProcessor::startStream(StreamType type, releaseAllRecordingFramesLocked(); } - ALOGV("%s: Camera %d: %s started, recording heap has %d free of %d", + ALOGV("%s: Camera %d: %s started, recording heap has %zu free of %zu", __FUNCTION__, mId, (type == PREVIEW) ? "preview" : "recording", mRecordingHeapFree, mRecordingHeapCount); @@ -658,8 +658,8 @@ status_t StreamingProcessor::processRecordingFrame() { if (mRecordingHeap == 0) { const size_t bufferSize = 4 + sizeof(buffer_handle_t); - ALOGV("%s: Camera %d: Creating recording heap with %d buffers of " - "size %d bytes", __FUNCTION__, mId, + ALOGV("%s: Camera %d: Creating recording heap with %zu buffers of " + "size %zu bytes", __FUNCTION__, mId, mRecordingHeapCount, bufferSize); mRecordingHeap = new Camera2Heap(bufferSize, mRecordingHeapCount, @@ -819,10 +819,10 @@ void StreamingProcessor::releaseAllRecordingFramesLocked() { } if (releasedCount > 0) { - ALOGW("%s: Camera %d: Force-freed %d outstanding buffers " + ALOGW("%s: Camera %d: Force-freed %zu outstanding buffers " "from previous recording session", __FUNCTION__, mId, releasedCount); ALOGE_IF(releasedCount != mRecordingHeapCount - mRecordingHeapFree, - "%s: Camera %d: Force-freed %d buffers, but expected %d", + "%s: Camera %d: Force-freed %zu buffers, but expected %zu", __FUNCTION__, mId, releasedCount, mRecordingHeapCount - mRecordingHeapFree); } diff --git a/services/camera/libcameraservice/api1/client2/ZslProcessor.cpp b/services/camera/libcameraservice/api1/client2/ZslProcessor.cpp index 4207ba9..130f81a 100644 --- a/services/camera/libcameraservice/api1/client2/ZslProcessor.cpp +++ b/services/camera/libcameraservice/api1/client2/ZslProcessor.cpp @@ -25,6 +25,8 @@ #define ALOGVV(...) ((void)0) #endif +#include <inttypes.h> + #include <utils/Log.h> #include <utils/Trace.h> #include <gui/Surface.h> @@ -78,7 +80,7 @@ void ZslProcessor::onFrameAvailable(int32_t /*requestId*/, entry = frame.find(ANDROID_SENSOR_TIMESTAMP); nsecs_t timestamp = entry.data.i64[0]; (void)timestamp; - ALOGVV("Got preview frame for timestamp %lld", timestamp); + ALOGVV("Got preview frame for timestamp %" PRId64, timestamp); if (mState != RUNNING) return; @@ -461,7 +463,7 @@ status_t ZslProcessor::processNewZslBuffer() { mZslQueueHead = (mZslQueueHead + 1) % kZslBufferDepth; - ALOGVV(" Acquired buffer, timestamp %lld", queueHead.buffer.mTimestamp); + ALOGVV(" Acquired buffer, timestamp %" PRId64, queueHead.buffer.mTimestamp); findMatchesLocked(); @@ -480,7 +482,7 @@ void ZslProcessor::findMatchesLocked() { entry = queueEntry.frame.find(ANDROID_SENSOR_TIMESTAMP); frameTimestamp = entry.data.i64[0]; } - ALOGVV(" %d: b: %lld\tf: %lld", i, + ALOGVV(" %d: b: %" PRId64 "\tf: %" PRId64, i, bufferTimestamp, frameTimestamp ); } if (queueEntry.frame.isEmpty() && bufferTimestamp != 0) { @@ -498,13 +500,13 @@ void ZslProcessor::findMatchesLocked() { } nsecs_t frameTimestamp = entry.data.i64[0]; if (bufferTimestamp == frameTimestamp) { - ALOGVV("%s: Found match %lld", __FUNCTION__, + ALOGVV("%s: Found match %" PRId64, __FUNCTION__, frameTimestamp); match = true; } else { int64_t delta = abs(bufferTimestamp - frameTimestamp); if ( delta < 1000000) { - ALOGVV("%s: Found close match %lld (delta %lld)", + ALOGVV("%s: Found close match %" PRId64 " (delta %" PRId64 ")", __FUNCTION__, bufferTimestamp, delta); match = true; } @@ -540,7 +542,7 @@ void ZslProcessor::dumpZslQueue(int fd) const { if (entry.count > 0) frameAeState = entry.data.u8[0]; } String8 result = - String8::format(" %d: b: %lld\tf: %lld, AE state: %d", i, + String8::format(" %zu: b: %" PRId64 "\tf: %" PRId64 ", AE state: %d", i, bufferTimestamp, frameTimestamp, frameAeState); ALOGV("%s", result.string()); if (fd != -1) { diff --git a/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp b/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp index 776ebe2..2fce2b6 100644 --- a/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp +++ b/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp @@ -25,6 +25,8 @@ #define ALOGVV(...) ((void)0) #endif +#include <inttypes.h> + #include <utils/Log.h> #include <utils/Trace.h> #include <gui/Surface.h> @@ -68,7 +70,7 @@ void ZslProcessor3::onFrameAvailable(int32_t /*requestId*/, entry = frame.find(ANDROID_SENSOR_TIMESTAMP); nsecs_t timestamp = entry.data.i64[0]; (void)timestamp; - ALOGVV("Got preview metadata for timestamp %lld", timestamp); + ALOGVV("Got preview metadata for timestamp %" PRId64, timestamp); if (mState != RUNNING) return; @@ -355,7 +357,7 @@ void ZslProcessor3::dumpZslQueue(int fd) const { if (entry.count > 0) frameAeState = entry.data.u8[0]; } String8 result = - String8::format(" %d: b: %lld\tf: %lld, AE state: %d", i, + String8::format(" %zu: b: %" PRId64 "\tf: %" PRId64 ", AE state: %d", i, bufferTimestamp, frameTimestamp, frameAeState); ALOGV("%s", result.string()); if (fd != -1) { @@ -415,7 +417,7 @@ nsecs_t ZslProcessor3::getCandidateTimestampLocked(size_t* metadataIdx) const { idx = j; } - ALOGVV("%s: Saw timestamp %lld", __FUNCTION__, frameTimestamp); + ALOGVV("%s: Saw timestamp %" PRId64, __FUNCTION__, frameTimestamp); } } @@ -435,7 +437,7 @@ nsecs_t ZslProcessor3::getCandidateTimestampLocked(size_t* metadataIdx) const { ALOGW("%s: ZSL queue has no metadata frames", __FUNCTION__); } - ALOGV("%s: Candidate timestamp %lld (idx %d), empty frames: %d", + ALOGV("%s: Candidate timestamp %" PRId64 " (idx %zu), empty frames: %zu", __FUNCTION__, minTimestamp, idx, emptyCount); if (metadataIdx) { |