summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2015-06-09 15:23:34 -0700
committerEino-Ville Talvala <etalvala@google.com>2015-06-09 15:23:34 -0700
commitcd6984e7623366a4f21eadecdd57fd8286ab5451 (patch)
treef797b780f62e1f9046a52f10b7004aeefc90b783
parentc88122614c1593bc9384564b10f11bd7bb7e3b64 (diff)
downloadhardware_libhardware-cd6984e7623366a4f21eadecdd57fd8286ab5451.zip
hardware_libhardware-cd6984e7623366a4f21eadecdd57fd8286ab5451.tar.gz
hardware_libhardware-cd6984e7623366a4f21eadecdd57fd8286ab5451.tar.bz2
Camera2 tests: Update for framework changes
Change-Id: I9ac788cfe9a001ef33bdc52a9e8ba0bdcf3ded2c
-rw-r--r--tests/camera2/CameraMultiStreamTests.cpp18
-rw-r--r--tests/camera2/CameraStreamFixture.h8
2 files changed, 13 insertions, 13 deletions
diff --git a/tests/camera2/CameraMultiStreamTests.cpp b/tests/camera2/CameraMultiStreamTests.cpp
index 0f8d578..3e29ad6 100644
--- a/tests/camera2/CameraMultiStreamTests.cpp
+++ b/tests/camera2/CameraMultiStreamTests.cpp
@@ -92,7 +92,7 @@ public:
sp<SurfaceComposerClient> mComposerClient;
sp<SurfaceControl> mSurfaceControl;
- void CreateOnScreenSurface(sp<ANativeWindow>& surface) {
+ void CreateOnScreenSurface(sp<Surface>& surface) {
mComposerClient = new SurfaceComposerClient;
ASSERT_EQ(NO_ERROR, mComposerClient->initCheck());
@@ -175,7 +175,7 @@ public:
int width,
int height,
const sp<CameraDeviceBase>& device,
- CameraStreamParams param, sp<ANativeWindow> surface,
+ CameraStreamParams param, sp<Surface> surface,
bool useCpuConsumer)
: mDevice(device),
mWidth(width),
@@ -188,11 +188,11 @@ public:
mCpuConsumer = new CpuConsumer(consumer, param.mHeapCount);
mCpuConsumer->setName(String8(
"CameraMultiStreamTest::mCpuConsumer"));
- mNativeWindow = new Surface(producer);
+ mSurface = new Surface(producer);
} else {
// Render the stream to screen.
mCpuConsumer = NULL;
- mNativeWindow = surface;
+ mSurface = surface;
}
mFrameListener = new FrameListener();
@@ -207,7 +207,7 @@ public:
*/
void SetUp() {
ASSERT_EQ(OK,
- mDevice->createStream(mNativeWindow,
+ mDevice->createStream(mSurface,
mWidth, mHeight, mFormat, HAL_DATASPACE_UNKNOWN,
CAMERA3_STREAM_ROTATION_0, &mStreamId));
@@ -225,14 +225,14 @@ public:
mDevice->deleteStream(mStreamId);
}
// Clear producer before consumer.
- mNativeWindow.clear();
+ mSurface.clear();
mCpuConsumer.clear();
}
private:
sp<FrameListener> mFrameListener;
sp<CpuConsumer> mCpuConsumer;
- sp<ANativeWindow> mNativeWindow;
+ sp<Surface> mSurface;
sp<CameraDeviceBase> mDevice;
int mStreamId;
int mWidth;
@@ -334,7 +334,7 @@ public:
int height,
const sp<CameraDeviceBase>& device,
CameraStreamParams param = DEFAULT_STREAM_PARAMETERS,
- sp<ANativeWindow> surface = NULL,
+ sp<Surface> surface = NULL,
bool useCpuConsumer = true) {
param.mFormat = MapAutoFormat(param.mFormat);
return new CameraStream(width, height, device,
@@ -583,7 +583,7 @@ TEST_F(CameraMultiStreamTest, DISABLED_MultiBurst) {
// Preview stream: small resolution, render on the screen.
sp<CameraStream> previewStream;
{
- sp<ANativeWindow> surface;
+ sp<Surface> surface;
ASSERT_NO_FATAL_FAILURE(CreateOnScreenSurface(/*out*/surface));
previewStream = CreateStream(
previewSize.width,
diff --git a/tests/camera2/CameraStreamFixture.h b/tests/camera2/CameraStreamFixture.h
index e234f7e..fc5fb36 100644
--- a/tests/camera2/CameraStreamFixture.h
+++ b/tests/camera2/CameraStreamFixture.h
@@ -131,7 +131,7 @@ private:
CameraModuleFixture::TearDown();
deleteOutputResolutions();
- mNativeWindow.clear();
+ mSurface.clear();
mCpuConsumer.clear();
mFrameListener.clear();
}
@@ -250,12 +250,12 @@ protected:
mCpuConsumer = new CpuConsumer(consumer, p.mHeapCount);
mCpuConsumer->setName(String8("CameraStreamTest::mCpuConsumer"));
- mNativeWindow = new Surface(producer);
+ mSurface = new Surface(producer);
int format = MapAutoFormat(p.mFormat);
ASSERT_EQ(OK,
- device->createStream(mNativeWindow,
+ device->createStream(mSurface,
mWidth, mHeight, format,
HAL_DATASPACE_UNKNOWN,
CAMERA3_STREAM_ROTATION_0,
@@ -364,7 +364,7 @@ protected:
android::sp<FrameListener> mFrameListener;
android::sp<CpuConsumer> mCpuConsumer;
- android::sp<ANativeWindow> mNativeWindow;
+ android::sp<Surface> mSurface;
KeyedVector<int32_t, Vector<int32_t>* > mOutputResolutions;
private: