diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2012-08-24 12:32:17 -0700 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2012-08-27 10:30:04 -0700 |
commit | b8b6439598ecc5faecfce8d43f3418b057714b4c (patch) | |
tree | 4600264eca6bd2b8e9d253f2e826586e54115a1d /tests | |
parent | 43a2bbb9de4f51754b7b131fc282aa2f9115c09e (diff) | |
download | hardware_libhardware-b8b6439598ecc5faecfce8d43f3418b057714b4c.zip hardware_libhardware-b8b6439598ecc5faecfce8d43f3418b057714b4c.tar.gz hardware_libhardware-b8b6439598ecc5faecfce8d43f3418b057714b4c.tar.bz2 |
Camera2: Make static_camera_characteristics const.
Disallow modification to static characteristics structure, and clarify
ownership and lifetime of the structure.
Also update test code accordingly.
Bug: 6243944
Change-Id: I6921d6889937212867efb99aa3881ab3ffc4f6f9
Diffstat (limited to 'tests')
-rw-r--r-- | tests/camera2/camera2.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/camera2/camera2.cpp b/tests/camera2/camera2.cpp index 05f61ef..29eef68 100644 --- a/tests/camera2/camera2.cpp +++ b/tests/camera2/camera2.cpp @@ -236,13 +236,13 @@ class Camera2Test: public testing::Test { } void getResolutionList(int32_t format, - int32_t **list, + const int32_t **list, size_t *count) { ALOGV("Getting resolutions for format %x", format); status_t res; if (format != CAMERA2_HAL_PIXEL_FORMAT_OPAQUE) { - camera_metadata_entry_t availableFormats; - res = find_camera_metadata_entry(mStaticInfo, + camera_metadata_ro_entry_t availableFormats; + res = find_camera_metadata_ro_entry(mStaticInfo, ANDROID_SCALER_AVAILABLE_FORMATS, &availableFormats); ASSERT_EQ(OK, res); @@ -255,17 +255,17 @@ class Camera2Test: public testing::Test { << "No support found for format 0x" << std::hex << format; } - camera_metadata_entry_t availableSizes; + camera_metadata_ro_entry_t availableSizes; if (format == HAL_PIXEL_FORMAT_RAW_SENSOR) { - res = find_camera_metadata_entry(mStaticInfo, + res = find_camera_metadata_ro_entry(mStaticInfo, ANDROID_SCALER_AVAILABLE_RAW_SIZES, &availableSizes); } else if (format == HAL_PIXEL_FORMAT_BLOB) { - res = find_camera_metadata_entry(mStaticInfo, + res = find_camera_metadata_ro_entry(mStaticInfo, ANDROID_SCALER_AVAILABLE_JPEG_SIZES, &availableSizes); } else { - res = find_camera_metadata_entry(mStaticInfo, + res = find_camera_metadata_ro_entry(mStaticInfo, ANDROID_SCALER_AVAILABLE_PROCESSED_SIZES, &availableSizes); } @@ -293,7 +293,7 @@ class Camera2Test: public testing::Test { } camera2_device *mDevice; - camera_metadata_t *mStaticInfo; + const camera_metadata_t *mStaticInfo; MetadataQueue mRequests; MetadataQueue mFrames; @@ -342,7 +342,7 @@ TEST_F(Camera2Test, Capture1Raw) { sp<FrameWaiter> rawWaiter = new FrameWaiter(); rawConsumer->setFrameAvailableListener(rawWaiter); - int32_t *rawResolutions; + const int32_t *rawResolutions; size_t rawResolutionsCount; int format = HAL_PIXEL_FORMAT_RAW_SENSOR; @@ -456,7 +456,7 @@ TEST_F(Camera2Test, CaptureBurstRaw) { sp<FrameWaiter> rawWaiter = new FrameWaiter(); rawConsumer->setFrameAvailableListener(rawWaiter); - int32_t *rawResolutions; + const int32_t *rawResolutions; size_t rawResolutionsCount; int format = HAL_PIXEL_FORMAT_RAW_SENSOR; @@ -618,7 +618,7 @@ TEST_F(Camera2Test, Capture1Jpeg) { sp<FrameWaiter> jpegWaiter = new FrameWaiter(); jpegConsumer->setFrameAvailableListener(jpegWaiter); - int32_t *jpegResolutions; + const int32_t *jpegResolutions; size_t jpegResolutionsCount; int format = HAL_PIXEL_FORMAT_BLOB; |