diff options
-rw-r--r-- | camera/src/controller.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/camera/src/controller.c b/camera/src/controller.c index 21a87ff..6071d86 100644 --- a/camera/src/controller.c +++ b/camera/src/controller.c @@ -147,18 +147,23 @@ static void __thread_write_image_file(void *data, Ecore_Thread *th) height = ad->latest_image_height; buffer = ad->latest_image_buffer; ad->latest_image_buffer = NULL; - image_info = strdup("Specific Data"); pthread_mutex_unlock(&ad->mutex); - ret = controller_image_save_image_file(ad->temp_image_filename, width, height, buffer, + char newFileName[PATH_MAX] = {0, }; + char timeInfo[PATH_MAX] = {0, }; + snprintf(timeInfo, PATH_MAX, "Time: %lld", __get_monotonic_ms()); + snprintf(newFileName, PATH_MAX, "%s_%lld.jpg", ad->temp_image_filename, __get_monotonic_ms()); + image_info = strdup(timeInfo); + + ret = controller_image_save_image_file(newFileName, width, height, buffer, &encoded_buffer, &encoded_size, image_info, strlen(image_info)); - if (ret) { - _E("failed to save image file"); - } else { - ret = rename(ad->temp_image_filename, ad->latest_image_filename); - if (ret != 0 ) - _E("Rename fail"); - } +// if (ret) { +// _E("failed to save image file"); +// } else { +// ret = rename(ad->temp_image_filename, ad->latest_image_filename); +// if (ret != 0 ) +// _E("Rename fail"); +// } pthread_mutex_lock(&ad->mutex); unsigned char *temp = ad->latest_encoded_image_buffer; |