summaryrefslogtreecommitdiffstats
path: root/test/VTC/VTCLoopback.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/VTC/VTCLoopback.cpp')
-rw-r--r--test/VTC/VTCLoopback.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/VTC/VTCLoopback.cpp b/test/VTC/VTCLoopback.cpp
index d424401..087f40d 100644
--- a/test/VTC/VTCLoopback.cpp
+++ b/test/VTC/VTCLoopback.cpp
@@ -220,13 +220,27 @@ int createPreviewSurface() {
gSurfaceComposerClient = new SurfaceComposerClient();
CHECK_EQ(gSurfaceComposerClient->initCheck(), (status_t)OK);
+#ifdef ANDROID_API_JB_MR1_OR_LATER
+ DisplayInfo displayInfo;
+ gSurfaceComposerClient->getDisplayInfo(0, &displayInfo);
+ int gCameraSurfaceWidth = displayInfo.w;
+ int gCameraSurfaceHeight = displayInfo.h;
+#else
gCameraSurfaceWidth = gSurfaceComposerClient->getDisplayWidth(0);
gCameraSurfaceHeight = gSurfaceComposerClient->getDisplayHeight(0);
+#endif
+#ifdef ANDROID_API_JB_MR1_OR_LATER
+ gSurfaceControl = gSurfaceComposerClient->createSurface(String8(),
+ gCameraSurfaceWidth,
+ gCameraSurfaceHeight,
+ HAL_PIXEL_FORMAT_RGB_565);
+#else
gSurfaceControl = gSurfaceComposerClient->createSurface(0,
gCameraSurfaceWidth,
gCameraSurfaceHeight,
HAL_PIXEL_FORMAT_RGB_565);
+#endif
gPreviewSurface = gSurfaceControl->getSurface();