diff options
Diffstat (limited to 'tests/camera2/CameraMultiStreamTests.cpp')
-rw-r--r-- | tests/camera2/CameraMultiStreamTests.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/tests/camera2/CameraMultiStreamTests.cpp b/tests/camera2/CameraMultiStreamTests.cpp index a78950c..536b656 100644 --- a/tests/camera2/CameraMultiStreamTests.cpp +++ b/tests/camera2/CameraMultiStreamTests.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#include <inttypes.h> #define LOG_TAG "CameraMultiStreamTest" //#define LOG_NDEBUG 0 #include "CameraStreamFixture.h" @@ -181,11 +182,13 @@ public: mHeight(height) { mFormat = param.mFormat; if (useCpuConsumer) { - sp<BufferQueue> bq = new BufferQueue(); - mCpuConsumer = new CpuConsumer(bq, param.mHeapCount); + sp<IGraphicBufferProducer> producer; + sp<IGraphicBufferConsumer> consumer; + BufferQueue::createBufferQueue(&producer, &consumer); + mCpuConsumer = new CpuConsumer(consumer, param.mHeapCount); mCpuConsumer->setName(String8( "CameraMultiStreamTest::mCpuConsumer")); - mNativeWindow = new Surface(bq); + mNativeWindow = new Surface(producer); } else { // Render the stream to screen. mCpuConsumer = NULL; @@ -353,7 +356,7 @@ public: ASSERT_EQ(OK, request.update(ANDROID_SENSOR_EXPOSURE_TIME, &exposures[i], 1)); ASSERT_EQ(OK, request.update(ANDROID_SENSOR_SENSITIVITY, &sensitivities[i], 1)); ASSERT_EQ(OK, mDevice->capture(request)); - ALOGV("Submitting request with: id %d with exposure %lld, sensitivity %d", + ALOGV("Submitting request with: id %d with exposure %"PRId64", sensitivity %d", *requestIdStart, exposures[i], sensitivities[i]); if (CAMERA_MULTI_STREAM_DEBUGGING) { request.dump(STDOUT_FILENO); @@ -368,7 +371,7 @@ public: // Set wait limit based on expected frame duration. int64_t waitLimit = CAMERA_FRAME_TIMEOUT; for (size_t i = 0; i < requestCount; i++) { - ALOGV("Reading request result %d", i); + ALOGV("Reading request result %zu", i); /** * Raise the timeout to be at least twice as long as the exposure @@ -378,11 +381,13 @@ public: waitLimit = exposures[i] * EXP_WAIT_MULTIPLIER; } + CaptureResult result; CameraMetadata frameMetadata; int32_t resultRequestId; do { ASSERT_EQ(OK, mDevice->waitForNextFrame(waitLimit)); - ASSERT_EQ(OK, mDevice->getNextFrame(&frameMetadata)); + ASSERT_EQ(OK, mDevice->getNextResult(&result)); + frameMetadata = result.mMetadata; camera_metadata_entry_t resultEntry = frameMetadata.find(ANDROID_REQUEST_ID); ASSERT_EQ(1u, resultEntry.count); @@ -392,7 +397,7 @@ public: } } while (resultRequestId != targetRequestId); targetRequestId++; - ALOGV("Got capture burst result for request %d", i); + ALOGV("Got capture burst result for request %zu", i); // Validate capture result if (CAMERA_MULTI_STREAM_DEBUGGING) { @@ -411,7 +416,7 @@ public: captureBurstTimes.push_back(systemTime()); CpuConsumer::LockedBuffer imgBuffer; ASSERT_EQ(OK, consumer->lockNextBuffer(&imgBuffer)); - ALOGV("Got capture buffer for request %d", i); + ALOGV("Got capture buffer for request %zu", i); /** * TODO: Validate capture buffer. Current brightness calculation @@ -523,7 +528,7 @@ TEST_F(CameraMultiStreamTest, MultiBurst) { minFrameDuration = DEFAULT_FRAME_DURATION; } - ALOGV("targeted minimal frame duration is: %lldns", minFrameDuration); + ALOGV("targeted minimal frame duration is: %"PRId64"ns", minFrameDuration); data = &(availableJpegSizes.data.i32[0]); count = availableJpegSizes.count; @@ -643,7 +648,7 @@ TEST_F(CameraMultiStreamTest, MultiBurst) { ASSERT_EQ(OK, previewRequest.update( ANDROID_SENSOR_EXPOSURE_TIME, &exposures[i], 1)); - ALOGV("Submitting preview request %d with exposure %lld", + ALOGV("Submitting preview request %zu with exposure %"PRId64, i, exposures[i]); ASSERT_EQ(OK, mDevice->setStreamingRequest(previewRequest)); |