-----------------------------------------------------------------------*/
enum {
MODE_VIDEO_CAPTURE, /* recording and image capture mode */
- MODE_AUDIO, /* audio recording*/
+ MODE_AUDIO, /* audio recording*/
MODE_NUM,
};
typedef struct _cam_handle {
camera_h camera;
int type;
- int is_multishot; /* flag for multishot mode */
- int stillshot_count; /* stillshot count */
- int multishot_count; /* multishot count */
- char file_path[MAX_FILE_PATH_LENGTH]; /* file path for captured data */
+ int is_multishot; /* flag for multishot mode */
+ int stillshot_count; /* stillshot count */
+ int multishot_count; /* multishot count */
+ char file_path[MAX_FILE_PATH_LENGTH]; /* file path for captured data */
int menu_state;
unsigned long long elapsed_time;
} cam_handle_t;
default:
break;
}
-
- return;
}
static void _camera_state_changed_cb(camera_state_e previous, camera_state_e current, bool by_policy, void *user_data)
{
g_print("\n\tcamera state changed %d -> %d\n", previous, current);
-
- return;
}
static void _camera_device_state_changed_cb(camera_device_e device, camera_device_state_e state, void *user_data)
{
g_print("\n\tcamera device[%d] state changed to %d\n", device, state);
-
- return;
}
static void _camera_device_connection_changed_cb(camera_device_s *device, bool is_connected, void *user_data)
g_print("\n\tcamera device changed[is_connected:%d][Type:%d,index:%d,name:%s,id:%s,exstreamnum:%d]\n",
is_connected, device->type, device->index, device->name, device->id, device->extra_stream_num);
-
- return;
}
static void _camera_interrupted_cb(camera_policy_e policy, camera_state_e previous, camera_state_e current, void *user_data)
{
g_print("\n\tcamera interrupted callback called[state %d -> %d, policy %d]\n",
previous, current, policy);
-
- return;
}
static void _camera_interrupt_started_cb(camera_policy_e policy, camera_state_e state, void *user_data)
{
g_print("\n\tcamera interrupt started callback called[state %d, policy %d]\n", state, policy);
-
- return;
}
static void _dump_preview_data(camera_preview_data_s *frame, const char *file_name)
static void _face_detected(camera_detected_face_s *faces, int count, void *user_data)
{
- g_print("\tface detected!! - count %d\n", count);
int i;
+ g_print("\tface detected!! - count %d\n", count);
+
for (i = 0 ; i < count ; i++)
g_print("\t%d] %dx%d\n", faces[i].id, faces[i].x, faces[i].y);
-
- return;
}
static void _file_write(char *path, void *data, int size)
} else {
g_print("\n\topen error! [%s], errno %d\n", path, errno);
}
-
- return;
}
static void capturing_cb(camera_image_data_s* image, camera_image_data_s* postview, camera_image_data_s* thumbnail, void *user_data)
_file_write(m_filename, image->data, image->size);
}
-
- return;
}
static void capture_completed_cb(void *user_data)
{
camera_start_preview(hcamcorder->camera);
-
- return;
}
static void print_menu()
}
g_print("\tCommand >> ");
-
- return;
}
g_print("\t Invalid input \n");
break;
}
-
- return;
}
case 'n': /* file path */
g_print("* File path !\n");
g_print("\n Input file path to save captured data(string) : ");
- if (fgets(hcamcorder->file_path, sizeof(hcamcorder->file_path), stdin)) {
- hcamcorder->file_path[strlen(hcamcorder->file_path) - 1] = '\0';
+ if (fgets(hcamcorder->file_path, sizeof(hcamcorder->file_path), stdin))
g_print("\ncaptured data will be saved in [%s]\n", hcamcorder->file_path);
- } else {
+ else
g_print("\nset file path failed\n");
- }
break;
case 'm': /* media bridge */
g_print("* Media Bridge !\n");
}
g_print("\t bret : 0x%x \n", bret);
-
- return;
}
g_print("\n\tinvalid input[%c]\n", buf);
break;
}
-
- return;
}
static void device_list_menu(gchar buf)
g_print("\n\tinvalid input[%c]\n", buf);
break;
}
-
- return;
}
if (err != 0) {
g_print("\n\tmmcamcorder_create = 0x%x\n", err);
- return -1;
+ return FALSE;
}
while (!check) {