Bug fix - camera testsuite flip and rotate tc fail 38/208138/1
authorHyuntae Kim <ht1211.kim@samsung.com>
Wed, 19 Jun 2019 00:42:22 +0000 (09:42 +0900)
committerHyuntae Kim <ht1211.kim@samsung.com>
Wed, 19 Jun 2019 00:44:29 +0000 (09:44 +0900)
[Version] 0.4.25
[Profile] Common
[Issue Type] Bug fix

Change-Id: I044adf9fff7bd891c3e8419a49b32973557d87ab

test/camera_test.c

index bfe68d7..33e731d 100644 (file)
@@ -112,7 +112,7 @@ GTimeVal result_time;
 
 #define SENSOR_WHITEBALANCE_NUM     10
 #define SENSOR_COLOR_TONE_NUM       31
-#define SENSOR_FLIP_NUM         3
+#define SENSOR_FLIP_NUM         4
 #define SENSOR_PROGRAM_MODE_NUM     15
 #define SENSOR_FOCUS_NUM        6
 #define SENSOR_INPUT_ROTATION       4
@@ -168,11 +168,6 @@ typedef struct {
        int count;
 } iso_stack;
 
-typedef struct {
-       camera_rotation_e mode;
-       int count;
-} camera_rotation_stack;
-
 
 /*---------------------------------------------------------------------------
   |    LOCAL VARIABLE DEFINITIONS:                                            |
@@ -226,10 +221,11 @@ const char *ct[SENSOR_COLOR_TONE_NUM] = {
        "GRAPHICS"
 };
 
-const char *flip[SENSOR_FLIP_NUM] = {
-       "Horizontal",
-       "Vertical",
-       "Not flipped",
+const char *sensor_flip[SENSOR_FLIP_NUM] = {
+       "NONE",
+       "HORIZONTAL",
+       "VERTICAL",
+       "BOTH"
 };
 
 const char *program_mode[SENSOR_PROGRAM_MODE_NUM] = {
@@ -576,18 +572,13 @@ static bool iso_mode_cb(camera_attr_iso_e mode, void *user_data)
 
 static bool camera_rotation_cb(camera_rotation_e mode, void *user_data)
 {
-       camera_rotation_stack *data = (camera_rotation_stack *)user_data;
-
-       if (data == NULL) {
-               g_print("NULL data\n");
-               return false;
-       }
-
-       data->mode = mode;
-       data->count++;
-
        g_print("\t%d. %s\n", mode, camera_rotation[mode]);
+       return true;
+}
 
+static bool camera_flip_cb(camera_flip_e mode, void *user_data)
+{
+       g_print("\t%d. %s\n", mode, sensor_flip[mode]);
        return true;
 }
 
@@ -1005,14 +996,11 @@ static void setting_menu(gchar buf)
                break;
        case 'f': /* Setting > Flip camera input */
                g_print("*Flip camera input\n");
-               g_print(" 0. Flip NONE\n");
-               g_print(" 1. Flip HORIZONTAL\n");
-               g_print(" 2. Flip VERTICAL\n");
-               g_print(" 3. Flip BOTH\n");
+               camera_attr_foreach_supported_stream_flip(hcamcorder->camera, camera_flip_cb, NULL);
                err = scanf("%d", &idx);
                flush_stdin();
                CHECK_MM_ERROR(camera_stop_preview(hcamcorder->camera));
-               camera_attr_set_stream_flip(hcamcorder->camera, idx);
+               bret = camera_attr_set_stream_flip(hcamcorder->camera, idx);
                CHECK_MM_ERROR(camera_start_preview(hcamcorder->camera));
                break;
        case 'j': /* Setting > Jpeg quality */