diff options
author | Igor Murashkin <iam@google.com> | 2013-07-12 18:01:31 -0700 |
---|---|---|
committer | Igor Murashkin <iam@google.com> | 2013-07-15 13:37:08 -0700 |
commit | d7bf1778df666e82268d1e4549d248ce3dfc9665 (patch) | |
tree | 07556b3fa76172b411d567e1ddb580e8c0981f30 /media/tests/MediaFrameworkTest/src | |
parent | b9dd637f830e6bd4f257ffb2c807c3ea27f8feee (diff) | |
download | frameworks_base-d7bf1778df666e82268d1e4549d248ce3dfc9665.zip frameworks_base-d7bf1778df666e82268d1e4549d248ce3dfc9665.tar.gz frameworks_base-d7bf1778df666e82268d1e4549d248ce3dfc9665.tar.bz2 |
camera2: Implement CameraDevice#getCameraInfo
Bug: 9529161
Change-Id: Ie37d1e07bb8416cbb141f4d49e52337bf7236610
Diffstat (limited to 'media/tests/MediaFrameworkTest/src')
3 files changed, 18 insertions, 3 deletions
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraBinderTestUtils.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraBinderTestUtils.java index f0fc817..2ebe11a 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraBinderTestUtils.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraBinderTestUtils.java @@ -20,7 +20,7 @@ public class CameraBinderTestUtils { protected static final int USE_CALLING_UID = -1; protected static final int BAD_VALUE = -22; protected static final int ALREADY_EXISTS = -17; - protected static final int NO_ERROR = 0; + public static final int NO_ERROR = 0; private final Context mContext; public CameraBinderTestUtils(Context context) { diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraDeviceBinderTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraDeviceBinderTest.java index 0cbb989..1f478d2 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraDeviceBinderTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraDeviceBinderTest.java @@ -18,6 +18,7 @@ package com.android.mediaframeworktest.integration; import android.graphics.SurfaceTexture; import android.hardware.photography.CameraMetadata; +import android.hardware.photography.CameraPropertiesKeys; import android.hardware.photography.CaptureRequest; import android.hardware.photography.ICameraDeviceCallbacks; import android.hardware.photography.ICameraDeviceUser; @@ -294,4 +295,16 @@ public class CameraDeviceBinderTest extends AndroidTestCase { request.close(); metadata.close(); } + + @SmallTest + public void testCameraInfo() throws RemoteException { + CameraMetadata info = new CameraMetadata(); + + int status = mCameraUser.getCameraInfo(/*out*/info); + assertEquals(CameraBinderTestUtils.NO_ERROR, status); + + assertFalse(info.isEmpty()); + assertNotNull(info.get(CameraPropertiesKeys.Scaler.AVAILABLE_FORMATS)); + } + } diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/CameraMetadataTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/CameraMetadataTest.java index 293d6f3..0c2f3a3 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/CameraMetadataTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/CameraMetadataTest.java @@ -484,7 +484,8 @@ public class CameraMetadataTest extends junit.framework.TestCase { new AvailableFormat[] { AvailableFormat.RAW_SENSOR, AvailableFormat.YV12, - AvailableFormat.IMPLEMENTATION_DEFINED + AvailableFormat.IMPLEMENTATION_DEFINED, + AvailableFormat.YCbCr_420_888 }); Key<AeAntibandingMode> availableFormatsKey = @@ -496,7 +497,8 @@ public class CameraMetadataTest extends junit.framework.TestCase { int[] expectedIntValues = new int[] { 0x20, 0x32315659, - 0x22 + 0x22, + 0x23 }; ByteBuffer bf = ByteBuffer.wrap(availableFormatValues).order(ByteOrder.nativeOrder()); |