Update testsuite to select top-and-bottom stereo format as well as side-by-side 73/285773/1
authorTae-Young Chung <ty83.chung@samsung.com>
Tue, 20 Dec 2022 04:22:16 +0000 (13:22 +0900)
committerTae-Young Chung <ty83.chung@samsung.com>
Tue, 20 Dec 2022 04:22:34 +0000 (13:22 +0900)
[Issue type] update

Change-Id: Ie5fa4b797e737ba870385b12f5a4550ec67bee32
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
test/testsuites/mv3d/depthstream_test_suite.cpp

index 0c47769..552493b 100644 (file)
@@ -111,6 +111,12 @@ typedef struct _appdata
 
 static appdata app;
 
+enum {
+       STEREO_FORMAT_NONE = 0,
+       STEREO_FORMAT_SIDE_BY_SIDE,
+       STEREO_FORMAT_TOP_AND_BOTTOM
+};
+
 // MediaVision
 mv_engine_config_h engine_config;
 // Vision source handle
@@ -122,6 +128,7 @@ static bool isLive;
 static bool isAsync;
 static int camWidth;
 static int camHeight;
+static int stereoFormat;
 static int minDisp;
 static int maxDisp;
 static int display_xpos;
@@ -237,10 +244,11 @@ int main(int argc, char *argv[])
                display_ypos = atoi(argv[5]);
                camWidth = atoi(argv[6]);
                camHeight = atoi(argv[7]);
-               stereoConfigFile = argv[8];
-               dispResultFile = argv[9];
-               isRemote = (atoi(argv[10])!=0);
-               if (isRemote) remoteUrl = argv[11];
+               stereoFormat = atoi(argv[8]);
+               stereoConfigFile = argv[9];
+               dispResultFile = argv[10];
+               isRemote = (atoi(argv[11])!=0);
+               if (isRemote) remoteUrl = argv[12];
        }
 #ifdef MV_3D_POINTCLOUD_IS_AVAILABLE
        utility::SetVerbosityLevel(utility::VerbosityLevel::Debug);
@@ -251,12 +259,23 @@ int main(int argc, char *argv[])
 
        vision_source_format_s format {
                .pixel_format = VISION_SOURCE_PIXEL_FORMAT_NV12,
-               .resolution = { camWidth << 1, camHeight },
+               .resolution = { camWidth, camHeight },
                .fps = 10,
                .quality = 0,
                .bitrate = 0
        };
 
+       switch (stereoFormat) {
+       case STEREO_FORMAT_SIDE_BY_SIDE:
+                       format.resolution.width <<= 1;
+                       break;
+       case STEREO_FORMAT_TOP_AND_BOTTOM:
+                       format.resolution.height <<= 1;
+                       break;
+       default:
+                       break;
+       }
+
        // mediavision
        // engine_config
        ret = mv_create_engine_config(&engine_config);
@@ -332,8 +351,8 @@ int main(int argc, char *argv[])
                goto _err;
        }
 
-       app.imgWidth = camWidth << 1;
-       app.imgHeight = camHeight;
+       app.imgWidth = format.resolution.width;
+       app.imgHeight = format.resolution.height;
        app.stopWatch.resetTime();
        try {
                app.buffer = new unsigned char [app.imgWidth * app.imgHeight];