diff options
-rw-r--r-- | test/camera_test.c | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/test/camera_test.c b/test/camera_test.c index bfe68d7..33e731d 100644 --- a/test/camera_test.c +++ b/test/camera_test.c @@ -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 */ |